Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
9736a5ea
Commit
9736a5ea
authored
3 years ago
by
Corné Lukken
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-205
: Smart image management in CI pipeline
parent
d91a2039
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!183
Docker image building & pushing with CI pipeline caching
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sbin/tag_and_push_docker_image.sh
+10
-3
10 additions, 3 deletions
sbin/tag_and_push_docker_image.sh
with
10 additions
and
3 deletions
sbin/tag_and_push_docker_image.sh
+
10
−
3
View file @
9736a5ea
...
@@ -40,10 +40,13 @@ fi
...
@@ -40,10 +40,13 @@ fi
# TODO(Corne): Have this list generated from the .yml files
# TODO(Corne): Have this list generated from the .yml files
LOCAL_IMAGES
=(
LOCAL_IMAGES
=(
"elk"
"elk-configure-host"
"grafana"
"prometheus"
"lofar-device-base"
"elk"
"elk-configure-host"
"grafana"
"prometheus"
"lofar-device-base"
"docker-compose_jupyter"
"docker-compose_integration-test"
"docker-compose_itango"
"docker-compose_tango-prometheus-exporter"
)
)
# TBD TODO(Corne): Verify using these images as cache works
# "docker-compose_jupyter" "docker-compose_integration-test"
# "docker-compose_itango" "docker-compose_tango-prometheus-exporter"
#)
# If first argument set run second stage, determine LOCAL_IMAGE to build and
# If first argument set run second stage, determine LOCAL_IMAGE to build and
# push from the argument
# push from the argument
if
[
!
-z
"
${
1
+x
}
"
]
&&
[
"
${
1
}
"
!=
"pull"
]
;
then
if
[
!
-z
"
${
1
+x
}
"
]
&&
[
"
${
1
}
"
!=
"pull"
]
;
then
...
@@ -82,7 +85,7 @@ fi
...
@@ -82,7 +85,7 @@ fi
# Final stage, pull images for integration cache try special tag image first
# Final stage, pull images for integration cache try special tag image first
# if it fails download latest instead
# if it fails download latest instead
if
[
-z
"
${
1
+x
}
"
]
&&
[
"
${
1
}
"
==
"pull"
]
;
then
if
[
!
-z
"
${
1
+x
}
"
]
&&
[
"
${
1
}
"
==
"pull"
]
;
then
echo
"Pulling images for integration test cache"
echo
"Pulling images for integration test cache"
# The second argument must pass the tag variable must be set
# The second argument must pass the tag variable must be set
...
@@ -95,8 +98,12 @@ if [ -z "${1+x}" ] && [ "${1}" == "pull" ]; then
...
@@ -95,8 +98,12 @@ if [ -z "${1+x}" ] && [ "${1}" == "pull" ]; then
tag
=
"
${
2
}
"
tag
=
"
${
2
}
"
for
image
in
"
${
LOCAL_IMAGES
[@]
}
"
;
do
for
image
in
"
${
LOCAL_IMAGES
[@]
}
"
;
do
local_url
=
"
${
LOCAL_DOCKER_REGISTRY_HOST
}
/
${
LOCAL_DOCKER_REGISTRY_USER
}
/
${
image
}
"
docker pull
"
${
local_url
}
:
${
tag
}
"
||
docker pull
"
${
local_url
}
:latest"
docker pull
"
${
local_url
}
:
${
tag
}
"
||
docker pull
"
${
local_url
}
:latest"
done
done
exit
0
exit
0
fi
fi
# Someone nothing ran, that is an error do not fail silently
exit
1
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment