Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ubi7
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
linuxsupport
ubi7
Merge requests
!1
Initial version
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Initial version
dev
into
master
Overview
0
Commits
5
Pipelines
1
Changes
1
Merged
Alex Iribarren
requested to merge
dev
into
master
3 years ago
Overview
0
Commits
5
Pipelines
1
Changes
1
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
a97cef79
5 commits,
3 years ago
1 file
+
40
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
.gitlab-ci.yml
0 → 100644
+
40
−
0
Options
---
variables
:
IMAGE_NAMES
:
'
ubi
ubi-minimal
ubi-init'
REMOTE_REGISTRY
:
'
registry.access.redhat.com'
stages
:
-
mirror
mirror
:
stage
:
mirror
image
:
# Use the 'debug' image as it provides a shell which is needed for GitLab CI
name
:
gcr.io/go-containerregistry/crane:debug
entrypoint
:
[
"
"
]
variables
:
# No need to clone the repo
GIT_STRATEGY
:
none
script
:
-
crane auth login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
-
|
for IMAGE in ${IMAGE_NAMES}; do
echo -e "\e[1m\e[32m Listing tags for: ${REMOTE_REGISTRY}/${CI_PROJECT_NAME}/${IMAGE} \e[0m"
TAGS=$(crane ls ${REMOTE_REGISTRY}/${CI_PROJECT_NAME}/${IMAGE})
NUM_TAGS=$(echo "${TAGS}" | wc -l)
echo -e "\e[32m -> ${NUM_TAGS} tags found.\e[0m"
for TAG in $TAGS; do
SRC_DIGEST=$(crane manifest ${REMOTE_REGISTRY}/${CI_PROJECT_NAME}/${IMAGE}:${TAG} | grep digest)
set +e
DST_DIGEST=$(crane manifest ${CI_REGISTRY_IMAGE}/${IMAGE}:${TAG} 2>/dev/null | grep digest)
set -e
if [[ "$SRC_DIGEST" != "$DST_DIGEST" ]]; then
echo -e "\e[1m\e[32m Copying ${REMOTE_REGISTRY}/${CI_PROJECT_NAME}/${IMAGE}:${TAG} to ${CI_REGISTRY_IMAGE}/${IMAGE}:${TAG} \e[0m"
crane copy ${REMOTE_REGISTRY}/${CI_PROJECT_NAME}/${IMAGE}:${TAG} ${CI_REGISTRY_IMAGE}/${IMAGE}:${TAG}
fi
done
echo -e "\e[1m\e[32m Done with ${REMOTE_REGISTRY}/${CI_PROJECT_NAME}/${IMAGE} \e[0m"
done
\ No newline at end of file
Loading