https://gitlab.com/fredbcode-images/squid/-/pipelines/1526651484
Squid 6.12 ChatGPT Analysis
Hadolint Job
Description:
- This job uses the Hadolint tool to analyze the Dockerfile for
potential issues.
- It runs the
hadolint command with the
--ignore DL3008 option.
hadolint:
image: hadolint/hadolint:latest-debian
stage: quality
before_script:
- cd $CI_PROJECT_DIR
script:
- hadolint --ignore DL3008 Dockerfile
Docker Hub Build (ARM) Job
Description:
- This job builds the Docker image for Squid on ARM architecture.
- It logs into Docker Hub, retrieves the Squid version, builds the
image, and pushes it to Docker Hub.
docker-hub-build-arm:
stage: Docker-hub-build
image: docker:19.03.8-dind
tags:
- arm
artifacts:
expire_in: 2 hours
paths:
- $CI_PROJECT_DIR
timeout: 3 hours
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/v6/ | egrep -m 1 -oh squid-.*.tar.gz | cut -d '"' -f1)
- docker build -f Dockerfile --build-arg SQUID_VERSION=$SQUID_VERSION --pull -t $CONTAINER_BUILD_NOPROD_NAME_ARM .
- docker push $CONTAINER_BUILD_NOPROD_NAME_ARM
Docker Hub Test (ARM) Job
Description:
- This job tests the Docker image for Squid on ARM architecture.
- It installs curl, sets up a proxy to squid, and tests a Google page
retrieval.
docker-hub-test-arm:
stage: Docker-hub-test
extends: .services-arm
tags:
- arm
artifacts:
script:
- apt update && apt install -y curl --no-upgrade --no-install-recommends --no-install-suggests
- export https_proxy=http://$CONTAINER_TEST_NAME:3128 && curl -k https://www.google.fr
variables:
HOSTNAME: squidpipeline
needs: ["docker-hub-build-arm"]
Dive Analysis (ARM) Job
Description:
- This job uses the Dive tool to analyze the Docker image for Squid on
ARM architecture.
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) Job
Description:
- This job tags and pushes the Docker image for Squid on ARM
architecture to Docker Hub.
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/v6/ | egrep -m 1 -oh squid-.*.tar.gz | cut -d '"' -f1 | sed 's/\.tar\.gz//g' | sed 's/squid-//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"]
only:
- master