-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 79df6b0
Showing
7 changed files
with
187 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[Makefile] | ||
indent_style = tab |
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,26 @@ | ||
name: Build docker image | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build-action: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 2 | ||
matrix: | ||
# Not all for time waste reasons | ||
platform: ["linux/arm64", "linux/amd64"] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
# https://github.com/docker/setup-qemu-action | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
# https://github.com/docker/setup-buildx-action | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Build action image | ||
run: PLATFORM="${{ matrix.platform }}" make docker-build | ||
env: | ||
DOCKER_BUILDKIT: 1 |
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,49 @@ | ||
name: Publish Docker image | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
push_to_registry: | ||
name: Push Docker image to Docker hub | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: Build Docker images | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 4 | ||
matrix: | ||
include: | ||
# All supported by base image | ||
- { platform: "linux/386", platform-tag: "386" } | ||
- { platform: "linux/amd64", platform-tag: "amd64" } | ||
- { platform: "linux/arm/v5", platform-tag: "armv5" } | ||
- { platform: "linux/arm/v7", platform-tag: "armv7" } | ||
- { platform: "linux/arm64/v8", platform-tag: "arm64v8" } | ||
- { platform: "linux/mips64le", platform-tag: "mips64le" } | ||
- { platform: "linux/ppc64le", platform-tag: "ppc64le" } | ||
- { platform: "linux/s390x", platform-tag: "s390x" } | ||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v3 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: docker.io | ||
username: ${{ secrets.DOCKER_REPOSITORY_LOGIN }} | ||
password: ${{ secrets.DOCKER_REPOSITORY_PASSWORD }} | ||
# https://github.com/docker/setup-qemu-action | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
# https://github.com/docker/setup-buildx-action | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Build and push image | ||
run: make docker-build | ||
env: | ||
DOCKER_BUILDKIT: 1 | ||
PLATFORM: "${{ matrix.platform }}" | ||
IMAGE_TAG: "docker.io/botsudo/phpmyadmin-snapshots:5.2-snapshot" | ||
ACTION: push |
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,22 @@ | ||
IMAGE_TAG ?= phpmyadmin-snapshots | ||
# All: linux/386,linux/amd64,linux/arm/v5,linux/arm/v7,linux/arm64/v8,linux/mips64le,linux/ppc64le,linux/s390x | ||
PLATFORM ?= linux/amd64 | ||
|
||
ACTION ?= load | ||
PROGRESS_MODE ?= plain | ||
|
||
.PHONY: docker-build docker-push | ||
|
||
docker-build: | ||
# https://github.com/docker/buildx#building | ||
docker buildx build \ | ||
--tag $(IMAGE_TAG) \ | ||
--progress $(PROGRESS_MODE) \ | ||
--platform $(PLATFORM) \ | ||
--build-arg VCS_REF=`git rev-parse HEAD` \ | ||
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ | ||
--$(ACTION) \ | ||
./docker | ||
|
||
docker-push: | ||
docker push $(IMAGE_TAG) |
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 @@ | ||
# phpMyAdmin Docker snapshots |
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,12 @@ | ||
|
||
ARG VERSION_MAJOR="5" | ||
FROM phpmyadmin:${VERSION_MAJOR} | ||
|
||
ENV VERSION_RANGE="5.2" | ||
ARG GIST_REVISION="db3da63fa3925478c5960b86b4c9c2ff5c15541d" | ||
ARG GIST_URL="https://gist.githubusercontent.com/williamdes/883f2158f17e9ed5a83d892ada56f5df/raw/${GIST_REVISION}/upgradephpmyadmin.sh" | ||
|
||
RUN curl -# -o ./upgradephpmyadmin.sh "${GIST_URL}" \ | ||
&& chmod +x ./upgradephpmyadmin.sh \ | ||
&& echo "Version-range: ${VERSION_RANGE}" \ | ||
&& ./upgradephpmyadmin.sh /var/www/ www-data www-data "${VERSION_RANGE}+snapshot" html |
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,66 @@ | ||
#!/bin/sh -ex | ||
|
||
if [ -z "$API_PASSWORD" ] | ||
then | ||
API_PASSWORD=$(dd if=/dev/urandom bs=18 count=1 2>/dev/null | base64) | ||
fi | ||
|
||
if [ -z "$ADMIN_PASSWORD" ] | ||
then | ||
ADMIN_PASSWORD=$(dd if=/dev/urandom bs=18 count=1 2>/dev/null | base64) | ||
fi | ||
|
||
# Can write or does not exist (support user defined mounted read-only configs) | ||
if [ -w /etc/nut/ups.conf ] || [ ! -e /etc/nut/ups.conf ]; then | ||
cat >/etc/nut/ups.conf <<EOF | ||
[$UPS_NAME] | ||
desc = "$UPS_DESC" | ||
driver = $UPS_DRIVER | ||
port = $UPS_PORT | ||
EOF | ||
else | ||
printf "Skipped ups.conf config" | ||
fi | ||
|
||
# Can write or does not exist (support user defined mounted read-only configs) | ||
if [ -w /etc/nut/upsd.conf ] || [ ! -e /etc/nut/upsd.conf ]; then | ||
cat >/etc/nut/upsd.conf <<EOF | ||
LISTEN ${API_ADDRESS:-0.0.0.0} ${API_PORT:-3493} | ||
EOF | ||
else | ||
printf "Skipped upsd.conf config" | ||
fi | ||
|
||
# Can write or does not exist (support user defined mounted read-only configs) | ||
if [ -w /etc/nut/upsd.users ] || [ ! -e /etc/nut/upsd.users ]; then | ||
cat >/etc/nut/upsd.users <<EOF | ||
[admin] | ||
password = $ADMIN_PASSWORD | ||
actions = set | ||
actions = fsd | ||
instcmds = all | ||
[monitor] | ||
password = $API_PASSWORD | ||
upsmon master | ||
EOF | ||
else | ||
printf "Skipped upsd.users config" | ||
fi | ||
|
||
# Can write or does not exist (support user defined mounted read-only configs) | ||
if [ -w /etc/nut/upsmon.conf ] || [ ! -e /etc/nut/upsmon.conf ]; then | ||
cat >/etc/nut/upsmon.conf <<EOF | ||
MONITOR $UPS_NAME@localhost 1 monitor $API_PASSWORD master | ||
SHUTDOWNCMD "$SHUTDOWN_CMD" | ||
EOF | ||
else | ||
printf "Skipped upsmon.conf config" | ||
fi | ||
|
||
chgrp -R nut /etc/nut /dev/bus/usb | ||
chmod -R o-rwx /etc/nut | ||
|
||
/usr/sbin/upsdrvctl start | ||
/usr/sbin/upsd | ||
exec /usr/sbin/upsmon -D |