Compare commits
12 Commits
f2c82d24e2
...
1.0.1
Author | SHA1 | Date | |
---|---|---|---|
|
bc87393fba | ||
|
f9d43d43f9 | ||
ee0b103593 | |||
6cd309eb9a | |||
93aebc5251 | |||
|
513b3f9f6a | ||
|
dd9f1a1c2f | ||
|
de3896d5ca | ||
|
6bc1120a64 | ||
|
f7c6ce03ea | ||
|
e1e69d5212 | ||
|
ca0fbeea73 |
42
.drone.yml
42
.drone.yml
@@ -14,26 +14,6 @@ workspace:
|
||||
path: /drone/src
|
||||
|
||||
steps:
|
||||
- name: build multiarch from dev
|
||||
image: docker.io/owncloudci/drone-docker-buildx:4
|
||||
privileged: true
|
||||
settings:
|
||||
cache-from: [ "registry.dev.format.hu/framework-scheduler" ]
|
||||
registry: registry.dev.format.hu
|
||||
repo: registry.dev.format.hu/framework-scheduler
|
||||
tags: latest
|
||||
dockerfile: Dockerfile
|
||||
username:
|
||||
from_secret: dev-hu-registry-username
|
||||
password:
|
||||
from_secret: dev-hu-registry-password
|
||||
platforms:
|
||||
- linux/amd64
|
||||
- linux/arm64
|
||||
when:
|
||||
event:
|
||||
- push
|
||||
|
||||
- name: pull image to dockerhub
|
||||
image: docker.io/owncloudci/drone-docker-buildx:4
|
||||
privileged: true
|
||||
@@ -51,3 +31,25 @@ steps:
|
||||
when:
|
||||
event:
|
||||
- tag
|
||||
|
||||
- name: build multiarch from dev
|
||||
image: docker.io/owncloudci/drone-docker-buildx:4
|
||||
privileged: true
|
||||
#environment:
|
||||
# DOCKER_PLUGIN_MIRROR: "https://mirror.dev.format.hu"
|
||||
settings:
|
||||
cache-from: [ "registry.dev.format.hu/framework-scheduler" ]
|
||||
registry: registry.dev.format.hu
|
||||
repo: registry.dev.format.hu/framework-scheduler
|
||||
tags: latest
|
||||
dockerfile: Dockerfile
|
||||
username:
|
||||
from_secret: dev-hu-registry-username
|
||||
password:
|
||||
from_secret: dev-hu-registry-password
|
||||
platforms:
|
||||
- linux/amd64
|
||||
- linux/arm64
|
||||
when:
|
||||
event:
|
||||
- push
|
@@ -568,8 +568,10 @@ execute_task() {
|
||||
DATE=$(date +"%Y%m%d%H%M")
|
||||
|
||||
# Executing task
|
||||
debug "TASK: $(echo $TASK | cut -d ':' -f1)"
|
||||
TASK_NAME=$(echo $TASK | cut -d ':' -f1)
|
||||
if [ "$TASK_NAME" != "check_vpn" ]; then
|
||||
debug "TASK: $(echo $TASK_NAME | cut -d ':' -f1)"
|
||||
fi
|
||||
|
||||
# checking sytem status
|
||||
SYSTEM_STATUS=$(ls /etc/user/config/services/*.json | grep -v service-framework.json)
|
||||
@@ -592,6 +594,17 @@ execute_task() {
|
||||
#fi;
|
||||
JSON_TARGET=$(echo '{ "DATE": "'$DATE'", "INSTALL_STATUS": "'$INSTALL_STATUS'" }' | jq -r . | base64 -w0)
|
||||
|
||||
elif [ "$TASK_NAME" == "letsencrypt" ]; then
|
||||
DOMAINS=$(echo $B64_JSON | base64 -d | jq -r 'keys[]')
|
||||
for DOMAIN in $(echo $DOMAINS); do
|
||||
REQUEST=$(echo $B64_JSON | base64 -d | jq -r ".[\"$DOMAIN\"].status")
|
||||
|
||||
if [ "$REQUEST" == "requested" ]; then
|
||||
echo "New certificate for $DOMAIN is requested."
|
||||
touch /etc/system/data/ssl/keys/$DOMAIN/new_certificate
|
||||
fi
|
||||
done
|
||||
|
||||
elif [ "$TASK_NAME" == "system" ]; then
|
||||
#SYSTEM_LIST="core-dns.json cron.json domain-local-backend.json firewall-letsencrypt.json firewall-local-backend.json firewall-localloadbalancer-dns.json firewall-localloadbalancer-to-smarthostbackend.json firewall-smarthost-backend-dns.json firewall-smarthost-loadbalancer-dns.json firewall-smarthost-to-backend.json firewall-smarthostloadbalancer-from-publicbackend.json letsencrypt.json local-backend.json local-proxy.json service-framework.json smarthost-proxy-scheduler.json smarthost-proxy.json"
|
||||
SYSTEM_LIST="core-dns.json cron.json letsencrypt.json local-proxy.json service-framework.json smarthost-proxy-scheduler.json smarthost-proxy.json"
|
||||
@@ -801,6 +814,7 @@ execute_task() {
|
||||
|
||||
TEMPLATE=$(echo "$TEMPLATE" | base64 -w0)
|
||||
JSON_TARGET=$(echo '{ "DATE": "'$DATE'", "STATUS": "0", "TEMPLATE": "'$TEMPLATE'" }' | jq -r . | base64 -w0)
|
||||
|
||||
elif [ "$DEPLOY_ACTION" == "deploy" ]; then
|
||||
JSON_TARGET=""
|
||||
#JSON_TARGET=$(echo '{ "DATE": "'$DATE'", "STATUS": "1" }' | jq -r . | base64 -w0) # deployment has started
|
||||
@@ -900,7 +914,9 @@ execute_task() {
|
||||
fi
|
||||
fi
|
||||
|
||||
debug "JSON_TARGET: $JSON_TARGET"
|
||||
if [ "$TASK_NAME" != "check_vpn" ]; then
|
||||
debug "JSON_TARGET: $JSON_TARGET"
|
||||
fi
|
||||
|
||||
if [ "$JSON_TARGET" != "" ]; then
|
||||
#redis-cli -h $REDIS_SERVER -p $REDIS_PORT SET $TASK "$JSON_TARGET"
|
||||
@@ -1062,7 +1078,9 @@ unset IFS
|
||||
inotifywait --exclude "\.(swp|tmp)" -m -e CREATE,CLOSE_WRITE,DELETE,MOVED_TO -r $DIR |
|
||||
while read dir op file; do
|
||||
if [ "${op}" == "CLOSE_WRITE,CLOSE" ]; then
|
||||
echo "new file created: $file"
|
||||
if [ "$file" != "check_vpn.json" ]; then
|
||||
echo "new file created: $file"
|
||||
fi
|
||||
B64_JSON=$(cat $DIR/$file | base64 -w0)
|
||||
TASK=$(echo $file | cut -d '.' -f1)
|
||||
execute_task "$TASK" "$B64_JSON"
|
||||
|
Reference in New Issue
Block a user