Compare commits

..

5 Commits

Author SHA1 Message Date
Julius Härtl ff857cf90a fixup! fixup! try: build arch in matrix 2023-12-01 19:49:36 +01:00
Julius Härtl 8ce6435aae fixup! try: build arch in matrix 2023-12-01 19:40:49 +01:00
Julius Härtl a888fdd7a6 tmp: only build one image
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-12-01 19:31:14 +01:00
Julius Härtl d52d7bf11c try: build arch in matrix
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-12-01 19:30:29 +01:00
Julius Härtl c982161ef8 fix: Stick to previous xdebug version
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-12-01 18:46:00 +01:00
4 changed files with 66 additions and 83 deletions
+64 -40
View File
@@ -7,44 +7,32 @@ on:
push:
branches:
- master
release:
types: [published]
jobs:
push_to_registry:
build:
name: Build image
runs-on: ubuntu-latest
if: github.repository == 'juliushaertl/nextcloud-docker-dev'
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64
container:
- php83
- php82
- php81
- php80
- php74
- php73
- php72
- php71
- push
- saml
- nginx
- elasticsearch
- mailhog
- ldap
- lookupserver
- smb
- codedev
- code
- talk-janus
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: nextcloud-dev-${{ matrix.container }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
@@ -75,28 +63,64 @@ jobs:
with:
push: false
context: docker/
platforms: linux/amd64,linux/arm64
platforms: ${{ matrix.platform }}
file: ${{ steps.dockerfile.outputs.DOCKERFILE }}
tags: |
ghcr.io/juliushaertl/nextcloud-dev-${{ matrix.container }}:${{ github.sha }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Push container image
outputs: type=image,name=ghcr.io/juliushaertl/nextcloud-dev-${{ matrix.container }},push-by-digest=true,name-canonical=true,push=true
- name: Build and push by digest
id: build
uses: docker/build-push-action@v5
if: github.ref == 'refs/heads/master' || github.event_name == 'release'
with:
push: true
context: docker/
platforms: linux/amd64,linux/arm64
file: ${{ steps.dockerfile.outputs.DOCKERFILE }}
tags: |
ghcr.io/juliushaertl/nextcloud-dev-${{ matrix.container }}:${{ github.event_name == 'release' && 'latest' || 'nightly' }}
ghcr.io/juliushaertl/nextcloud-dev-${{ matrix.container }}:${{ github.event_name == 'release' && github.ref || github.sha }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Move cache
context: .
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
- name: Export digest
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v3
with:
name: digests
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
merge:
runs-on: ubuntu-latest
needs:
- build
strategy:
matrix:
container:
- php80
steps:
- name: Download digests
uses: actions/download-artifact@v3
with:
name: digests
path: /tmp/digests
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: nextcloud-dev-${{ matrix.container }}
- name: Login to GitHub Container Registry
if: needs.prepare.outputs.push == 'true'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ steps.meta.outputs.name }} :${{ steps.meta.outputs.version }}
-20
View File
@@ -1,20 +0,0 @@
# Hook scripts
Scripts in this directory will be picked up by the docker containers
automatically. They can be used for automating setup specific to a developers
use cases
- For all Nextcloud containers:
- before-install.sh
- after-install.sh
## Example for before-start.sh
```bash
#!/bin/bash
echo "🎉🎉🎉🎉🎉🎉🎉🎉 triggered hook before-start.sh"
env
export OC_PASS="mycustomuser"
occ user:add --password-from-env mycustomuser
```
+1 -1
View File
@@ -765,7 +765,7 @@ services:
NEXTCLOUD_URL: http://nextcloud
keycloak:
image: quay.io/keycloak/keycloak:23.0
image: quay.io/keycloak/keycloak:22.0
expose:
- 8080
volumes:
+1 -22
View File
@@ -199,8 +199,6 @@ install() {
USER="admin"
PASSWORD="admin"
run_hook_before_install
output "🔧 Starting auto installation"
if [ "$SQL" = "oci" ]; then
OCC maintenance:install --admin-user=$USER --admin-pass=$PASSWORD --database="$SQL" --database-name=xe --database-host="$SQLHOST" --database-user=system --database-pass=oracle
@@ -287,27 +285,9 @@ install() {
configure_add_user alice &
configure_add_user bob &
run_hook_after_install
output "🚀 Finished setup using $SQL database…"
}
run_hook_before_install() {
[ -e /shared/hooks/before-install.sh ] && bash /shared/hooks/before-install.sh
}
run_hook_after_install() {
[ -e /shared/hooks/after-install.sh ] && bash /shared/hooks/after-install.sh
}
run_hook_before_start() {
[ -e /shared/hooks/before-start.sh ] && bash /shared/hooks/before-start.sh
}
run_hook_after_start() {
[ -e /shared/hooks/after-start.sh ] && bash /shared/hooks/after-start.sh
}
add_hosts() {
echo "Add the host IP as host.docker.internal to /etc/hosts ..."
ip -4 route list match 0/0 | awk '{print $3 " host.docker.internal"}' >> /etc/hosts
@@ -330,6 +310,7 @@ setup() {
install
fi
fi
}
check_source() {
FILE=/var/www/html/status.php
@@ -367,11 +348,9 @@ pkill -USR1 apache2
check_source
wait_for_other_containers
setup
run_hook_before_start
rm /etc/apache2/conf-enabled/install.conf
rm -f /var/www/html/installing.html
pkill -USR1 apache2
run_hook_after_start
) &
touch /var/log/cron/nextcloud.log "$WEBROOT"/data/nextcloud.log /var/log/xdebug.log