Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
templates
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tecnalia_robotics-public
templates
Merge requests
!70
Resolve "Update deprecated deploy job"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Update deprecated deploy job"
38-update-deprecated-deploy-job
into
master
Overview
70
Commits
43
Pipelines
38
Changes
1
Merged
Iñigo Moreno i Caireta
requested to merge
38-update-deprecated-deploy-job
into
master
3 years ago
Overview
18
Commits
43
Pipelines
38
Changes
1
Expand
Closes
#38 (closed)
Edited
3 years ago
by
Iñigo Moreno i Caireta
0
0
Merge request reports
Viewing commit
8b4d60a6
Prev
Next
Show latest version
1 file
+
8
−
7
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
8b4d60a6
Refactor tags
· 8b4d60a6
Iñigo Moreno i Caireta
authored
3 years ago
ci-templates/industrial-ci-templates.yml
+
8
−
7
Options
@@ -19,7 +19,6 @@
variables
:
DOCKER_PUSH_REGISTRY
:
${ARTIFACT_DOCKER_URL}
DOCKER_PUSH_NAME
:
${CI_PROJECT_PATH_SLUG}
DOCKER_PUSH_TAG
:
${CI_COMMIT_REF_SLUG}
DDEPLOY_YAML
:
ddeploy.yaml
before_script
:
-
apk add --update python3 git py3-pip git-lfs
@@ -42,12 +41,14 @@
-
ddeploy --yaml ${DDEPLOY_YAML}
# Get ID of image created by ddeploy
-
'
DOCKER_ID=$(docker
images
--format="{{.ID}}"
|
head
-1)'
# Tag and push
-
docker tag ${DOCKER_ID} ${DOCKER_PUSH_REGISTRY}/${DOCKER_PUSH_NAME}:${DOCKER_PUSH_TAG}
-
docker push ${DOCKER_PUSH_REGISTRY}/${DOCKER_PUSH_NAME}:${DOCKER_PUSH_TAG}
# Tag and push latest
-
docker tag ${DOCKER_ID} ${DOCKER_PUSH_REGISTRY}/${DOCKER_PUSH_NAME}:latest
-
docker push ${DOCKER_PUSH_REGISTRY}/${DOCKER_PUSH_NAME}:latest
# Tag and push with the branch or tag name.
-
docker tag ${DOCKER_ID} ${DOCKER_PUSH_REGISTRY}/${DOCKER_PUSH_NAME}:${CI_COMMIT_REF_SLUG}
-
docker push ${DOCKER_PUSH_REGISTRY}/${DOCKER_PUSH_NAME}:${CI_COMMIT_REF_SLUG}
# Tag and push with commit sha
-
docker tag ${DOCKER_ID} ${DOCKER_PUSH_REGISTRY}/${DOCKER_PUSH_NAME}:${CI_COMMIT_SHA}
-
docker push ${DOCKER_PUSH_REGISTRY}/${DOCKER_PUSH_NAME}:${CI_COMMIT_SHA}
# Tag and push with latest only if it's on the default branch
-
if [ $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH ]; then docker tag ${DOCKER_ID} ${DOCKER_PUSH_REGISTRY}/${DOCKER_PUSH_NAME}:latest && docker push ${DOCKER_PUSH_REGISTRY}/${DOCKER_PUSH_NAME}:latest; fi
rules
:
-
if
:
$CI_COMMIT_TAG
when
:
always
Loading