Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Commits on Source (2)
(chore): use pipeline id vs commit id
· eccb8c13
Mark Harding
authored
Aug 27, 2019
eccb8c13
Merge branch 'fix/use-pipeline-id-vs-commit' into 'master'
· 5ed6e576
Mark Harding
authored
Aug 27, 2019
(chore): use pipeline id vs commit id See merge request
!518
5ed6e576
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
5ed6e576
...
...
@@ -60,7 +60,7 @@ e2e:chrome:
build:review
:
stage
:
build
before_script
:
-
sed -ri "s|\"VERSION\"|\"$CI_
COMMIT_SHA
\"|" src/environments/environment.prod.ts
-
sed -ri "s|\"VERSION\"|\"$CI_
PIPELINE_ID
\"|" src/environments/environment.prod.ts
script
:
-
npm ci && npm install -g gulp-cli
-
npm run postinstall
...
...
@@ -78,7 +78,7 @@ build:review:
build:production:en
:
stage
:
build
before_script
:
-
sed -ri "s|\"VERSION\"|\"$CI_
COMMIT_SHA
\"|" src/environments/environment.prod.ts
-
sed -ri "s|\"VERSION\"|\"$CI_
PIPELINE_ID
\"|" src/environments/environment.prod.ts
script
:
-
npm ci && npm install -g gulp-cli
-
npm run postinstall
...
...
@@ -96,7 +96,7 @@ build:production:en:
build:production:i18n
:
stage
:
build
before_script
:
-
sed -ri "s|\"VERSION\"|\"$CI_
COMMIT_SHA
\"|" src/environments/environment.prod.ts
-
sed -ri "s|\"VERSION\"|\"$CI_
PIPELINE_ID
\"|" src/environments/environment.prod.ts
script
:
-
npm ci && npm install -g gulp-cli
-
npm run postinstall
...
...
@@ -119,20 +119,20 @@ build:production:i18n:
stage
:
prepare
image
:
getsentry/sentry-cli
script
:
-
echo "Create a new release $CI_
COMMIT_SHA
"
-
sentry-cli releases new $CI_
COMMIT_SHA
-
sentry-cli releases set-commits --auto $CI_
COMMIT_SHA
-
sentry-cli releases files $CI_
COMMIT_SHA
upload-sourcemaps $CI_PROJECT_DIR/dist/en -x .js -x .map --validate --url-prefix $SOURCEMAP_PREFIX
-
sentry-cli releases finalize $CI_
COMMIT_SHA
-
echo "Finalized release for $CI_
COMMIT_SHA
"
-
echo "Create a new release $CI_
PIPELINE_ID
"
-
sentry-cli releases new $CI_
PIPELINE_ID
-
sentry-cli releases set-commits --auto $CI_
PIPELINE_ID
-
sentry-cli releases files $CI_
PIPELINE_ID
upload-sourcemaps $CI_PROJECT_DIR/dist/en -x .js -x .map --validate --url-prefix $SOURCEMAP_PREFIX
-
sentry-cli releases finalize $CI_
PIPELINE_ID
-
echo "Finalized release for $CI_
PIPELINE_ID
"
prepare:review
:
stage
:
prepare
image
:
minds/ci:latest
script
:
-
docker login -u gitlab-ci-token -p ${CI_BUILD_TOKEN} ${CI_REGISTRY}
-
docker build -t $CI_REGISTRY_IMAGE/front-init:$CI_
BUILD_REF
-f containers/front-init/Dockerfile dist/.
-
docker push $CI_REGISTRY_IMAGE/front-init:$CI_
BUILD_REF
-
docker build -t $CI_REGISTRY_IMAGE/front-init:$CI_
PIPELINE_ID
-f containers/front-init/Dockerfile dist/.
-
docker push $CI_REGISTRY_IMAGE/front-init:$CI_
PIPELINE_ID
dependencies
:
-
build:review
except
:
...
...
@@ -156,8 +156,8 @@ prepare:production:
image
:
minds/ci:latest
script
:
-
docker login -u gitlab-ci-token -p ${CI_BUILD_TOKEN} ${CI_REGISTRY}
-
docker build -t $CI_REGISTRY_IMAGE/front-init:$CI_
BUILD_REF
-f containers/front-init/Dockerfile dist/.
-
docker push $CI_REGISTRY_IMAGE/front-init:$CI_
BUILD_REF
-
docker build -t $CI_REGISTRY_IMAGE/front-init:$CI_
PIPELINE_ID
-f containers/front-init/Dockerfile dist/.
-
docker push $CI_REGISTRY_IMAGE/front-init:$CI_
PIPELINE_ID
only
:
refs
:
-
master
...
...
@@ -208,14 +208,14 @@ review:start:
--install
\
--reuse-values
\
--set
frontInit.image.repository=$CI_REGISTRY_IMAGE/front-init
\
--set
frontInit.image.tag=$CI_
BUILD_REF
\
--set
-string
frontInit.image.tag=$CI_
PIPELINE_ID
\
--set
domain=$CI_BUILD_REF_SLUG.$KUBE_INGRESS_BASE_DOMAIN
\
--set
elasticsearch.clusterName=$CI_BUILD_REF_SLUG--elasticsearch
\
--wait
\
$CI_BUILD_REF_SLUG
\
./helm-charts/minds"
# Update sentry
-
sentry-cli releases deploys $CI_
COMMIT_SHA
new -e review-$CI_COMMIT_REF_SLUG
-
sentry-cli releases deploys $CI_
PIPELINE_ID
new -e review-$CI_COMMIT_REF_SLUG
environment
:
name
:
review/$CI_COMMIT_REF_NAME
url
:
https://$CI_BUILD_REF_SLUG.$KUBE_INGRESS_BASE_DOMAIN
...
...
@@ -242,13 +242,13 @@ review:stop:
-
$(aws ecr get-login --no-include-email --region us-east-1)
## Update docker front-init container
-
docker login -u gitlab-ci-token -p ${CI_BUILD_TOKEN} ${CI_REGISTRY}
-
docker pull $CI_REGISTRY_IMAGE/front-init:$CI_
BUILD_REF
-
docker tag $CI_REGISTRY_IMAGE/front-init:$CI_
BUILD_REF
$ECR_REPOSITORY_URL:$IMAGE_LABEL
-
docker pull $CI_REGISTRY_IMAGE/front-init:$CI_
PIPELINE_ID
-
docker tag $CI_REGISTRY_IMAGE/front-init:$CI_
PIPELINE_ID
$ECR_REPOSITORY_URL:$IMAGE_LABEL
-
docker push $ECR_REPOSITORY_URL:$IMAGE_LABEL
## Deploy the new container in rolling restart
-
aws ecs update-service --service=$ECS_SERVICE --force-new-deployment --region us-east-1 --cluster=$ECS_CLUSTER
## Update sentry
-
sentry-cli releases deploys $CI_
COMMIT_SHA
new -e $IMAGE_LABEL
-
sentry-cli releases deploys $CI_
PIPELINE_ID
new -e $IMAGE_LABEL
dependencies
:
-
build:production:en
-
build:production:i18n
...
...