fredbcode-images-squid/gitlabci/docker-hub-arm.yml
2021-10-28 09:18:53 +02:00

74 lines
2.3 KiB
YAML

variables:
CONTAINER_CLIENT_IMAGE: debian:buster
CONTAINER_TEST_NAME: squid
CONTAINER_BUILD_NOPROD_NAME_ARM: $HUB_REGISTRY_IMAGE:build-noprod-arm
SQUID_VERSION: '"$SQUID_VERSION"'
docker-hub-build-arm:
stage: Docker-hub-build
image: docker:19.03.8-dind
tags:
- arm
artifacts:
expire_in: 2 days
timeout: 3 days
before_script:
- docker login -u "$DOCKER_HUB_USER" -p "$DOCKER_HUB_TOKEN" $DOCKER_HUB_REGISTRY
script:
- cd $CI_PROJECT_DIR
- apk add --no-cache curl
- export SQUID_VERSION=$(curl -s http://www.squid-cache.org/Versions/v5/ | egrep -m 1 -oh squid-.*.tar.gz | cut -d '"' -f1)
- docker build -f Dockerfile.arm --build-arg SQUID_VERSION=$SQUID_VERSION --pull -t $CONTAINER_BUILD_NOPROD_NAME_ARM .
- docker push $CONTAINER_BUILD_NOPROD_NAME_ARM
.services-arm:
services:
- name: $CONTAINER_BUILD_NOPROD_NAME_ARM
alias: squid
image: $CONTAINER_CLIENT_IMAGE
docker-hub-test-arm:
stage: Docker-hub-test
extends: .services-arm
tags:
- arm
artifacts:
script:
- apt update && apt install -y curl
- export https_proxy=http://$CONTAINER_TEST_NAME:3128 && curl -k https://www.google.fr
variables:
HOSTNAME: squidpipeline
needs: ["docker-hub-build-arm"]
dive-arm:
image:
name: wagoodman/dive:latest
entrypoint: [""]
dependencies: []
stage: Docker-hub-test
script:
- docker pull $CONTAINER_BUILD_NOPROD_NAME_ARM
- dive $CONTAINER_BUILD_NOPROD_NAME_ARM
variables:
CI: "true"
push-docker-hub-arm:
stage: Docker-hub-pushtag
image: docker:19.03.8-dind
tags:
- arm
artifacts:
before_script:
- docker login -u "$DOCKER_HUB_USER" -p "$DOCKER_HUB_TOKEN" $DOCKER_HUB_REGISTRY
script:
- apk add --no-cache curl
- docker pull $CONTAINER_BUILD_NOPROD_NAME_ARM
- export SQUID_VERSION=$(curl -s http://www.squid-cache.org/Versions/v5/ | egrep -m 1 -oh squid-.*.tar.gz | cut -d '"' -f1 | sed 's/\.tar\.gz//g')
- docker tag $CONTAINER_BUILD_NOPROD_NAME_ARM $HUB_REGISTRY_IMAGE:$SQUID_VERSION-arm
- docker push $HUB_REGISTRY_IMAGE:$SQUID_VERSION-arm
- docker tag $CONTAINER_BUILD_NOPROD_NAME_ARM $HUB_REGISTRY_IMAGE:latest-arm
- docker push $HUB_REGISTRY_IMAGE:latest-arm
variables:
GIT_STRATEGY: none
needs: ["docker-hub-test-arm"]