-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #193 from cyb3rgh05t/master
- Loading branch information
Showing
15 changed files
with
163 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,45 @@ | ||
#!/bin/bash | ||
#################################### | ||
# All rights reserved. # | ||
# started from Zero # | ||
# Docker owned dockserver # | ||
# Docker Maintainer dockserver # | ||
##################################### | ||
##################################### | ||
# THIS DOCKER IS UNDER LICENSE # | ||
# NO CUSTOMIZING IS ALLOWED # | ||
# NO REBRANDING IS ALLOWED # | ||
# NO CODE MIRRORING IS ALLOWED # | ||
##################################### | ||
# shellcheck disable=SC2086 | ||
# shellcheck disable=SC2046 | ||
|
||
FOLDER=$1 | ||
APP=$2 | ||
USERNAME=$3 | ||
TOKEN=$4 | ||
|
||
### APP SETTINGS ### | ||
|
||
PICTURE="./images/$APP.png" | ||
APPFOLDER="./$FOLDER/$APP" | ||
|
||
### RELEASE SETTINGS ### | ||
|
||
echo '{ | ||
"appname": "'${APP}'", | ||
"apppic": "'${PICTURE}'", | ||
"appfolder": "./'$FOLDER'/'$APP'", | ||
"user": "github-actions[bot]" | ||
}' > "./$FOLDER/$APP/release.json" | ||
|
||
### DOCKER BUILD ### | ||
### GENERATE Dockerfile based on release.json | ||
|
||
echo '## This file is automatically generated (based on release.json) | ||
## | ||
## Do not changes any lines here | ||
## | ||
FROM scratch | ||
COPY '"${APPFOLDER}"'/root/ / | ||
##EOF' > ./$FOLDER/$APP/Dockerfile |
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,7 @@ | ||
## This file is automatically generated (based on release.json) | ||
## | ||
## Do not changes any lines here | ||
## | ||
FROM scratch | ||
COPY ./mod/docker-mod-storagecheck/root/ / | ||
##EOF |
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,6 @@ | ||
{ | ||
"appname": "docker-mod-storagecheck", | ||
"apppic": "./images/docker-mount.png", | ||
"appfolder": "./mod/docker-mod-storagecheck", | ||
"user": "github-actions[bot]" | ||
} |
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,15 @@ | ||
---------------------------------------------------- | ||
|
||
____ _ | ||
| _ \ ___ ___| | _____ ___ _ ____ _____ _ __ | ||
| | | |/ _ \ / __| |/ / __|/ _ \ '__\ \ / / _ \ '__| | ||
| |_| | (_) | (__| <\__ \ __/ | \ V / __/ | | ||
|____/ \___/ \___|_|\_\___/\___|_| \_/ \___|_| | ||
|
||
|
||
---------------------------------------------------- | ||
|
||
To support the projects visit: | ||
|
||
https://dockserver.io/ | ||
---------------------------------------------------- |
Empty file.
32 changes: 32 additions & 0 deletions
32
mod/docker-mod-storagecheck/root/etc/s6-overlay/s6-rc.d/init-mod-universal-mount/run
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 @@ | ||
#!/usr/bin/with-contenv bash | ||
# shellcheck shell=bash | ||
##################################### | ||
# All rights reserved. # | ||
# started from Zero # | ||
# Docker owned dockserver # | ||
# Docker Maintainer dockserver # | ||
##################################### | ||
# THIS DOCKER IS UNDER LICENSE # | ||
# NO CUSTOMIZING IS ALLOWED # | ||
# NO REBRANDING IS ALLOWED # | ||
# NO CODE MIRRORING IS ALLOWED # | ||
##################################### | ||
|
||
STORAGECHECK="/mnt/unionfs/.storagecheck/test" | ||
STORAGECHECK2="/mnt/unionfs/.storagecheck/test2" | ||
APP="${HOSTNAME^}" | ||
|
||
function log() { | ||
GRAY="\033[0;37m" | ||
BLUE="\033[0;34m" | ||
NC="\033[0m" | ||
$(which echo) -e "${GRAY}[$($(which date) +'%Y/%m/%d %H:%M:%S')]${BLUE} [${APP}]${NC} ${1}" | ||
} | ||
|
||
log "-> Checking for Storage Mounts ... <-" | ||
|
||
while [[ ! -f "${STORAGECHECK}" || ! -f "${STORAGECHECK2}" ]]; do | ||
log "-> Waiting for Storage Mounts ... <-" && sleep 10 | ||
done | ||
|
||
log "-> Storage Mounts online ! | Starting ${APP} ... <-" |
1 change: 1 addition & 0 deletions
1
mod/docker-mod-storagecheck/root/etc/s6-overlay/s6-rc.d/init-mod-universal-mount/type
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 @@ | ||
oneshot |
1 change: 1 addition & 0 deletions
1
mod/docker-mod-storagecheck/root/etc/s6-overlay/s6-rc.d/init-mod-universal-mount/up
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 @@ | ||
/etc/s6-overlay/s6-rc.d/init-mod-universal-mount/run |
1 change: 1 addition & 0 deletions
1
...gecheck/root/etc/s6-overlay/s6-rc.d/init-mods-end/dependencies.d/init-mod-universal-mount
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 @@ | ||
|
Empty file.
46 changes: 46 additions & 0 deletions
46
mod/docker-mod-storagecheck/root/etc/s6-overlay/s6-rc.d/svc-mod-universal-storagecheck/run
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,46 @@ | ||
#!/usr/bin/with-contenv bash | ||
# shellcheck shell=bash | ||
##################################### | ||
# All rights reserved. # | ||
# started from Zero # | ||
# Docker owned dockserver # | ||
# Docker Maintainer dockserver # | ||
##################################### | ||
# THIS DOCKER IS UNDER LICENSE # | ||
# NO CUSTOMIZING IS ALLOWED # | ||
# NO REBRANDING IS ALLOWED # | ||
# NO CODE MIRRORING IS ALLOWED # | ||
##################################### | ||
|
||
STORAGECHECK="/mnt/unionfs/.storagecheck/test" | ||
STORAGECHECK2="/mnt/unionfs/.storagecheck/test2" | ||
APP="${HOSTNAME^}" | ||
|
||
function log() { | ||
GRAY="\033[0;37m" | ||
BLUE="\033[0;34m" | ||
NC="\033[0m" | ||
$(which echo) -e "${GRAY}[$($(which date) +'%Y/%m/%d %H:%M:%S')]${BLUE} [${APP}]${NC} ${1}" | ||
} | ||
|
||
while true; do | ||
if [[ ! -f "${STORAGECHECK}" || ! -f "${STORAGECHECK2}" ]]; then | ||
log "-> One or more Storage Mounts offline ! | Stopping ${APP} ... <-" | ||
mapfile -t "SERVICES" < <($(which ls) /var/run/service/ | $(which grep) -Ewiv "s6-linux-init-shutdownd|s6rc-fdholder|s6rc-oneshot-runner|svc-cron|svc-mod-universal-storagecheck") | ||
for SERVICE in ${SERVICES[@]}; do | ||
s6-svc -d /var/run/service/${SERVICE} | ||
while [[ ! -f "${STORAGECHECK}" || ! -f "${STORAGECHECK2}" ]]; do | ||
$(which sleep) 30 | ||
done | ||
s6-svc -u /var/run/service/${SERVICE} | ||
done | ||
log "-> Storage Mounts online again ! | Starting ${APP} ...<-" | ||
fi | ||
$(which sleep) 120 | ||
log "-> Checking for Storage Mounts ... <-" | ||
|
||
while [[ ! -f "${STORAGECHECK}" || ! -f "${STORAGECHECK2}" ]]; do | ||
log "-> Waiting for Storage Mounts ... <-" && sleep 10 | ||
done | ||
|
||
log "-> Storage Mounts online ! | Starting ${APP} ... <-" |
1 change: 1 addition & 0 deletions
1
mod/docker-mod-storagecheck/root/etc/s6-overlay/s6-rc.d/svc-mod-universal-storagecheck/type
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 @@ | ||
longrun |
Empty file.
Empty file.