1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-28 03:08:30 +00:00
trezor-wallet/.gitlab-ci.yml

141 lines
2.9 KiB
YAML
Raw Normal View History

2018-11-02 10:09:36 +00:00
image: node:9.3
2018-10-01 13:12:54 +00:00
2018-10-22 11:04:16 +00:00
cache:
2019-01-03 13:38:50 +00:00
key: ${CI_COMMIT_REF_SLUG}
2018-10-22 11:04:16 +00:00
paths:
2019-01-03 13:38:50 +00:00
- node_modules/
2018-10-22 11:04:16 +00:00
stages:
- test
- build
- deploy
2018-10-22 10:25:12 +00:00
2018-10-22 11:04:16 +00:00
lint:
stage: test
script:
2018-10-25 13:56:55 +00:00
- yarn install
2018-10-22 11:04:16 +00:00
- yarn run lint
2018-10-01 13:12:54 +00:00
flow:
2018-10-22 11:04:16 +00:00
stage: test
2018-10-01 13:12:54 +00:00
script:
2019-01-03 13:42:20 +00:00
- yarn install
2018-10-01 13:12:54 +00:00
- yarn run flow
2018-10-23 14:31:10 +00:00
unit:
2018-10-22 11:04:16 +00:00
stage: test
2018-10-01 13:12:54 +00:00
script:
2018-10-25 13:56:55 +00:00
- yarn install
2018-10-22 11:04:16 +00:00
- yarn run test
2018-10-01 13:12:54 +00:00
2018-10-23 14:29:33 +00:00
build development:
2018-10-22 11:04:16 +00:00
stage: build
2018-10-01 13:12:54 +00:00
script:
2018-10-25 13:56:55 +00:00
- yarn install
2018-10-22 11:04:16 +00:00
- yarn run build:dev
artifacts:
2018-10-25 14:00:29 +00:00
expire_in: 1 week
2018-10-22 11:04:16 +00:00
paths:
2018-10-23 14:48:54 +00:00
- build/dev
2018-10-22 11:04:16 +00:00
2018-10-23 14:29:33 +00:00
build beta:
2018-10-22 11:04:16 +00:00
stage: build
script:
2018-10-25 13:56:55 +00:00
- yarn install
2018-10-22 11:04:16 +00:00
- yarn run build:beta
only:
- beta
2018-10-22 11:04:16 +00:00
artifacts:
2018-10-25 14:00:29 +00:00
expire_in: 1 week
2018-10-22 11:04:16 +00:00
paths:
2018-10-23 14:48:54 +00:00
- build/beta
2018-10-25 13:39:17 +00:00
- scripts/s3sync.sh
2018-10-22 11:04:16 +00:00
2018-10-25 12:47:39 +00:00
build stable:
2018-10-22 11:04:16 +00:00
stage: build
script:
2018-10-25 13:56:55 +00:00
- yarn install
2018-10-24 21:01:23 +00:00
- yarn run build:stable
only:
- stable
2018-10-22 11:04:16 +00:00
artifacts:
2018-10-25 14:00:29 +00:00
expire_in: 1 week
2018-10-22 11:04:16 +00:00
paths:
2018-10-24 21:01:23 +00:00
- build/stable
2018-10-25 13:39:17 +00:00
- scripts/s3sync.sh
2018-10-23 14:29:33 +00:00
deploy review:
stage: deploy
variables:
GIT_STRATEGY: none
dependencies:
- build development
2018-11-16 14:16:24 +00:00
environment:
name: $CI_BUILD_REF_NAME
url: $BASE_REVIEW_URL/$CI_BUILD_REF_NAME
2018-11-26 15:39:51 +00:00
on_stop: delete review
2018-10-23 14:29:33 +00:00
script:
- echo "Deploy a review app"
- '[ -z "${DEPLOY_BASE_DIR}" ] && echo "Deploy base dir cannot be empty" && exit 255'
- env
- mkdir -p "${DEPLOY_BASE_DIR}/${CI_BUILD_REF_NAME}"
- echo "Copy dev build to web server ${DEPLOY_BASE_DIR}/${CI_BUILD_REF_NAME}..."
- rsync --delete -va build/dev/ "${DEPLOY_BASE_DIR}/${CI_BUILD_REF_NAME}/"
- curl "https://api.telegram.org/bot699197118:AAGXNTaC5Q-ljmy_dMvaIvAKy1XjlkA3Iss/sendMessage?chat_id=-1001354778014&text=https://trezor-wallet-dev.trezor.io/${CI_BUILD_REF_NAME}"
2018-12-12 14:50:30 +00:00
- 'echo "Remove working dir, workaround for cache" && rm -r ./*'
2018-10-23 14:29:33 +00:00
only:
- branches
tags:
- deploy
2018-10-25 12:47:39 +00:00
deploy stage beta:
stage: deploy
variables:
GIT_STRATEGY: none
2018-10-25 13:39:17 +00:00
AWS_ACCESS_KEY_ID: $STAGE_AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $STAGE_AWS_SECRET_ACCESS_KEY
2018-10-25 12:50:15 +00:00
when: manual
2018-10-25 12:47:39 +00:00
dependencies:
- build beta
script:
2018-10-25 13:53:02 +00:00
- scripts/s3sync.sh stage beta
2018-10-25 12:47:39 +00:00
only:
- beta
tags:
- deploy
deploy stage stable:
stage: deploy
variables:
GIT_STRATEGY: none
2018-10-25 13:39:17 +00:00
AWS_ACCESS_KEY_ID: $STAGE_AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $STAGE_AWS_SECRET_ACCESS_KEY
2018-10-25 12:50:15 +00:00
when: manual
2018-10-25 12:47:39 +00:00
dependencies:
- build stable
script:
2018-10-25 13:53:02 +00:00
- scripts/s3sync.sh stage stable
2018-10-25 12:47:39 +00:00
only:
- stable
tags:
- deploy
2018-11-26 15:39:51 +00:00
delete review:
before_script: []
stage: deploy
variables:
GIT_STRATEGY: none
when: manual
environment:
name: $CI_BUILD_REF_NAME
action: stop
script:
- '[ -z "${DEPLOY_BASE_DIR}" ] && echo "Deploy dir can not be empty" && exit 1'
- '[ -z "${CI_BUILD_REF_NAME}" ] && echo "Build name can not be empty" && exit 1'
- '[ ! -d "${DEPLOY_BASE_DIR}/${CI_BUILD_REF_NAME}" ] && echo "Folder can not be found, skipping..." && exit 0'
- 'rm -r "${DEPLOY_BASE_DIR}/${CI_BUILD_REF_NAME}"'
only:
- branches
tags:
- deploy