diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 7ef1f32..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,98 +0,0 @@ -version: 2 - -.job_template: &job_template - machine: - enabled: true - steps: - - checkout - - run: - command: ./circle-test.sh - - persist_to_workspace: - root: . - paths: [ 'ci-workspace' ] - -jobs: - amd64: - <<: *job_template - arm64: - <<: *job_template - armhf: - <<: *job_template - armel: - <<: *job_template - deploy: - docker: - - image: circleci/python:latest - steps: - - setup_remote_docker: - version: 18.06.0-ce - - checkout - - attach_workspace: - at: . - - run: - command: ./circle-deploy.sh - - - -workflows: - version: 2 - build: - jobs: - - amd64: - filters: - tags: - only: /^v.*/ - - arm64: - filters: - tags: - only: /^v.*/ - - armhf: - filters: - tags: - only: /^v.*/ - #- armel: - # filters: - # tags: - # only: /^v.*/ - - deploy: - requires: - - amd64 - - arm64 - - armhf - #- armel - filters: - tags: - only: /^v.*/ - nightly_build: - triggers: - - schedule: - cron: "0 0 * * *" - filters: - branches: - only: 'beta-v5.0' - jobs: - - amd64: - filters: - tags: - only: /^v.*/ - - arm64: - filters: - tags: - only: /^v.*/ - - armhf: - filters: - tags: - only: /^v.*/ - #- armel: - # filters: - # tags: - # only: /^v.*/ - - deploy: - requires: - - amd64 - - arm64 - - armhf - #- armel - filters: - tags: - only: /^v.*/ diff --git a/circle-deploy.sh b/circle-deploy.sh deleted file mode 100755 index 884383a..0000000 --- a/circle-deploy.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env bash -set -ex -# Circle CI Job for merging/deploying all architectures (post-test passing) -. circle-vars.sh - -annotate() { - local base=$1 - local image=$2 - local arch=$3 - local annotate_flags="${annotate_map[$arch]}" - - $dry docker manifest annotate ${base} ${image} --os linux ${annotate_flags} -} - -# Keep in sync with circle-ci job names -declare -A annotate_map=( - ["amd64"]="--arch amd64" - ["armel"]="--arch arm --variant v6" - ["armhf"]="--arch arm --variant v7" - ["arm64"]="--arch arm64 --variant v8" -) - -# push image when not running a PR -mkdir -p ~/.docker -export DOCKER_CLI_EXPERIMENTAL='enabled' -echo "{}" | jq '.experimental="enabled"' | tee ~/.docker/config.json -docker info -if [[ "$CIRCLE_PR_NUMBER" == "" ]]; then - images=() - echo $DOCKERHUB_PASS | docker login --username=$DOCKERHUB_USER --password-stdin - ls -lat ./ci-workspace/ - cd ci-workspace - - for arch in *; do - arch_image=$(cat $arch) - docker pull $arch_image - images+=($arch_image) - done - - for docker_tag in $MULTIARCH_IMAGE $LATEST_IMAGE; do - docker manifest create $docker_tag ${images[*]} - for arch in *; do - arch_image=$(cat $arch) - docker pull $arch_image - annotate "$docker_tag" "$arch_image" "$arch" - done - - docker manifest inspect "$docker_tag" - docker manifest push --purge "$docker_tag" - done; -fi diff --git a/circle-test.sh b/circle-test.sh deleted file mode 100755 index 8b61499..0000000 --- a/circle-test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -set -ex - -# Circle CI Job for single architecture - -# setup qemu/variables -docker run --rm --privileged multiarch/qemu-user-static:register --reset > /dev/null -. circle-vars.sh - -if [[ "$1" == "enter" ]]; then - enter="-it --entrypoint=sh" -fi - -# generate and build dockerfile -docker pull python:buster -docker build -t image_pipenv -f Dockerfile_build . -env > /tmp/env -docker run --rm \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -v "$(pwd):/$(pwd)" \ - -w "$(pwd)" \ - -e PIPENV_CACHE_DIR="$(pwd)/.pipenv" \ - --env-file /tmp/env \ - $enter image_pipenv - -test -z "${CIRCLE_PROJECT_REPONAME}" && exit 0 -# The rest is circle-ci only -echo $DOCKERHUB_PASS | docker login --username=$DOCKERHUB_USER --password-stdin -docker push $ARCH_IMAGE -mkdir -p ci-workspace -echo "$ARCH_IMAGE" | tee ./ci-workspace/$ARCH diff --git a/circle-vars.sh b/circle-vars.sh deleted file mode 100755 index fbe4db1..0000000 --- a/circle-vars.sh +++ /dev/null @@ -1,48 +0,0 @@ -set -a - -CIRCLE_JOB="${CIRCLE_JOB:-}" -ARCH="${ARCH:-$CIRCLE_JOB}" -if [[ -z "$ARCH" ]] ; then - echo "Defaulting arch to amd64" - ARCH="amd64" -fi -BASE_IMAGE="${BASE_IMAGE:-${CIRCLE_PROJECT_REPONAME}}" -if [[ -z "$BASE_IMAGE" ]] ; then - echo "Defaulting image name to pihole" - BASE_IMAGE="pihole" -fi - -# The docker image will match the github repo path by default but is overrideable with CircleCI environment -# BASE_IMAGE Overridable by Circle environment, including namespace (e.g. BASE_IMAGE=bobsmith/test-img:latest) -CIRCLE_PROJECT_USERNAME="${CIRCLE_PROJECT_USERNAME:-unset}" -HUB_NAMESPACE="${HUB_NAMESPACE:-$CIRCLE_PROJECT_USERNAME}" -[[ $CIRCLE_PROJECT_USERNAME == "pi-hole" ]] && HUB_NAMESPACE="pihole" # Custom mapping for namespace -[[ $BASE_IMAGE != *"/"* ]] && BASE_IMAGE="${HUB_NAMESPACE}/${BASE_IMAGE}" # If missing namespace, add one - -# Secondary docker tag info (origin github branch/tag) will get prepended also -ARCH_IMAGE="$BASE_IMAGE" -[[ $ARCH_IMAGE != *":"* ]] && ARCH_IMAGE="${BASE_IMAGE}:$ARCH" # If tag missing, add circle job name as a tag (architecture here) - -DOCKER_TAG="${CIRCLE_TAG:-$CIRCLE_BRANCH}" -if [[ -n "$DOCKER_TAG" ]]; then - # remove latest tag if used (as part of a user provided image variable) - ARCH_IMAGE="${ARCH_IMAGE/:latest/:}" - # Prepend the github tag(version) or branch. image:arch = image:v1.0-arch - ARCH_IMAGE="${ARCH_IMAGE/:/:${DOCKER_TAG}-}" - # latest- sometimes has a trailing slash, remove it - ARCH_IMAGE="${ARCH_IMAGE/%-/}" -fi - -# To get latest released, cut a release on https://github.com/pi-hole/docker-pi-hole/releases (manually gated for quality control) -latest_tag='' -if ! latest_tag=$(curl -sI https://github.com/pi-hole/docker-pi-hole/releases/latest | grep --color=never -i Location | awk -F / '{print $NF}' | tr -d '[:cntrl:]'); then - print "Failed to retrieve latest docker-pi-hole release metadata" -else - if [[ "$DOCKER_TAG" == "$latest_tag" ]] ; then - LATEST_IMAGE="$BASE_IMAGE:latest" - fi -fi - -MULTIARCH_IMAGE="$BASE_IMAGE:$DOCKER_TAG" - -set +a