mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-11 16:00:57 +00:00
ci: add script for automating common sync
This commit is contained in:
parent
37bd121394
commit
2c2474db07
25
ci/common_sync/common_repo_sync.sh
Executable file
25
ci/common_sync/common_repo_sync.sh
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
GH_USER="$GH_TREZOR_BOT"
|
||||||
|
GH_TOKEN="$GH_TOKEN_COMMON_SYNC"
|
||||||
|
|
||||||
|
# checkout to temporary branch
|
||||||
|
git checkout -B tmp
|
||||||
|
|
||||||
|
# setup trezor-common remote
|
||||||
|
git remote add sync-common https://$GH_USER:$GH_TOKEN@github.com/trezor/trezor-common.git 2>/dev/null
|
||||||
|
|
||||||
|
# top commit in HEAD before monorepo was introduced
|
||||||
|
TOP_COMMIT_IN_COMMON=893fd219d4a01bcffa0cd9cfa631856371ec5aa9
|
||||||
|
|
||||||
|
# convert contents of the repository so that common/ is the root
|
||||||
|
git filter-repo --refs $TOP_COMMIT_IN_COMMON..HEAD --subdirectory-filter=common/ --force
|
||||||
|
|
||||||
|
# filter out .gitrepo
|
||||||
|
git filter-repo --refs $TOP_COMMIT_IN_COMMON..HEAD --path .gitrepo --invert-paths
|
||||||
|
|
||||||
|
# push changes to trezor-common repository
|
||||||
|
git push sync-common tmp:master
|
||||||
|
|
||||||
|
# cleanup
|
||||||
|
git remote remove sync-common
|
4004
ci/common_sync/git-filter-repo
Executable file
4004
ci/common_sync/git-filter-repo
Executable file
File diff suppressed because it is too large
Load Diff
@ -239,3 +239,19 @@ ui tests core fixtures deploy:
|
|||||||
- rsync --delete -va ci/ui_test_records/* "$DEPLOY_PATH"
|
- rsync --delete -va ci/ui_test_records/* "$DEPLOY_PATH"
|
||||||
tags:
|
tags:
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
|
# common sync to trezor-common
|
||||||
|
|
||||||
|
common sync:
|
||||||
|
stage: deploy
|
||||||
|
variables:
|
||||||
|
GIT_SUBMODULE_STRATEGY: "none"
|
||||||
|
GIT_STRATEGY: clone # clone entire repo instead of reusing workspace
|
||||||
|
GIT_DEPTH: 0 # avoid shallow clone
|
||||||
|
only:
|
||||||
|
- schedules
|
||||||
|
needs: []
|
||||||
|
before_script: [] # no poetry
|
||||||
|
script:
|
||||||
|
- echo "Synchronizing common with the trezor-common repository"
|
||||||
|
- ./ci/common_sync/common_repo_sync.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user