Skip to content
GitLab
Explore
Sign in
Register
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
0a19b5d0
Commit
0a19b5d0
authored
3 years ago
by
Thomas Juerges
Browse files
Options
Downloads
Plain Diff
Merge branch '
L2SS-232
-Docker_tag_and_push_script' into 'master'
L2SS-232
: Add a Docker tag/push script for local images Closes
L2SS-232
See merge request
!49
parents
f1cde1ea
fccd0901
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!49
L2SS-232: Add a Docker tag/push script for local images
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sbin/tag_and_push_docker_image.sh
+40
-0
40 additions, 0 deletions
sbin/tag_and_push_docker_image.sh
with
40 additions
and
0 deletions
sbin/tag_and_push_docker_image.sh
0 → 100755
+
40
−
0
View file @
0a19b5d0
#! /usr/bin/env bash -e
# Tag and push which image version?
DOCKER_TAG
=
latest
# Change to git tag or git hash if no tag
VERSION
=
$(
date
+
"%Y-%M-%d"
)
SKA_REPO
=
"nexus.engageska-portugal.pt/ska-docker"
LOFAR_REPO
=
"git.astron.nl:5000/lofar2.0/tango"
# Compile a list of the SKA images
SKA_IMAGES
=
$(
for
i
in
$(
docker images | egrep
${
DOCKER_TAG
}
| egrep
${
SKA_REPO
}
|
cut
-d
' '
-f1
)
;
do
printf
"%s "
${
i
}
;
done
)
# Compile a list of LOFAR2.0 images
LOFAR_IMAGES
=
$(
for
i
in
$(
docker images | egrep
${
DOCKER_TAG
}
| egrep
-v
"
${
SKA_REPO
}
|
${
LOFAR_REPO
}
"
|
cut
-d
' '
-f1
)
;
do
printf
"%s "
${
i
}
;
done
)
function
tag_and_push
()
{
(
docker tag
${
1
}
${
2
}
docker push
${
2
}
)
&
}
# Rename the SKA images for the LOFAR2.0 repo
# and push them to the LOFAR2.0 repo
for
IMAGE
in
${
SKA_IMAGES
}
;
do
PUSH_IMAGE
=
${
IMAGE
//
${
SKA_REPO
}
/
${
LOFAR_REPO
}}
:
${
VERSION
}
tag_and_push
${
IMAGE
}
${
PUSH_IMAGE
}
done
# Rename the LOFAR2.0 images for the LOFAR2.0 repo
# and push them to the LOFAR2.0 repo
for
IMAGE
in
${
LOFAR_IMAGES
}
;
do
PUSH_IMAGES
=
${
LOFAR_REPO
}
/
${
IMAGE
}
:
${
VERSIN
}
tag_and_push
${
IMAGE
}
${
PUSH_IMAGE
}
done
wait
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