Files
trezor-suite/ci/deploy.yml
2022-09-29 09:58:53 +02:00

229 lines
6.5 KiB
YAML

# Config
.run_everything_rules: &run_everything_rules
refs:
- develop
- releases
- schedules
- /^release\//
# todo: it should be possible to share between files using
# https://docs.gitlab.com/ee/ci/yaml/yaml_optimization.html#reference-tags
.run_connect_rules: &run_connect_rules
refs:
- schedules
- develop
changes:
- "packages/blockchain-link"
- "packages/connect*/**"
- "packages/transport"
- "packages/utxo-lib"
- "packages/utils"
# Suite web deploy to dev
suite-web deploy sldev:
stage: deploy to dev
variables:
DEPLOY_DIRECTORY: ${DEPLOY_BASE_DIR}/suite-web/${CI_BUILD_REF_NAME}
needs:
- suite-web-landing build dev
- suite-web build dev
environment:
name: ${CI_BUILD_REF_NAME}
url: $BASE_REVIEW_URL/${CI_BUILD_REF_NAME}
before_script: []
script:
- mkdir -p ${DEPLOY_DIRECTORY}/web
- rsync --delete -va packages/suite-web-landing/build/ "${DEPLOY_DIRECTORY}/"
- rsync --delete -va packages/suite-web/build/ "${DEPLOY_DIRECTORY}/web/"
tags:
- deploy
interruptible: true
# Suite web landing deploy to dev
suite-web-landing deploy sldev:
stage: deploy to dev
variables:
DEPLOY_DIRECTORY: ${DEPLOY_BASE_DIR}/suite-web-landing/${CI_BUILD_REF_NAME}
needs:
- suite-web-landing build dev
environment:
name: ${CI_BUILD_REF_NAME}
url: $BASE_REVIEW_URL/${CI_BUILD_REF_NAME}
before_script: []
script:
- mkdir -p ${DEPLOY_DIRECTORY}
- rsync --delete -va packages/suite-web-landing/build/ "${DEPLOY_DIRECTORY}/"
tags:
- deploy
interruptible: true
# Suite desktop deploy to dev and production
suite-desktop deploy sldev:
stage: deploy to dev
only:
<<: *run_everything_rules
variables:
DEPLOY_DIRECTORY: ${DEPLOY_BASE_DIR}/suite-desktop/${CI_BUILD_REF_NAME}
script:
- mkdir -p ${DEPLOY_DIRECTORY}
- 'rsync --delete -va "${DESKTOP_APP_NAME}"-*.AppImage "${DEPLOY_DIRECTORY}/" || :'
- 'rsync --delete -va "${DESKTOP_APP_NAME}"-*.dmg "${DEPLOY_DIRECTORY}/" || :'
- 'rsync --delete -va "${DESKTOP_APP_NAME}"-*.exe "${DEPLOY_DIRECTORY}/" || :'
tags:
- deploy
interruptible: true
# # Suite native deploy to dev
# suite-native deploy sldev:
# stage: deploy to dev
# only:
# <<: *run_everything_rules
# variables:
# DEPLOY_DIRECTORY: ${DEPLOY_BASE_DIR}/suite-native/${CI_BUILD_REF_NAME}
# script:
# - mkdir -p ${DEPLOY_DIRECTORY}
# - rsync --delete -va app-release.apk "${DEPLOY_DIRECTORY}/"
# tags:
# - deploy
# TODO: Disabled until the new suite native build is introduced. Fix this deploy job after.
# Messaging system deploy to dev
msg-system deploy sldev:
stage: deploy to dev
needs:
- "msg-system config sign dev"
when: manual
tags:
- deploy
variables:
AWS_CLOUDFRONT_ID: E1ERY5K2OTKKI1
script:
- source ${MSG_SYSTEM_DATA_DEPLOY_KEYFILE}
- aws s3 cp packages/message-system/files/config.v1.jws s3://data.trezor.io/config/develop/config.v1.jws
- aws cloudfront create-invalidation --distribution-id ${AWS_CLOUDFRONT_ID} --paths '/config/develop/*'
interruptible: true
.connect-explorer deploy dev base:
stage: deploy to dev
variables:
DEPLOY_DIRECTORY: ${DEPLOY_BASE_DIR}/connect-explorer/${CI_BUILD_REF_NAME}
environment:
name: ${CI_BUILD_REF_NAME}
url: $BASE_REVIEW_URL/${CI_BUILD_REF_NAME}
before_script: []
script:
- mkdir -p ${DEPLOY_DIRECTORY}/connect-explorer
- rsync --delete -va packages/connect-explorer/build/ "${DEPLOY_DIRECTORY}/"
tags:
- deploy
interruptible: true
connect-explorer deploy sldev:
extends: .connect-explorer deploy dev base
needs:
- connect-explorer build
only:
<<: *run_connect_rules
connect-explorer deploy dev manual:
extends: .connect-explorer deploy dev base
needs:
- connect-explorer build
except:
<<: *run_everything_rules
when: manual
# connect deploy to dev
connect deploy to dev:
stage: deploy to dev
# only:
# <<: *run_connect_rules
needs:
- connect-web build
- connect-explorer build
except:
- v8
variables:
GIT_STRATEGY: none
DEPLOY_DIRECTORY: ${DEPLOY_BASE_DIR}/connect/${CI_BUILD_REF_NAME}
# when: manual
dependencies:
- connect-web build
- connect-explorer build
environment:
name: $CI_BUILD_REF_NAME
url: $BASE_REVIEW_URL/$CI_BUILD_REF_NAME
before_script: []
script:
- rm -rfv ${DEPLOY_DIRECTORY}
- mkdir -pv ${DEPLOY_DIRECTORY}
- rsync -aviuzP packages/connect-iframe/build/ "${DEPLOY_DIRECTORY}/"
- rsync -aviuzP packages/connect-popup/build/ "${DEPLOY_DIRECTORY}/"
- rsync -aviuzP packages/connect-web/build/ "${DEPLOY_DIRECTORY}/"
- rsync -aviuzP packages/connect-explorer/build/ "${DEPLOY_DIRECTORY}/"
- ls -la ${DEPLOY_DIRECTORY}
- ls -la ${DEPLOY_DIRECTORY}/data
- ls -la ${DEPLOY_DIRECTORY}/fonts
- ls -la ${DEPLOY_DIRECTORY}/images
- ls -la ${DEPLOY_DIRECTORY}/js
tags:
- deploy
# todo: use connect_deploy?
# - connect_deploy
interruptible: true
# components deploy
.run_components_rules: &run_components_rules
refs:
- develop
- releases
- schedules
- /^release\//
- /^run\//
changes:
- packages/components
- packages/components-storybook
- yarn.lock
# Deploy
.deploy_common: &deploy_common
stage: deploy to dev
variables:
DEPLOY_DIRECTORY: ${DEPLOY_BASE_DIR}/components/${CI_BUILD_REF_NAME}
environment:
name: ${CI_BUILD_REF_NAME}
url: $BASE_REVIEW_URL/${CI_BUILD_REF_NAME}
before_script: []
script:
- mkdir -p ${DEPLOY_DIRECTORY}
- rsync --delete -va packages/components/.build-storybook/ "${DEPLOY_DIRECTORY}/"
tags:
- deploy
interruptible: true
# Currently two jobs needed, it seems not to be possible to have a job depending on manual job
# https://gitlab.com/gitlab-org/gitlab/-/issues/31264
components storybook deploy sldev:
<<: *deploy_common
only:
<<: *run_components_rules
components storybook deploy dev manual:
<<: *deploy_common
when: manual
except:
<<: *run_components_rules
# components-storybook test snapshots:
# stage: integration testing
# script:
# - npx cypress install
# - CYPRESS_baseUrl=${DEV_SERVER_URL}/components-storybook/${CI_BUILD_REF_NAME} yarn workspace @trezor/integration-tests test:components-storybook
# artifacts:
# expire_in: 7 days
# when: always
# paths:
# - /builds/satoshilabs/trezor/trezor-suite/packages/integration-tests/projects/components-storybook/snapshots
# - /builds/satoshilabs/trezor/trezor-suite/packages/integration-tests/projects/components-storybook/screenshots
# needs: []