HTTP_PROXY can now be defined with a variable

This commit is contained in:
Deon George 2023-06-30 23:00:29 +10:00
parent 4ac8e00528
commit f5e4c8e300
4 changed files with 8 additions and 8 deletions

View File

@ -21,8 +21,8 @@ services:
before_script: before_script:
- if [ ! -d build-cache ]; then mkdir build-cache; fi - if [ ! -d build-cache ]; then mkdir build-cache; fi
- sed -i -e s'/https/http/' /etc/apk/repositories - if [ -n "${HTTP_PROXY}" ]; then echo "HTTP PROXY [${HTTP_PROXY}]"; sed -i -e s'/https/http/' /etc/apk/repositories; fi
- HTTP_PROXY=http://proxy.dege.lan:3128 apk add git curl - apk add git curl
- docker info && docker version - docker info && docker version
# env|sort # env|sort
# docker login -u "$CI_DEPENDENCY_PROXY_USER" -p "$CI_DEPENDENCY_PROXY_PASSWORD" "$CI_SERVER_HOST" # docker login -u "$CI_DEPENDENCY_PROXY_USER" -p "$CI_DEPENDENCY_PROXY_PASSWORD" "$CI_SERVER_HOST"

View File

@ -6,7 +6,7 @@ arm64:build:
- if [ -f init ]; then chmod 500 init; fi - if [ -f init ]; then chmod 500 init; fi
- ([ -z "$REFRESH" -a -f build-cache/${CI_COMMIT_REF_SLUG} ]) && docker load < build-cache/${CI_COMMIT_REF_SLUG} || true - ([ -z "$REFRESH" -a -f build-cache/${CI_COMMIT_REF_SLUG} ]) && docker load < build-cache/${CI_COMMIT_REF_SLUG} || true
- rm build-cache/* || true - rm build-cache/* || true
- docker build --build-arg HTTP_PROXY=http://proxy.dege.lan:3128 --cache-from ${CI_REGISTRY_IMAGE}:${VERSIONARCH} -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH} . - docker build ${HTTP_PROXY:+--build-arg HTTP_PROXY=${HTTP_PROXY}} --cache-from ${CI_REGISTRY_IMAGE}:${VERSIONARCH} -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH} .
- docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH} - docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH}
- docker save ${CI_REGISTRY_IMAGE}:${VERSIONARCH} > build-cache/${CI_COMMIT_REF_SLUG} - docker save ${CI_REGISTRY_IMAGE}:${VERSIONARCH} > build-cache/${CI_COMMIT_REF_SLUG}
tags: tags:
@ -20,7 +20,7 @@ arm64:build:
# ARCH: arm64 # ARCH: arm64
# stage: build-test # stage: build-test
# script: # script:
# - docker build --build-arg HTTP_PROXY=http://proxy.dege.lan:3128 --file Dockerfile.phptest -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH}-test . # - docker build ${HTTP_PROXY:+--build-arg HTTP_PROXY=${HTTP_PROXY}} --file Dockerfile.phptest -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH}-test .
# - docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH}-test # - docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH}-test
# tags: # tags:
# - docker # - docker

View File

@ -6,7 +6,7 @@ armv7l:build:
- if [ -f init ]; then chmod 500 init; fi - if [ -f init ]; then chmod 500 init; fi
- ([ -z "$REFRESH" -a -f build-cache/${CI_COMMIT_REF_SLUG} ]) && docker load < build-cache/${CI_COMMIT_REF_SLUG} || true - ([ -z "$REFRESH" -a -f build-cache/${CI_COMMIT_REF_SLUG} ]) && docker load < build-cache/${CI_COMMIT_REF_SLUG} || true
- rm build-cache/* || true - rm build-cache/* || true
- docker build --build-arg HTTP_PROXY=http://proxy.dege.lan:3128 --cache-from ${CI_REGISTRY_IMAGE}:${VERSIONARCH} -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH} . - docker build ${HTTP_PROXY:+--build-arg HTTP_PROXY=${HTTP_PROXY}} --cache-from ${CI_REGISTRY_IMAGE}:${VERSIONARCH} -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH} .
- docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH} - docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH}
- docker save ${CI_REGISTRY_IMAGE}:${VERSIONARCH} > build-cache/${CI_COMMIT_REF_SLUG} - docker save ${CI_REGISTRY_IMAGE}:${VERSIONARCH} > build-cache/${CI_COMMIT_REF_SLUG}
tags: tags:
@ -20,7 +20,7 @@ armv7l:build-test:
ARCH: armv7l ARCH: armv7l
stage: build-test stage: build-test
script: script:
- docker build --build-arg HTTP_PROXY=http://proxy.dege.lan:3128 --file Dockerfile.phptest -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH}-test . - docker build ${HTTP_PROXY:+--build-arg HTTP_PROXY=${HTTP_PROXY}} --file Dockerfile.phptest -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH}-test .
- docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH}-test - docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH}-test
tags: tags:
- docker - docker

View File

@ -6,7 +6,7 @@ x86_64:build:
- if [ -f init ]; then chmod 500 init; fi - if [ -f init ]; then chmod 500 init; fi
- ([ -z "$REFRESH" -a -f build-cache/${CI_COMMIT_REF_SLUG} ]) && docker load < build-cache/${CI_COMMIT_REF_SLUG} || true - ([ -z "$REFRESH" -a -f build-cache/${CI_COMMIT_REF_SLUG} ]) && docker load < build-cache/${CI_COMMIT_REF_SLUG} || true
- rm build-cache/* || true - rm build-cache/* || true
- docker build --build-arg HTTP_PROXY=http://proxy.dege.lan:3128 --cache-from ${CI_REGISTRY_IMAGE}:${VERSIONARCH} -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH} . - docker build ${HTTP_PROXY:+--build-arg HTTP_PROXY=${HTTP_PROXY}} --cache-from ${CI_REGISTRY_IMAGE}:${VERSIONARCH} -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH} .
- docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH} - docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH}
- docker save ${CI_REGISTRY_IMAGE}:${VERSIONARCH} > build-cache/${CI_COMMIT_REF_SLUG} - docker save ${CI_REGISTRY_IMAGE}:${VERSIONARCH} > build-cache/${CI_COMMIT_REF_SLUG}
tags: tags:
@ -20,7 +20,7 @@ x86_64:build-test:
ARCH: x86_64 ARCH: x86_64
stage: build-test stage: build-test
script: script:
- docker build --build-arg HTTP_PROXY=http://proxy.dege.lan:3128 --file Dockerfile.phptest -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH}-test . - docker build ${HTTP_PROXY:+--build-arg HTTP_PROXY=${HTTP_PROXY}} --file Dockerfile.phptest -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH}-test .
- docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH}-test - docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH}-test
tags: tags:
- docker - docker