File tree Expand file tree Collapse file tree 4 files changed +32
-26
lines changed
Expand file tree Collapse file tree 4 files changed +32
-26
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,25 @@ variables:
4444
4545 - docker manifest push $DOCKER_IMAGE_FULL_TAG
4646
47+ .promote-image :
48+ image : docker:24.0.2
49+ variables :
50+ PROMOTED_ENVIRONMENT : " dev"
51+ DOCKER_BUILDKIT : 1
52+ services :
53+ - docker:24.0.2-dind
54+ script :
55+ - desired_format="%s" # This format will output the Unix timestamp
56+ - export UNIX_TIMESTAMP=$(date -d "$CI_COMMIT_TIMESTAMP" +"$desired_format")
57+ - echo "Unix timestamp : $UNIX_TIMESTAMP"
58+ - docker buildx imagetools create \
59+ --annotation "index:org.opencontainers.image.version=$CI_COMMIT_SHORT_SHA" \
60+ --annotation "index:org.opencontainers.image.revision=$CI_COMMIT_SHA" \
61+ --annotation "index:org.opencontainers.image.source=$CI_PROJECT_URL" \
62+ --annotation "index:org.opencontainers.image.created=$CI_JOB_STARTED_AT" \
63+ --tag $DOCKER_IMAGE_NAME:$PROMOTED_ENVIRONMENT-$UNIX_TIMESTAMP \
64+ - $DOCKER_IMAGE_FULL_TAG
65+
4766.python-typing :
4867 image : $DOCKER_IMAGE_FULL_TAG
4968 script :
Original file line number Diff line number Diff line change @@ -8,9 +8,10 @@ variables:
88stages :
99 - build
1010 - test
11- - release
11+ - deploy
1212
1313include :
1414 - local : /.gitlab_ci/_templates.yml
1515 - local : /.gitlab_ci/build.yml
1616 - local : /.gitlab_ci/test.yml
17+ - local : /.gitlab_ci/deploy.yml
Original file line number Diff line number Diff line change 1+ promote-dev :
2+ stage : deploy
3+ variables :
4+ DOCKER_IMAGE_TAG_PREFIX : " http-"
5+ rules :
6+ # We run the pipeline only on merge requests or the `main` branch
7+ - if : $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
8+ - if : $CI_PIPELINE_SOURCE == "merge_request_event"
9+ extends :
10+ - .build-and-push-gitlab
11+ when : manual
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments