2019-02-05 13:26:40 +00:00
|
|
|
image: node:10.15.1
|
|
|
|
|
|
|
|
variables:
|
|
|
|
CYPRESS_CACHE_FOLDER: "$CI_PROJECT_DIR/cache/Cypress"
|
2018-10-01 13:12:54 +00:00
|
|
|
|
2019-04-25 14:17:28 +00:00
|
|
|
before_script:
|
|
|
|
- "apt-get update"
|
|
|
|
- "apt-get install -y build-essential"
|
|
|
|
|
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-03-04 14:15:56 +00:00
|
|
|
- node_modules
|
2019-02-05 13:26:40 +00:00
|
|
|
- ${CYPRESS_CACHE_FOLDER}
|
2018-10-22 11:04:16 +00:00
|
|
|
|
|
|
|
stages:
|
|
|
|
- test
|
|
|
|
- build
|
|
|
|
- deploy
|
2019-02-05 13:26:40 +00:00
|
|
|
- integration tests
|
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
|
2018-11-22 13:22:45 +00:00
|
|
|
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
|
2018-11-22 13:22:45 +00:00
|
|
|
only:
|
2018-11-22 13:24:10 +00:00
|
|
|
- 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
|
2019-02-05 13:26:40 +00:00
|
|
|
- scripts/s3sync.sh
|
|
|
|
|
2019-04-25 11:22:52 +00:00
|
|
|
# build emulator and bridge image:
|
|
|
|
# variables:
|
|
|
|
# CONTAINER_NAME: "$CI_REGISTRY/emulator-bridge-tests"
|
|
|
|
# image: docker:latest
|
|
|
|
# services:
|
|
|
|
# - docker:dind
|
|
|
|
# before_script:
|
|
|
|
# - docker login $CI_REGISTRY -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
|
|
|
|
# stage: build
|
|
|
|
# when: manual
|
|
|
|
# script:
|
|
|
|
# - docker pull $CONTAINER_NAME:latest || true
|
|
|
|
# - docker build --cache-from $CONTAINER_NAME:latest --tag $CONTAINER_NAME:$CI_COMMIT_SHA --tag $CONTAINER_NAME:latest .
|
|
|
|
# - docker push $CONTAINER_NAME:$CI_COMMIT_SHA
|
|
|
|
# - docker push $CONTAINER_NAME:latest
|
2018-10-23 14:29:33 +00:00
|
|
|
|
|
|
|
deploy review:
|
|
|
|
stage: deploy
|
2018-10-25 11:56:31 +00:00
|
|
|
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
|
2019-04-25 14:30:57 +00:00
|
|
|
before_script: []
|
2018-10-23 14:29:33 +00:00
|
|
|
script:
|
|
|
|
- echo "Deploy a review app"
|
2018-10-25 11:56:31 +00:00
|
|
|
- '[ -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}/"
|
2018-12-12 15:11:09 +00:00
|
|
|
- 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
|
2018-10-25 11:56:31 +00:00
|
|
|
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
|
2019-04-25 14:30:57 +00:00
|
|
|
before_script: []
|
2018-10-25 12:47:39 +00:00
|
|
|
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
|
2019-04-25 14:30:57 +00:00
|
|
|
before_script: []
|
2018-10-25 12:47:39 +00:00
|
|
|
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
|
2019-04-25 14:30:57 +00:00
|
|
|
before_script: []
|
2018-11-26 15:39:51 +00:00
|
|
|
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
|
2019-02-05 13:26:40 +00:00
|
|
|
|
2019-04-12 13:30:21 +00:00
|
|
|
# integration tests:
|
|
|
|
# image: docker:latest
|
|
|
|
# services:
|
|
|
|
# - docker:dind
|
|
|
|
# stage: integration tests
|
|
|
|
# script:
|
|
|
|
# - 'export SHARED_PATH="$(dirname ${CI_PROJECT_DIR})/shared"'
|
|
|
|
# - rm -r ${SHARED_PATH} || true
|
|
|
|
# - docker build -f Dockerfile.test -t wallet-emulator-bridge-tests .
|
|
|
|
# - mkdir -p ${SHARED_PATH}/trezor-wallet/screenshots
|
|
|
|
# - mkdir -p ${SHARED_PATH}/trezor-wallet/videos
|
|
|
|
# - docker run --volume ${SHARED_PATH}/trezor-wallet/screenshots:/trezor-wallet/test/screenshots --volume ${SHARED_PATH}/trezor-wallet/videos:/trezor-wallet/test/videos --rm wallet-emulator-bridge-tests
|
|
|
|
# - find ${SHARED_PATH}
|
|
|
|
# - mkdir trezor-wallet
|
|
|
|
# - cp -r ${SHARED_PATH}/ trezor-wallet/
|
|
|
|
# artifacts:
|
|
|
|
# when: always
|
|
|
|
# expire_in: 1 week
|
|
|
|
# paths:
|
|
|
|
# - trezor-wallet/
|