Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0ea040a0b8 | |||
| 9ae50462bb | |||
| 18e63accec | |||
| 845e87e1f7 | |||
| 40bfbf83c4 | |||
| b8fbafdc5e | |||
| 55aa6d8fc0 |
@@ -7,32 +7,44 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
|
||||
jobs:
|
||||
build:
|
||||
push_to_registry:
|
||||
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
|
||||
@@ -63,64 +75,28 @@ jobs:
|
||||
with:
|
||||
push: false
|
||||
context: docker/
|
||||
platforms: ${{ matrix.platform }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
file: ${{ steps.dockerfile.outputs.DOCKERFILE }}
|
||||
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
|
||||
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
|
||||
uses: docker/build-push-action@v5
|
||||
if: github.ref == 'refs/heads/master' || github.event_name == 'release'
|
||||
with:
|
||||
context: .
|
||||
platforms: ${{ matrix.platform }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
- name: Export digest
|
||||
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
|
||||
run: |
|
||||
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
|
||||
rm -rf /tmp/.buildx-cache
|
||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||
|
||||
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 }}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
# 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
@@ -765,7 +765,7 @@ services:
|
||||
NEXTCLOUD_URL: http://nextcloud
|
||||
|
||||
keycloak:
|
||||
image: quay.io/keycloak/keycloak:22.0
|
||||
image: quay.io/keycloak/keycloak:23.0
|
||||
expose:
|
||||
- 8080
|
||||
volumes:
|
||||
|
||||
+22
-1
@@ -199,6 +199,8 @@ 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
|
||||
@@ -285,9 +287,27 @@ 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
|
||||
@@ -310,7 +330,6 @@ setup() {
|
||||
install
|
||||
fi
|
||||
fi
|
||||
|
||||
}
|
||||
check_source() {
|
||||
FILE=/var/www/html/status.php
|
||||
@@ -348,9 +367,11 @@ 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
|
||||
|
||||
Reference in New Issue
Block a user