diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..156e654 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,41 @@ + +kind: pipeline +type: docker +name: build-multiarch-images + +platform: + os: linux + arch: amd64 + +steps: +- name: make-tags + image: node + commands: + - echo -n "${DRONE_COMMIT_SHA:0:10}, latest" > .tags + +- name: build + image: thegeeklab/drone-docker-buildx + privileged: true + settings: + registry: git.mrmeeb.stream + username: + from_secret: docker_username + password: + from_secret: docker_password + repo: git.mrmeeb.stream/mrmeeb/certbot-cron + platforms: + - linux/arm64 + - linux/amd64 + +- name: notify + image: plugins/slack + settings: + webhook: + from_secret: slack_webhook + +trigger: + branch: + - main + event: + exclude: + - pull_request \ No newline at end of file diff --git a/run.sh b/run.sh index 8078bed..f8fd315 100644 --- a/run.sh +++ b/run.sh @@ -1,9 +1,34 @@ #!/bin/bash +#Importing and running additional scripts placed in /config/init +if [ -d /config/init ] +then + if [ "$(ls -A /config/init)" ] + then + + echo "Running additional startup scripts" + + bash /config/init/* + + else + + echo "/config/init is empty - no additional startup scripts detected" + + fi +else + + echo "Directory /config/init not found. Recreating." + + mkdir /config/init + +fi + +#Copying config.json to /config if it isn't there already, then linking it back into Cronicle mv -n /opt/cronicle/conf/config.json /config/config.json rm -rf /opt/cronicle/conf/config.json ln -s /config/config.json /opt/cronicle/conf/config.json +#Detecting what mode Cronicle should be started in if [ $MODE == "manager" ] then echo "Cronicle is running in 'manager' mode" @@ -32,6 +57,7 @@ then elif [ $MODE == "worker" ] then + echo "Cronicle is running in 'worker' mode" exec node /opt/cronicle/lib/main.js --color 1