mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 07:28:10 +00:00
ci: deploy firmwares to the internal server
This commit is contained in:
parent
76f20fbaa5
commit
74bc28b3cb
19
ci/build.yml
19
ci/build.yml
@ -46,11 +46,11 @@ core fw regular build:
|
|||||||
- pipenv run make sizecheck
|
- pipenv run make sizecheck
|
||||||
- cd ..
|
- cd ..
|
||||||
- export VERSION=$(./tools/version.sh core/embed/firmware/version.h)
|
- export VERSION=$(./tools/version.sh core/embed/firmware/version.h)
|
||||||
- cp core/build/firmware/firmware.bin trezor-$VERSION-$CI_COMMIT_SHORT_SHA.bin
|
- cp core/build/firmware/firmware.bin trezor-fw-regular-$VERSION-$CI_COMMIT_SHORT_SHA.bin
|
||||||
artifacts:
|
artifacts:
|
||||||
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
|
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
|
||||||
paths:
|
paths:
|
||||||
- trezor-*.*.*-$CI_COMMIT_SHORT_SHA.bin
|
- trezor-fw-regular-*.*.*-$CI_COMMIT_SHORT_SHA.bin
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
|
|
||||||
core fw btconly build:
|
core fw btconly build:
|
||||||
@ -65,11 +65,11 @@ core fw btconly build:
|
|||||||
- cd ..
|
- cd ..
|
||||||
- pipenv run ./tools/check-bitcoin-only core/build/firmware/firmware-bitcoinonly.bin
|
- pipenv run ./tools/check-bitcoin-only core/build/firmware/firmware-bitcoinonly.bin
|
||||||
- export VERSION=$(./tools/version.sh core/embed/firmware/version.h)
|
- export VERSION=$(./tools/version.sh core/embed/firmware/version.h)
|
||||||
- cp core/build/firmware/firmware-bitcoinonly.bin trezor-$VERSION-$CI_COMMIT_SHORT_SHA-bitcoinonly.bin
|
- cp core/build/firmware/firmware-bitcoinonly.bin trezor-fw-btconly-$VERSION-$CI_COMMIT_SHORT_SHA.bin
|
||||||
artifacts:
|
artifacts:
|
||||||
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
|
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
|
||||||
paths:
|
paths:
|
||||||
- trezor-*.*.*-$CI_COMMIT_SHORT_SHA-bitcoinonly.bin
|
- trezor-fw-btconly-*.*.*-$CI_COMMIT_SHORT_SHA.bin
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
|
|
||||||
core unix regular build:
|
core unix regular build:
|
||||||
@ -132,11 +132,12 @@ build core unix frozen regular darwin:
|
|||||||
- mkdir -p TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/{MacOS,libs}
|
- mkdir -p TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/{MacOS,libs}
|
||||||
- cp -v core/build/unix/micropython TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/MacOS/TrezorEmu-$CI_COMMIT_SHORT_SHA
|
- cp -v core/build/unix/micropython TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/MacOS/TrezorEmu-$CI_COMMIT_SHORT_SHA
|
||||||
- dylibbundler -of -b -i /usr/lib/system -d TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/libs -x TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/MacOS/TrezorEmu-$CI_COMMIT_SHORT_SHA
|
- dylibbundler -of -b -i /usr/lib/system -d TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/libs -x TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/MacOS/TrezorEmu-$CI_COMMIT_SHORT_SHA
|
||||||
|
- mv TrezorEmu-$CI_COMMIT_SHORT_SHA.app trezor-emu-regular-macos-$VERSION-$CI_COMMIT_SHORT_SHA.app
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
artifacts:
|
artifacts:
|
||||||
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
|
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
|
||||||
paths:
|
paths:
|
||||||
- TrezorEmu-$CI_COMMIT_SHORT_SHA.app
|
- trezor-emu-regular-macos-$VERSION-$CI_COMMIT_SHORT_SHA.app
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
|
|
||||||
# Crypto
|
# Crypto
|
||||||
@ -175,11 +176,11 @@ legacy fw regular build:
|
|||||||
- pipenv run make -C demo
|
- pipenv run make -C demo
|
||||||
- cd ..
|
- cd ..
|
||||||
- export VERSION=$(./tools/version.sh legacy/firmware/version.h)
|
- export VERSION=$(./tools/version.sh legacy/firmware/version.h)
|
||||||
- cp legacy/firmware/trezor.bin trezor-$VERSION-$CI_COMMIT_SHORT_SHA.bin
|
- mv legacy/firmware/trezor.bin trezor-fw-regular-$VERSION-$CI_COMMIT_SHORT_SHA.bin
|
||||||
artifacts:
|
artifacts:
|
||||||
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
|
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
|
||||||
paths:
|
paths:
|
||||||
- trezor-*.*.*-$CI_COMMIT_SHORT_SHA.bin
|
- trezor-fw-regular-*.*.*-$CI_COMMIT_SHORT_SHA.bin
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
|
|
||||||
legacy fw debug build:
|
legacy fw debug build:
|
||||||
@ -205,11 +206,11 @@ legacy fw btconly build:
|
|||||||
- cd ..
|
- cd ..
|
||||||
- pipenv run ./tools/check-bitcoin-only legacy/firmware/trezor-bitcoinonly.bin
|
- pipenv run ./tools/check-bitcoin-only legacy/firmware/trezor-bitcoinonly.bin
|
||||||
- export VERSION=$(./tools/version.sh legacy/firmware/version.h)
|
- export VERSION=$(./tools/version.sh legacy/firmware/version.h)
|
||||||
- cp legacy/firmware/trezor-bitcoinonly.bin trezor-$VERSION-$CI_COMMIT_SHORT_SHA-bitcoinonly.bin
|
- mv legacy/firmware/trezor-bitcoinonly.bin trezor-fw-btconly-$VERSION-$CI_COMMIT_SHORT_SHA.bin
|
||||||
artifacts:
|
artifacts:
|
||||||
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
|
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
|
||||||
paths:
|
paths:
|
||||||
- trezor-*.*.*-$CI_COMMIT_SHORT_SHA-bitcoinonly.bin
|
- trezor-fw-btconly-*.*.*-$CI_COMMIT_SHORT_SHA.bin
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
|
|
||||||
legacy emu regular build:
|
legacy emu regular build:
|
||||||
|
180
ci/deploy.yml
180
ci/deploy.yml
@ -1,40 +1,196 @@
|
|||||||
image: registry.gitlab.com/satoshilabs/trezor/trezor-firmware/environment
|
image: registry.gitlab.com/satoshilabs/trezor/trezor-firmware/environment
|
||||||
|
|
||||||
# Core
|
# Releases
|
||||||
|
|
||||||
core to upgrade tests deploy:
|
release core fw regular deploy:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
variables:
|
variables:
|
||||||
DEPLOY_DIRECTORY: "${DEPLOY_BASE_DIR}/upgrade_tests"
|
DEPLOY_DIRECTORY: "releases/firmwares"
|
||||||
|
before_script: [] # no pipenv
|
||||||
|
dependencies:
|
||||||
|
- core fw regular build
|
||||||
|
script:
|
||||||
|
- export VERSION=$(./tools/version.sh core/embed/firmware/version.h)
|
||||||
|
- export NAME="trezor-fw-regular-$VERSION-$CI_COMMIT_SHORT_SHA.bin"
|
||||||
|
- echo "Deploying to ${DEPLOY_DIRECTORY}/$NAME"
|
||||||
|
- mkdir -p "${DEPLOY_BASE_DIR}/${DEPLOY_DIRECTORY}"
|
||||||
|
- rsync --delete -va $NAME "${DEPLOY_BASE_DIR}/${DEPLOY_DIRECTORY}/$NAME"
|
||||||
|
only:
|
||||||
|
- /^core\/v[0-9.]*$/
|
||||||
|
except:
|
||||||
|
- branches # run for tags only
|
||||||
|
tags:
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
release core fw btconly deploy:
|
||||||
|
stage: deploy
|
||||||
|
variables:
|
||||||
|
DEPLOY_DIRECTORY: "releases/firmwares"
|
||||||
|
before_script: [] # no pipenv
|
||||||
|
dependencies:
|
||||||
|
- core fw btconly build
|
||||||
|
script:
|
||||||
|
- export VERSION=$(./tools/version.sh core/embed/firmware/version.h)
|
||||||
|
- export NAME="trezor-fw-btconly-$VERSION-$CI_COMMIT_SHORT_SHA.bin"
|
||||||
|
- echo "Deploying to ${DEPLOY_DIRECTORY}/$NAME"
|
||||||
|
- mkdir -p "${DEPLOY_BASE_DIR}/${DEPLOY_DIRECTORY}"
|
||||||
|
- rsync --delete -va $NAME "${DEPLOY_BASE_DIR}/${DEPLOY_DIRECTORY}/$NAME"
|
||||||
|
only:
|
||||||
|
- /^core\/v[0-9.]*$/
|
||||||
|
except:
|
||||||
|
- branches # run for tags only
|
||||||
|
tags:
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
release legacy fw regular deploy:
|
||||||
|
stage: deploy
|
||||||
|
variables:
|
||||||
|
DEPLOY_DIRECTORY: "releases/firmwares"
|
||||||
|
before_script: [] # no pipenv
|
||||||
|
dependencies:
|
||||||
|
- legacy fw regular build
|
||||||
|
script:
|
||||||
|
- export VERSION=$(./tools/version.sh legacy/firmware/version.h)
|
||||||
|
- export NAME="trezor-fw-regular-$VERSION-$CI_COMMIT_SHORT_SHA.bin"
|
||||||
|
- echo "Deploying to ${DEPLOY_DIRECTORY}/$NAME"
|
||||||
|
- mkdir -p "${DEPLOY_BASE_DIR}/${DEPLOY_DIRECTORY}"
|
||||||
|
- rsync --delete -va $NAME "${DEPLOY_BASE_DIR}/${DEPLOY_DIRECTORY}/$NAME"
|
||||||
|
only:
|
||||||
|
- /^legacy\/v[0-9.]*$/
|
||||||
|
except:
|
||||||
|
- branches # run for tags only
|
||||||
|
tags:
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
legacy fw btconly deploy:
|
||||||
|
stage: deploy
|
||||||
|
variables:
|
||||||
|
DEPLOY_DIRECTORY: "releases/firmwares"
|
||||||
|
before_script: [] # no pipenv
|
||||||
|
dependencies:
|
||||||
|
- legacy fw regular build
|
||||||
|
script:
|
||||||
|
- export VERSION=$(./tools/version.sh legacy/firmware/version.h)
|
||||||
|
- export NAME="trezor-fw-btconly-$VERSION-$CI_COMMIT_SHORT_SHA.bin"
|
||||||
|
- echo "Deploying to ${DEPLOY_DIRECTORY}/$NAME"
|
||||||
|
- mkdir -p "${DEPLOY_BASE_DIR}/${DEPLOY_DIRECTORY}"
|
||||||
|
- rsync --delete -va $NAME "${DEPLOY_BASE_DIR}/${DEPLOY_DIRECTORY}/$NAME"
|
||||||
|
only:
|
||||||
|
- /^legacy\/v[0-9.]*$/
|
||||||
|
except:
|
||||||
|
- branches # run for tags only
|
||||||
|
tags:
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
|
||||||
|
# Release candidates
|
||||||
|
|
||||||
|
rc core fw regular deploy:
|
||||||
|
stage: deploy
|
||||||
|
before_script: [] # no pipenv
|
||||||
|
dependencies:
|
||||||
|
- core fw regular build
|
||||||
|
script:
|
||||||
|
- export DEPLOY_DIRECTORY="release_candidates/${CI_COMMIT_REF_NAME:8}/firmwares" # stripping 'release/'
|
||||||
|
- export VERSION=$(./tools/version.sh core/embed/firmware/version.h)
|
||||||
|
- export NAME="trezor-fw-regular-$VERSION-$CI_COMMIT_SHORT_SHA.bin"
|
||||||
|
- echo "Deploying to ${DEPLOY_DIRECTORY}/$NAME"
|
||||||
|
- mkdir -p "${DEPLOY_BASE_DIR}/${DEPLOY_DIRECTORY}"
|
||||||
|
- rsync --delete -va $NAME "${DEPLOY_BASE_DIR}/${DEPLOY_DIRECTORY}/$NAME"
|
||||||
|
only:
|
||||||
|
- /^release\/[0-9]{4}-[0-9]{2}$/
|
||||||
|
tags:
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
rc core fw btconly deploy:
|
||||||
|
stage: deploy
|
||||||
|
before_script: [] # no pipenv
|
||||||
|
dependencies:
|
||||||
|
- core fw btconly build
|
||||||
|
script:
|
||||||
|
- export DEPLOY_DIRECTORY="release_candidates/${CI_COMMIT_REF_NAME:8}/firmwares" # stripping 'release/'
|
||||||
|
- export VERSION=$(./tools/version.sh core/embed/firmware/version.h)
|
||||||
|
- export NAME="trezor-fw-btconly-$VERSION-$CI_COMMIT_SHORT_SHA.bin"
|
||||||
|
- echo "Deploying to ${DEPLOY_DIRECTORY}/$NAME"
|
||||||
|
- mkdir -p "${DEPLOY_BASE_DIR}/${DEPLOY_DIRECTORY}"
|
||||||
|
- rsync --delete -va $NAME "${DEPLOY_BASE_DIR}/${DEPLOY_DIRECTORY}/$NAME"
|
||||||
|
only:
|
||||||
|
- /^release\/[0-9]{4}-[0-9]{2}$/
|
||||||
|
tags:
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
rc legacy fw regular deploy:
|
||||||
|
stage: deploy
|
||||||
|
before_script: [] # no pipenv
|
||||||
|
dependencies:
|
||||||
|
- legacy fw regular build
|
||||||
|
script:
|
||||||
|
- export DEPLOY_DIRECTORY="release_candidates/${CI_COMMIT_REF_NAME:8}/firmwares" # stripping 'release/'
|
||||||
|
- export VERSION=$(./tools/version.sh legacy/firmware/version.h)
|
||||||
|
- export NAME="trezor-fw-regular-$VERSION-$CI_COMMIT_SHORT_SHA.bin"
|
||||||
|
- echo "Deploying to ${DEPLOY_DIRECTORY}/$NAME"
|
||||||
|
- mkdir -p "${DEPLOY_BASE_DIR}/${DEPLOY_DIRECTORY}"
|
||||||
|
- rsync --delete -va $NAME "${DEPLOY_BASE_DIR}/${DEPLOY_DIRECTORY}/$NAME"
|
||||||
|
only:
|
||||||
|
- /^release\/[0-9]{4}-[0-9]{2}$/
|
||||||
|
tags:
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
rc legacy fw btconly deploy:
|
||||||
|
stage: deploy
|
||||||
|
before_script: [] # no pipenv
|
||||||
|
dependencies:
|
||||||
|
- legacy fw btconly build
|
||||||
|
script:
|
||||||
|
- export DEPLOY_DIRECTORY="release_candidates/${CI_COMMIT_REF_NAME:8}/firmwares" # stripping 'release/'
|
||||||
|
- export VERSION=$(./tools/version.sh legacy/firmware/version.h)
|
||||||
|
- export NAME="trezor-fw-btconly-$VERSION-$CI_COMMIT_SHORT_SHA.bin"
|
||||||
|
- echo "Deploying to ${DEPLOY_DIRECTORY}/$NAME"
|
||||||
|
- mkdir -p "${DEPLOY_BASE_DIR}/${DEPLOY_DIRECTORY}"
|
||||||
|
- rsync --delete -va $NAME "${DEPLOY_BASE_DIR}/${DEPLOY_DIRECTORY}/$NAME"
|
||||||
|
only:
|
||||||
|
- /^release\/[0-9]{4}-[0-9]{2}$/
|
||||||
|
tags:
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
# Upgrade tests
|
||||||
|
|
||||||
|
upgrade tests core deploy:
|
||||||
|
stage: deploy
|
||||||
|
variables:
|
||||||
|
DEPLOY_PATH: "${DEPLOY_BASE_DIR}/upgrade_tests"
|
||||||
before_script: [] # no pipenv
|
before_script: [] # no pipenv
|
||||||
when: manual
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- core unix frozen debug build
|
- core unix frozen debug build
|
||||||
script:
|
script:
|
||||||
- TAG=`git tag --points-at HEAD | sed "s/\//-/"`
|
- TAG=`git tag --points-at HEAD | sed "s/\//-/"`
|
||||||
- "[[ ! $TAG =~ 'core' ]] && echo 'Tag is not core/*: exiting.' && exit 1"
|
- "[[ ! $TAG =~ 'core' ]] && echo 'Tag is not core/*: exiting.' && exit 1"
|
||||||
- DEST=${DEPLOY_DIRECTORY}/trezor-emu-`git tag --points-at HEAD | sed "s/\//-/"`
|
- DEST=${DEPLOY_PATH}/trezor-emu-`git tag --points-at HEAD | sed "s/\//-/"`
|
||||||
- echo "Deploying to $DEST"
|
- echo "Deploying to $DEST"
|
||||||
- rsync --delete -va core/build/unix/micropython "$DEST"
|
- rsync --delete -va core/build/unix/micropython "$DEST"
|
||||||
|
only:
|
||||||
|
- /^core\/v[0-9.]*$/
|
||||||
|
except:
|
||||||
|
- branches # run for tags only
|
||||||
tags:
|
tags:
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
|
upgrade tests legacy deploy:
|
||||||
# Legacy
|
|
||||||
|
|
||||||
legacy to upgrade tests deploy:
|
|
||||||
stage: deploy
|
stage: deploy
|
||||||
variables:
|
variables:
|
||||||
DEPLOY_DIRECTORY: "${DEPLOY_BASE_DIR}/upgrade_tests"
|
DEPLOY_PATH: "${DEPLOY_BASE_DIR}/upgrade_tests"
|
||||||
before_script: [] # no pipenv
|
before_script: [] # no pipenv
|
||||||
when: manual
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- legacy emu regular build
|
- legacy emu regular build
|
||||||
script:
|
script:
|
||||||
- TAG=`git tag --points-at HEAD | sed "s/\//-/"`
|
- TAG=`git tag --points-at HEAD | sed "s/\//-/"`
|
||||||
- "[[ ! $TAG =~ 'legacy' ]] && echo 'Tag is not legacy/*: exiting.' && exit 1"
|
- "[[ ! $TAG =~ 'legacy' ]] && echo 'Tag is not legacy/*: exiting.' && exit 1"
|
||||||
- DEST=${DEPLOY_DIRECTORY}/trezor-emu-`git tag --points-at HEAD | sed "s/\//-/"`
|
- DEST=${DEPLOY_PATH}/trezor-emu-`git tag --points-at HEAD | sed "s/\//-/"`
|
||||||
- echo "Deploying to $DEST"
|
- echo "Deploying to $DEST"
|
||||||
- rsync --delete -va legacy/firmware/trezor.elf "$DEST"
|
- rsync --delete -va legacy/firmware/trezor.elf "$DEST"
|
||||||
|
only:
|
||||||
|
- /^legacy\/v[0-9.]*$/
|
||||||
|
except:
|
||||||
|
- branches # run for tags only
|
||||||
tags:
|
tags:
|
||||||
- deploy
|
- deploy
|
||||||
|
Loading…
Reference in New Issue
Block a user