Skip to content

Commit

Permalink
Revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
origamiofficial committed Dec 12, 2024
1 parent 4fda00e commit 30dd63c
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-push-dev-v6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ jobs:
BASE_IMAGE_DIGEST=$(curl -s https://registry.hub.docker.com/v2/repositories/pihole/pihole/tags/development | grep -oP '"digest":"\K[^"]+' | tail -1)
echo "New Base Digest: $BASE_IMAGE_DIGEST"
echo $BASE_IMAGE_DIGEST > ./digest/digest_base_development
curl -O --silent https://nlnetlabs.nl/downloads/unbound/unbound-${{ steps.unbound_version_code_check.outputs.VERSION_CODE }}.tar.gz -o unbound-latest.tar.gz
curl -O --silent https://nlnetlabs.nl/downloads/unbound/unbound-latest.tar.gz
LATEST_UNBOUND_DIGEST=$(sha256sum unbound-latest.tar.gz | cut -d ' ' -f 1)
echo "New Unbound Digest: $LATEST_UNBOUND_DIGEST"
echo $LATEST_UNBOUND_DIGEST > ./digest/digest_unbound_development
Expand Down
52 changes: 25 additions & 27 deletions .github/workflows/build-and-push-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,29 +79,6 @@ jobs:
uses: actions/checkout@v4
with:
ref: main
-
name: Pi-hole version code
id: pihole_version_code_check
run: |
CHECK_VERSION_CODE=$(curl -s https://registry.hub.docker.com/v2/repositories/pihole/pihole/tags/dev | grep -oP '"tag_last_pushed":"\K[^"]+' | tail -1 | cut -c 1-9 | sed 's/-/./g')
echo "New Version: $CHECK_VERSION_CODE"
echo VERSION_CODE=$CHECK_VERSION_CODE >> $GITHUB_OUTPUT
-
name: Unbound version code
id: unbound_version_code_check
run: |
function validate_version() {
local version="$1"
if [[ ! "$version" =~ ^[0-9]{1}\.[0-9]{2}\.[0-9]{1}$ ]]; then
echo "Error invalid version format: $version"
exit 1
fi
}
CHECK_VERSION_CODE=$(curl -s https://api.github.com/repos/NLnetLabs/unbound/releases/latest | grep '"name"' | awk -F'"' '{print $4}' | cut -d' ' -f 2)
echo "Unbound Version: $CHECK_VERSION_CODE"
validate_version "$CHECK_VERSION_CODE"
echo VERSION_CODE=$CHECK_VERSION_CODE >> $GITHUB_OUTPUT
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand Down Expand Up @@ -131,16 +108,37 @@ jobs:
with:
context: ./
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/arm/v6
build-args: |
BASE_IMG_TAG=dev
UNBOUND_VERSION_CODE=${{ steps.unbound_version_code_check.outputs.VERSION_CODE }}
build-args: BASE_IMG_TAG=dev
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: |
type=registry,ref=${{ secrets.DOCKERHUB_NAMESPACE }}/docker-cache:buildcache.pihole-unbound.dev
cache-to: |
type=registry,ref=${{ secrets.DOCKERHUB_NAMESPACE }}/docker-cache:buildcache.pihole-unbound.dev,mode=max
-
name: Pi-hole version code
id: pihole_version_code_check
run: |
CHECK_VERSION_CODE=$(curl -s https://registry.hub.docker.com/v2/repositories/pihole/pihole/tags/dev | grep -oP '"tag_last_pushed":"\K[^"]+' | tail -1 | cut -c 1-9 | sed 's/-/./g')
echo "New Version: $CHECK_VERSION_CODE"
echo VERSION_CODE=$CHECK_VERSION_CODE >> $GITHUB_OUTPUT
-
name: Unbound version code
id: unbound_version_code_check
run: |
function validate_version() {
local version="$1"
if [[ ! "$version" =~ ^[0-9]{1}\.[0-9]{2}\.[0-9]{1}$ ]]; then
echo "Error invalid version format: $version"
exit 1
fi
}
CHECK_VERSION_CODE=$(curl -s https://api.github.com/repos/NLnetLabs/unbound/releases/latest | grep '"name"' | awk -F'"' '{print $4}' | cut -d' ' -f 2)
echo "Unbound Version: $CHECK_VERSION_CODE"
validate_version "$CHECK_VERSION_CODE"
echo VERSION_CODE=$CHECK_VERSION_CODE >> $GITHUB_OUTPUT
-
name: Create release
uses: svenstaro/upload-release-action@v2
Expand All @@ -167,7 +165,7 @@ jobs:
BASE_IMAGE_DIGEST=$(curl -s https://registry.hub.docker.com/v2/repositories/pihole/pihole/tags/dev | grep -oP '"digest":"\K[^"]+' | tail -1)
echo "New Base Digest: $BASE_IMAGE_DIGEST"
echo $BASE_IMAGE_DIGEST > ./digest/digest_base_dev
curl -O --silent https://nlnetlabs.nl/downloads/unbound/unbound-${{ steps.unbound_version_code_check.outputs.VERSION_CODE }}.tar.gz -o unbound-latest.tar.gz
curl -O --silent https://nlnetlabs.nl/downloads/unbound/unbound-latest.tar.gz
LATEST_UNBOUND_DIGEST=$(sha256sum unbound-latest.tar.gz | cut -d ' ' -f 1)
echo "New Unbound Digest: $LATEST_UNBOUND_DIGEST"
echo $LATEST_UNBOUND_DIGEST > ./digest/digest_unbound_dev
Expand Down
26 changes: 7 additions & 19 deletions .github/workflows/build-and-push-dispatch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,7 @@ jobs:
with:
context: ./
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/arm/v6
build-args: |
UNBOUND_VERSION_CODE=${{ steps.unbound_version_code_check.outputs.VERSION_CODE }}
BASE_IMG_TAG=${{ inputs.BuildImageTag }}
build-args: BASE_IMG_TAG=${{ inputs.BuildImageTag }}
push: true
tags: ${{ steps.meta_latest.outputs.tags }}
labels: ${{ steps.meta_latest.outputs.labels }}
Expand All @@ -171,9 +169,7 @@ jobs:
with:
context: ./
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/arm/v6
build-args: |
UNBOUND_VERSION_CODE=${{ steps.unbound_version_code_check.outputs.VERSION_CODE }}
BASE_IMG_TAG=${{ inputs.BuildImageTag }}
build-args: BASE_IMG_TAG=${{ inputs.BuildImageTag }}
push: true
tags: ${{ steps.meta_latest.outputs.tags }}
labels: ${{ steps.meta_latest.outputs.labels }}
Expand All @@ -189,9 +185,7 @@ jobs:
context: ./
file: ./Dockerfile-Dev-V6
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/arm/v6
build-args: |
UNBOUND_VERSION_CODE=${{ steps.unbound_version_code_check.outputs.VERSION_CODE }}
BASE_IMG_TAG=${{ inputs.BuildImageTag }}
build-args: BASE_IMG_TAG=${{ inputs.BuildImageTag }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand All @@ -209,9 +203,7 @@ jobs:
context: ./
file: ./Dockerfile-Dev-V6
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/arm/v6
build-args: |
UNBOUND_VERSION_CODE=${{ steps.unbound_version_code_check.outputs.VERSION_CODE }}
BASE_IMG_TAG=${{ inputs.BuildImageTag }}
build-args: BASE_IMG_TAG=${{ inputs.BuildImageTag }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand All @@ -226,9 +218,7 @@ jobs:
with:
context: ./
platforms: ${{ inputs.BuildPlatform }}
build-args: |
UNBOUND_VERSION_CODE=${{ steps.unbound_version_code_check.outputs.VERSION_CODE }}
BASE_IMG_TAG=${{ inputs.BuildImageTag }}
build-args: BASE_IMG_TAG=${{ inputs.BuildImageTag }}
push: false
tags: ${{ steps.meta_platform.outputs.tags }}
labels: ${{ steps.meta_platform.outputs.labels }}
Expand All @@ -246,9 +236,7 @@ jobs:
context: ./
file: ./Dockerfile-Dev-V6
platforms: ${{ inputs.BuildPlatform }}
build-args: |
UNBOUND_VERSION_CODE=${{ steps.unbound_version_code_check.outputs.VERSION_CODE }}
BASE_IMG_TAG=${{ inputs.BaseImageTag }}
build-args: BASE_IMG_TAG=${{ inputs.BaseImageTag }}
push: false
tags: ${{ steps.meta_platform.outputs.tags }}
labels: ${{ steps.meta_platform.outputs.labels }}
Expand Down Expand Up @@ -311,7 +299,7 @@ jobs:
BASE_IMAGE_DIGEST=$(curl -s https://registry.hub.docker.com/v2/repositories/pihole/pihole/tags/${{ inputs.BuildImageTag }} | grep -oP '"digest":"\K[^"]+' | tail -1)
echo "New Base Digest: $BASE_IMAGE_DIGEST"
echo $BASE_IMAGE_DIGEST > ./digest/digest_base_${{ inputs.BuildImageTag }}
curl -O --silent https://nlnetlabs.nl/downloads/unbound/unbound-${{ steps.unbound_version_code_check.outputs.VERSION_CODE }}.tar.gz -o unbound-latest.tar.gz
curl -O --silent https://nlnetlabs.nl/downloads/unbound/unbound-latest.tar.gz
LATEST_UNBOUND_DIGEST=$(sha256sum unbound-latest.tar.gz | cut -d ' ' -f 1)
echo "New Unbound Digest: $LATEST_UNBOUND_DIGEST"
echo $LATEST_UNBOUND_DIGEST > ./digest/digest_unbound
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/build-and-push-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,7 @@ jobs:
with:
context: ./
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/arm/v6
build-args: |
BASE_IMG_TAG=latest
UNBOUND_VERSION_CODE=${{ steps.unbound_version_code_check.outputs.VERSION_CODE }}
build-args: BASE_IMG_TAG=latest
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down Expand Up @@ -190,7 +188,7 @@ jobs:
BASE_IMAGE_DIGEST=$(curl -s https://registry.hub.docker.com/v2/repositories/pihole/pihole/tags/latest | grep -oP '"digest":"\K[^"]+' | tail -1)
echo "New Base Digest: $BASE_IMAGE_DIGEST"
echo $BASE_IMAGE_DIGEST > ./digest/digest_base_latest
curl -O --silent https://nlnetlabs.nl/downloads/unbound/unbound-${{ steps.unbound_version_code_check.outputs.VERSION_CODE }}.tar.gz -o unbound-latest.tar.gz
curl -O --silent https://nlnetlabs.nl/downloads/unbound/unbound-latest.tar.gz
LATEST_UNBOUND_DIGEST=$(sha256sum unbound-latest.tar.gz | cut -d ' ' -f 1)
echo "New Unbound Digest: $LATEST_UNBOUND_DIGEST"
echo $LATEST_UNBOUND_DIGEST > ./digest/digest_unbound_latest
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Define ARG
# Define an ARG for the base image tag
ARG BASE_IMG_TAG=none

FROM pihole/pihole:${BASE_IMG_TAG} as openssl

Check warning on line 4 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build and publish

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
Expand Down Expand Up @@ -37,8 +37,8 @@ FROM pihole/pihole:${BASE_IMG_TAG} as unbound
ARG UNBOUND_VERSION_CODE=none

ENV NAME=unbound \
UNBOUND_VERSION=${UNBOUND_VERSION_CODE} \
UNBOUND_DOWNLOAD_URL=https://nlnetlabs.nl/downloads/unbound/unbound-${UNBOUND_VERSION}.tar.gz
UNBOUND_VERSION=latest \
UNBOUND_DOWNLOAD_URL=https://nlnetlabs.nl/downloads/unbound/unbound-latest.tar.gz

WORKDIR /tmp/src

Expand Down

0 comments on commit 30dd63c

Please sign in to comment.