golangci-lint images names fix and fix image hash obtaining.
This commit is contained in:
parent
f22c0bbef5
commit
04b5f251ee
@ -1 +1 @@
|
||||
echo "golangci-lint:v1.13.2 golangci-lint:latest"
|
||||
echo "golangci/golangci-lint:v1.13.2 golangci/golangci-lint:latest"
|
||||
|
@ -1,17 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# The Docker Image Mirror script.
|
||||
# Designed to be used in Gitlab CI.
|
||||
|
||||
WHAT_TO_MIRROR=()
|
||||
REGISTRY_TO_MIRROR=registry.gitlab.pztrn.name/containers/mirror
|
||||
|
||||
for file in $(ls ./images/*.sh); do
|
||||
echo "Importing ${file}..."
|
||||
WHAT_TO_MIRROR=( ${WHAT_TO_MIRROR} $(bash ${file}) )
|
||||
WHAT_TO_MIRROR=( ${WHAT_TO_MIRROR[@]} $(bash ${file}) )
|
||||
done
|
||||
|
||||
echo ${WHAT_TO_MIRROR[@]}
|
||||
echo "Images to mirror: ${WHAT_TO_MIRROR[@]}"
|
||||
|
||||
function mirror() {
|
||||
image=$1
|
||||
@ -25,7 +24,7 @@ function mirror() {
|
||||
exit
|
||||
fi
|
||||
|
||||
image_hash=$(docker images -a | grep "${image_name}" | grep "${image_version}" | awk {' print $3 '})
|
||||
image_hash=$(docker images -a | grep "^${image_name}" | grep "${image_version}" | awk {' print $3 '})
|
||||
echo -n "${image_hash} received... "
|
||||
|
||||
docker tag "${image_hash}" "${REGISTRY_TO_MIRROR}/${image}" &> /dev/null
|
||||
@ -44,6 +43,7 @@ function mirror() {
|
||||
echo "OK"
|
||||
|
||||
docker image rm "${image}" &> /dev/null
|
||||
docker image rm "${REGISTRY_TO_MIRROR}/${image}" &> /dev/null
|
||||
}
|
||||
|
||||
# Mirror images.
|
||||
|
Loading…
Reference in New Issue
Block a user