golangci-lint images names fix and fix image hash obtaining.

This commit is contained in:
Stanislav Nikitin 2020-12-23 18:59:11 +05:00
parent f22c0bbef5
commit 04b5f251ee
Signed by: pztrn
GPG Key ID: 1E944A0F0568B550
2 changed files with 5 additions and 5 deletions

View File

@ -1 +1 @@
echo "golangci-lint:v1.13.2 golangci-lint:latest"
echo "golangci/golangci-lint:v1.13.2 golangci/golangci-lint:latest"

View File

@ -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.