Merge branch 'master' of https://git.format.hu/format/proxy-scheduler
This commit is contained in:
48
.drone.yml
Normal file
48
.drone.yml
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
kind: pipeline
|
||||||
|
type: kubernetes
|
||||||
|
name: default
|
||||||
|
|
||||||
|
node_selector:
|
||||||
|
physical-node: dev2
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- master
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
workspace:
|
||||||
|
path: /drone/src
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build multiarch proxy-scheduler
|
||||||
|
image: docker.io/owncloudci/drone-docker-buildx:4
|
||||||
|
privileged: true
|
||||||
|
settings:
|
||||||
|
cache-from: [ "registry.dev.format.hu/proxy-scheduler" ]
|
||||||
|
registry: registry.dev.format.hu
|
||||||
|
repo: registry.dev.format.hu/proxy-scheduler
|
||||||
|
tags: latest
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
username:
|
||||||
|
from_secret: dev-hu-registry-username
|
||||||
|
password:
|
||||||
|
from_secret: dev-hu-registry-password
|
||||||
|
platforms:
|
||||||
|
- linux/amd64
|
||||||
|
- linux/arm64
|
||||||
|
|
||||||
|
- name: pull image to dockerhub
|
||||||
|
image: docker.io/owncloudci/drone-docker-buildx:4
|
||||||
|
privileged: true
|
||||||
|
settings:
|
||||||
|
cache-from: [ "safebox/proxy-scheduler" ]
|
||||||
|
repo: safebox/proxy-scheduler
|
||||||
|
tags: latest
|
||||||
|
username:
|
||||||
|
from_secret: dockerhub-username
|
||||||
|
password:
|
||||||
|
from_secret: dockerhub-password
|
||||||
|
platforms:
|
||||||
|
- linux/amd64
|
||||||
|
- linux/arm64
|
||||||
|
|
@@ -14,17 +14,9 @@
|
|||||||
TIMEOUT=$TIMEOUT
|
TIMEOUT=$TIMEOUT
|
||||||
RESTART=$RESTART
|
RESTART=$RESTART
|
||||||
|
|
||||||
# Setup docker registry url path
|
SETUP_VERSION=${SETUP_VERSION:-latest};
|
||||||
|
|
||||||
if [[ -n "$DOCKER_REGISTRY_URL" && "$DOCKER_REGISTRY_URL" != "null" ]] ; then
|
|
||||||
SETUP="/setup";
|
|
||||||
else
|
|
||||||
SETUP="setup";
|
|
||||||
DOCKER_REGISTRY_URL="";
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Setting service files path
|
# Setting service files path
|
||||||
|
|
||||||
if [ "$SERVICE_FILES" == "" ]; then
|
if [ "$SERVICE_FILES" == "" ]; then
|
||||||
SERVICE_FILES=/etc/user/config/services
|
SERVICE_FILES=/etc/user/config/services
|
||||||
fi
|
fi
|
||||||
@@ -33,6 +25,7 @@ if [ "$SOURCE" == "" ]; then
|
|||||||
SOURCE=/etc/user/config
|
SOURCE=/etc/user/config
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Setup docker registry url path
|
||||||
if [[ -n "$DOCKER_REGISTRY_URL" && "$DOCKER_REGISTRY_URL" != "null" ]] ; then
|
if [[ -n "$DOCKER_REGISTRY_URL" && "$DOCKER_REGISTRY_URL" != "null" ]] ; then
|
||||||
SETUP="/setup";
|
SETUP="/setup";
|
||||||
else
|
else
|
||||||
@@ -40,16 +33,31 @@ else
|
|||||||
DOCKER_REGISTRY_URL="";
|
DOCKER_REGISTRY_URL="";
|
||||||
fi
|
fi
|
||||||
|
|
||||||
service_exec="docker run --rm \
|
if [ "$SETUP_VERSION" == "latest" ]; then
|
||||||
-w /services/ \
|
VOLUME_MOUNTS="
|
||||||
--mount src=SYSTEM_DATA,dst=/etc/ssl/certs,volume-subpath=ssl/certs,ro \
|
--mount src=SYSTEM_DATA,dst=/etc/ssl/certs,volume-subpath=ssl/certs,ro \
|
||||||
--mount src=SYSTEM_DATA,dst=/etc/dns/hosts.local,volume-subpath=dns/hosts.local,ro \
|
--mount src=SYSTEM_DATA,dst=/etc/dns/hosts.local,volume-subpath=dns/hosts.local,ro \
|
||||||
--mount src=USER_CONFIG,dst=/services,volume-subpath=services/tmp \
|
--mount src=USER_CONFIG,dst=/services,volume-subpath=services/tmp \
|
||||||
--mount src=USER_CONFIG,dst=/etc/user/config/system.json,volume-subpath=system.json,ro \
|
--mount src=USER_CONFIG,dst=/etc/user/config/system.json,volume-subpath=system.json,ro \
|
||||||
--mount src=USER_CONFIG,dst=/etc/user/config/user.json,volume-subpath=user.json,ro \
|
--mount src=USER_CONFIG,dst=/etc/user/config/user.json,volume-subpath=user.json,ro \
|
||||||
|
";
|
||||||
|
else
|
||||||
|
VOLUME_MOUNTS="
|
||||||
|
-v /etc/system/data/dns:/etc/dns:rw \
|
||||||
|
-v /etc/ssl/certs:/etc/ssl/certs:ro \
|
||||||
|
-v /etc/user/config/user.json:/etc/user/config/user.json:ro \
|
||||||
|
-v /etc/user/config/system.json:/etc/user/config/system.json:ro \
|
||||||
|
-v /etc/user/config/services/:/services/:ro \
|
||||||
|
-v /etc/user/config/services/tmp:/services/tmp:rw \
|
||||||
|
"
|
||||||
|
fi;
|
||||||
|
|
||||||
|
service_exec="docker run --rm \
|
||||||
|
-w /services/ \
|
||||||
|
$VOLUME_MOUNTS
|
||||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||||
--env DOCKER_REGISTRY_URL=$DOCKER_REGISTRY_URL \
|
--env DOCKER_REGISTRY_URL=$DOCKER_REGISTRY_URL \
|
||||||
$DOCKER_REGISTRY_URL$SETUP"
|
$DOCKER_REGISTRY_URL$SETUP:$SETUP_VERSION"
|
||||||
|
|
||||||
letsencrypt_certificates() {
|
letsencrypt_certificates() {
|
||||||
|
|
||||||
|
@@ -20,6 +20,7 @@ ROLE=$ROLE
|
|||||||
SERVICE_NAME=$SERVICE_NAME
|
SERVICE_NAME=$SERVICE_NAME
|
||||||
PROXY_CONFIG_DIR=$PROXY_CONFIG_DIR
|
PROXY_CONFIG_DIR=$PROXY_CONFIG_DIR
|
||||||
|
|
||||||
|
SETUP_VERSION=${SETUP_VERSION:-latest};
|
||||||
|
|
||||||
# Setup docker registry url path
|
# Setup docker registry url path
|
||||||
|
|
||||||
@@ -77,7 +78,7 @@ service_exec="docker run --rm \
|
|||||||
-v /etc/user/config/services/tmp/:/services/tmp/:rw \
|
-v /etc/user/config/services/tmp/:/services/tmp/:rw \
|
||||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||||
--env DOCKER_REGISTRY_URL=$DOCKER_REGISTRY_URL \
|
--env DOCKER_REGISTRY_URL=$DOCKER_REGISTRY_URL \
|
||||||
$DOCKER_REGISTRY_URL$SETUP"
|
$DOCKER_REGISTRY_URL$SETUP:$SETUP_VERSION"
|
||||||
|
|
||||||
do_proxy_restart() {
|
do_proxy_restart() {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user