add drone, add logic for init scripts
This commit is contained in:
parent
ee7034cba3
commit
cad9b48ab9
41
.drone.yml
Normal file
41
.drone.yml
Normal file
@ -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
|
26
run.sh
26
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user