From f0e45b6c332533cc5867eef06ecc2324e5c8bc22 Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Thu, 25 Oct 2018 14:47:39 +0200 Subject: [PATCH 1/6] Prepare gitlab configs --- .gitlab-ci.yml | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 39a4de52..2ba88ca3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,17 +40,15 @@ build beta: stage: build script: - yarn run build:beta - when: manual artifacts: expire_in: 1 month paths: - build/beta -build production: +build stable: stage: build script: - yarn run build:stable - when: manual artifacts: expire_in: 1 month paths: @@ -73,3 +71,33 @@ deploy review: - branches tags: - deploy + +deploy stage beta: + stage: deploy + variables: + GIT_STRATEGY: none + when: + - manual + dependencies: + - build beta + script: + - echo "Deploy staging beta version" + only: + - beta + tags: + - deploy + +deploy stage stable: + stage: deploy + variables: + GIT_STRATEGY: none + when: + - manual + dependencies: + - build stable + script: + - echo "Deploy staging stable version" + only: + - stable + tags: + - deploy From e9cf52ae8017762cb923a7c719fb32251a4913c4 Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Thu, 25 Oct 2018 14:50:15 +0200 Subject: [PATCH 2/6] fix yaml --- .gitlab-ci.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2ba88ca3..d8551c1b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -76,8 +76,7 @@ deploy stage beta: stage: deploy variables: GIT_STRATEGY: none - when: - - manual + when: manual dependencies: - build beta script: @@ -91,8 +90,7 @@ deploy stage stable: stage: deploy variables: GIT_STRATEGY: none - when: - - manual + when: manual dependencies: - build stable script: From ad183068e150b7e5238308c1210563a321a277d5 Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Thu, 25 Oct 2018 15:39:17 +0200 Subject: [PATCH 3/6] Added sync to aws --- .gitlab-ci.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d8551c1b..154cca61 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -44,6 +44,7 @@ build beta: expire_in: 1 month paths: - build/beta + - scripts/s3sync.sh build stable: stage: build @@ -53,6 +54,7 @@ build stable: expire_in: 1 month paths: - build/stable + - scripts/s3sync.sh deploy review: stage: deploy @@ -76,11 +78,13 @@ deploy stage beta: stage: deploy variables: GIT_STRATEGY: none + AWS_ACCESS_KEY_ID: $STAGE_AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: $STAGE_AWS_SECRET_ACCESS_KEY when: manual dependencies: - build beta script: - - echo "Deploy staging beta version" + - scripts/s3sync.sh beta only: - beta tags: @@ -90,11 +94,13 @@ deploy stage stable: stage: deploy variables: GIT_STRATEGY: none + AWS_ACCESS_KEY_ID: $STAGE_AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: $STAGE_AWS_SECRET_ACCESS_KEY when: manual dependencies: - build stable script: - - echo "Deploy staging stable version" + - scripts/s3sync.sh stable only: - stable tags: From 29d5d2ca2686f991d5f83ba759be687ea3e2be6b Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Thu, 25 Oct 2018 15:53:02 +0200 Subject: [PATCH 4/6] Added missing param --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 154cca61..c9344d5e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -84,7 +84,7 @@ deploy stage beta: dependencies: - build beta script: - - scripts/s3sync.sh beta + - scripts/s3sync.sh stage beta only: - beta tags: @@ -100,7 +100,7 @@ deploy stage stable: dependencies: - build stable script: - - scripts/s3sync.sh stable + - scripts/s3sync.sh stage stable only: - stable tags: From 2ab0120e21d6f5f0172a84425475ee7f2e68e76b Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Thu, 25 Oct 2018 15:56:55 +0200 Subject: [PATCH 5/6] Install modules only if needed --- .gitlab-ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c9344d5e..7436df22 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,9 +4,6 @@ cache: paths: - node_modules -before_script: - - yarn install - stages: - test - build @@ -15,6 +12,7 @@ stages: lint: stage: test script: + - yarn install - yarn run lint flow: @@ -25,11 +23,13 @@ flow: unit: stage: test script: + - yarn install - yarn run test build development: stage: build script: + - yarn install - yarn run build:dev artifacts: expire_in: 1 month @@ -39,6 +39,7 @@ build development: build beta: stage: build script: + - yarn install - yarn run build:beta artifacts: expire_in: 1 month @@ -49,6 +50,7 @@ build beta: build stable: stage: build script: + - yarn install - yarn run build:stable artifacts: expire_in: 1 month From b259075a837d9b95f6cfb2600ac83fcb068c8d9e Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Thu, 25 Oct 2018 16:00:29 +0200 Subject: [PATCH 6/6] Expire artifacts in one week --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7436df22..2ec28061 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,7 +32,7 @@ build development: - yarn install - yarn run build:dev artifacts: - expire_in: 1 month + expire_in: 1 week paths: - build/dev @@ -42,7 +42,7 @@ build beta: - yarn install - yarn run build:beta artifacts: - expire_in: 1 month + expire_in: 1 week paths: - build/beta - scripts/s3sync.sh @@ -53,7 +53,7 @@ build stable: - yarn install - yarn run build:stable artifacts: - expire_in: 1 month + expire_in: 1 week paths: - build/stable - scripts/s3sync.sh