-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into master
Signed-off-by: Adam Warner <[email protected]>
- Loading branch information
Showing
71 changed files
with
815 additions
and
2,412 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Login to container registries | ||
description: Login to container registries Docker Hub and GitHub Container Registry | ||
|
||
inputs: | ||
# Actions cannot access secrets so pass them in as inputs | ||
docker_username: | ||
required: true | ||
description: The username to use to login to Docker Hub | ||
docker_password: | ||
required: true | ||
description: The password to use to login to Docker Hub | ||
ghcr_username: | ||
required: true | ||
description: The username to use to login to GitHub Container Registry | ||
ghcr_password: | ||
required: true | ||
description: The password to use to login to GitHub Container Registry | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: docker.io | ||
username: ${{ inputs.docker_username }} | ||
password: ${{ inputs.docker_password }} | ||
- | ||
name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ inputs.ghcr_username }} | ||
password: ${{ inputs.ghcr_password }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Build Image and Test | ||
on: | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# Official docker images for docker are only available for amd64 and arm64 | ||
# TODO: Look at: https://github.com/docker-library/official-images#architectures-other-than-amd64 | ||
# Is testing on all platforms really necessary? | ||
# Disabled arm64 tests for the time being, something is wrong with the test config and the volumes are getting shared between the test containers on different architectures | ||
#platform: [linux/amd64, linux/arm64] | ||
platform: [linux/amd64] | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: ${{ matrix.platform }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Run Tests | ||
run: | | ||
echo "Building image to test" | ||
PLATFORM=${{ matrix.platform }} ./build-and-test.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,6 @@ var-log/ | |
|
||
# WIP/test stuff | ||
doco.yml | ||
|
||
# Ignore FTL Binary if it exists | ||
src/pihole-FTL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"github-actions.workflows.pinned.workflows": [ | ||
".github/workflows/v6-alpine-play.yml" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
#!/bin/bash | ||
|
||
# Usage function | ||
usage() { | ||
echo "Usage: $0 [-l] [-f <ftl_branch>] [-c <core_branch>] [-w <web_branch>] [-t <tag>] [use_cache]" | ||
echo "Options:" | ||
echo " -f, --ftlbranch <branch> Specify FTL branch (cannot be used in conjunction with -l)" | ||
echo " -c, --corebranch <branch> Specify Core branch" | ||
echo " -w, --webbranch <branch> Specify Web branch" | ||
echo " -p, --paddbranch <branch> Specify PADD branch" | ||
echo " -t, --tag <tag> Specify Docker image tag (default: pihole:local)" | ||
echo " -l, --local Use locally built FTL binary (requires src/pihole-FTL file)" | ||
echo " use_cache Enable caching (by default --no-cache is used)" | ||
echo "" | ||
echo "If no options are specified, the following command will be executed:" | ||
echo " docker buildx build src/. --tag pihole:local --load --no-cache" | ||
exit 1 | ||
} | ||
|
||
# Set default values | ||
DOCKER_BUILD_CMD="docker buildx build src/. --tag pihole:local --load --no-cache" | ||
FTL_FLAG=false | ||
|
||
# Parse command line arguments | ||
while [[ $# -gt 0 ]]; do | ||
key="$1" | ||
|
||
case $key in | ||
-l | --local) | ||
if [ ! -f "src/pihole-FTL" ]; then | ||
echo "File 'src/pihole-FTL' not found. Exiting." | ||
exit 1 | ||
fi | ||
if [ "$FTL_FLAG" = true ]; then | ||
echo "Error: Both -l and -f cannot be used together." | ||
usage | ||
fi | ||
FTL_FLAG=true | ||
DOCKER_BUILD_CMD+=" --build-arg FTL_SOURCE=local" | ||
shift | ||
;; | ||
-f | --ftlbranch) | ||
if [ "$FTL_FLAG" = true ]; then | ||
echo "Error: Both -l and -f cannot be used together." | ||
usage | ||
fi | ||
FTL_FLAG=true | ||
FTL_BRANCH="$2" | ||
DOCKER_BUILD_CMD+=" --build-arg FTL_BRANCH=$FTL_BRANCH" | ||
shift | ||
shift | ||
;; | ||
-c | --corebranch) | ||
CORE_BRANCH="$2" | ||
DOCKER_BUILD_CMD+=" --build-arg CORE_BRANCH=$CORE_BRANCH" | ||
shift | ||
shift | ||
;; | ||
-w | --webbranch) | ||
WEB_BRANCH="$2" | ||
DOCKER_BUILD_CMD+=" --build-arg WEB_BRANCH=$WEB_BRANCH" | ||
shift | ||
shift | ||
;; | ||
-p | --paddbranch) | ||
PADD_BRANCH="$2" | ||
DOCKER_BUILD_CMD+=" --build-arg PADD_BRANCH=$PADD_BRANCH" | ||
shift | ||
shift | ||
;; | ||
-t | --tag) | ||
TAG="$2" | ||
DOCKER_BUILD_CMD=${DOCKER_BUILD_CMD/pihole:local/$TAG} | ||
shift | ||
shift | ||
;; | ||
use_cache) | ||
DOCKER_BUILD_CMD=${DOCKER_BUILD_CMD/--no-cache/} | ||
shift | ||
;; | ||
*) | ||
echo "Unknown option: $1" | ||
usage | ||
;; | ||
esac | ||
done | ||
|
||
# Execute the docker build command | ||
echo "Executing command: $DOCKER_BUILD_CMD" | ||
eval $DOCKER_BUILD_CMD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.