-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci-builds.yml
23 lines (20 loc) · 1.74 KB
/
.gitlab-ci-builds.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
build-prod-image:
extends: .base-script
variables:
channel: Prod
services:
- docker:dind
stage: build
image: public.ecr.aws/g4a0y2u8/node-awscli-docker:latest-v20
script:
- node -v
- ( cd packages/store && npm ci && npm run build-ci )
- while true; do sleep 1 && echo "try docker info" && docker info && break; done
- aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $AWS_ECR_URL
- aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/g4a0y2u8
- docker build --build-arg CI_COMMIT_BRANCH=$CI_COMMIT_BRANCH --build-arg CI_PIPELINE_ID=$CI_PIPELINE_ID --build-arg BUILD_ID=$CI_PIPELINE_ID -f ./Dockerfile -t $IMAGE_NAME_PROD . | cat
- docker tag $IMAGE_NAME_PROD public.ecr.aws/g4a0y2u8/$IMAGE_NAME_PROD:$IMAGE_TAG_ID
- docker tag $IMAGE_NAME_PROD public.ecr.aws/g4a0y2u8/$IMAGE_NAME_PROD:latest
- docker push public.ecr.aws/g4a0y2u8/$IMAGE_NAME_PROD:$IMAGE_TAG_ID | cat
- curl --insecure --user project307:$CI_CD_KEY --data-urlencode "projectId=307" --data-urlencode "title=$CI_COMMIT_TITLE" --data-urlencode "message=$CI_COMMIT_MESSAGE" "https://$CI_CD_API_HOST_1/versions/update?channel=$channel&name=$CI_COMMIT_BRANCH&build=$CI_PIPELINE_ID&image=$PROJECT_IMAGE_NAME&url=public.ecr.aws/g4a0y2u8/$IMAGE_NAME_PROD:$IMAGE_TAG_ID" 2>&1
- curl --insecure --user project571:$CI_CD_KEY_2 --data-urlencode "projectId=571" --data-urlencode "title=$CI_COMMIT_TITLE" --data-urlencode "message=$CI_COMMIT_MESSAGE" "https://$CI_CD_API_HOST_2/versions/update?channel=$channel&name=$CI_COMMIT_BRANCH&build=$CI_PIPELINE_ID&image=$PROJECT_IMAGE_NAME&url=public.ecr.aws/g4a0y2u8/$IMAGE_NAME_PROD:$IMAGE_TAG_ID" 2>&1