Compare commits

...

1 Commits

Author SHA1 Message Date
giles 63e304cc70 .
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2022-06-08 10:00:42 +01:00
11 changed files with 690 additions and 500 deletions

View File

@ -1 +1,6 @@
echo 'nothing to build'
docker build drone -t ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/drone \
--build-arg REGISTRY= \
&& docker build drone-runner -t ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/drone-runner \
--build-arg REGISTRY= \

View File

@ -1,5 +1,5 @@
export LOCAL_DOCKER_REGISTRY=${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/
docker stack rm drone \
&& echo 'sleeping...zzz' \
&& sleep 60 \
&& sleep 30 \
&& docker stack deploy -c docker-compose.yml drone --with-registry-auth

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,7 @@
# drone
## secrets
* drone-convert-secret
* drone-gitea-client-id
* drone-gitea-client-secret
* drone-gitea-server
@ -8,5 +9,6 @@
* drone-server-host
* local-docker-registry
* registry-password
* local-ip

View File

@ -4,11 +4,11 @@ services:
# drone server application
deploy:
placement:
constraints: [node.labels.com.sigyl.git-stack == yes]
constraints: [node.labels.com.sigyl.drone == yes]
replicas: 1
restart_policy:
condition: any
image: ${LOCAL_DOCKER_REGISTRY}drone/drone:2.4.0
image: ${LOCAL_DOCKER_REGISTRY}drone
volumes:
- drone-5:/var/lib/drone
- drone-data-5:/data
@ -26,18 +26,20 @@ services:
- DRONE_USER_CREATE=username:giles,admin:true
- DRONE_AGENTS_ENABLED=true
- DRONE_JSONNET_ENABLED=true
ports:
- 81:8080
networks:
- appnet
- externalnet
drone-docker-runner:
drone-runner:
# drone runner performs builds
deploy:
placement:
constraints: [node.labels.com.sigyl.git-stack == yes]
constraints: [node.labels.com.sigyl.drone-runner == yes]
replicas: 1
restart_policy:
condition: any
image: ${LOCAL_DOCKER_REGISTRY}drone/drone-runner-docker:1.6.3
image: ${LOCAL_DOCKER_REGISTRY}drone-runner
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
@ -46,7 +48,7 @@ services:
- DRONE_RPC_SECRET=${DRONE_RPC_SECRET}
- DRONE_RUNNER_CAPACITY=8
- DRONE_RUNNER_NAME="docker-runner"
- DRONE_RUNNER_ENVIRON=SCHEME:$SCHEME,DOMAIN:$DOMAIN,REGISTRY_DOMAIN:$REGISTRY_DOMAIN,REGISTRY_PORT:$REGISTRY_PORT,REGISTRY_PASSWORD:$REGISTRY_PASSWORD,SSH_HOST:$SSH_HOST,SSH_PORT:$SSH_PORT,SSH_USERNAME:$SSH_USERNAME,SSH_KEY:$SSH_KEY
- DRONE_RUNNER_ENVIRON=SCHEME:$SCHEME,DOMAIN:$DOMAIN,REGISTRY_DOMAIN:$REGISTRY_DOMAIN,REGISTRY_PORT:$REGISTRY_PORT,REGISTRY_PASSWORD:$REGISTRY_PASSWORD,SSH_HOST:$SSH_HOST,SSH_PORT:$SSH_PORT,SSH_USERNAME:$SSH_USERNAME,SSH_KEY:$SSH_KEY,SSH_PASSWORD:$SSH_PASSWORD
networks:
- appnet
volumes:
@ -56,7 +58,9 @@ volumes:
networks:
appnet:
driver: overlay
attachable: true
#external: true
externalnet:
driver: overlay
external: true
external: true
name: externalnet

17
drone-runner/Dockerfile Normal file
View File

@ -0,0 +1,17 @@
FROM ${REGISTRY}drone/drone-runner-docker:1.6.3
# USER root
#RUN apk update
#RUN apk add gettext
#COPY hosts.template /etc/hosts.template
#COPY run.sh /
#ENTRYPOINT sh /run.sh
#CMD ["sh", "/run.sh"]
#COPY config.production.json.template /var/lib/ghost/
#COPY --from=git /themes/ /var/lib/ghost/content/themes/
#COPY post.hbs /hbs/
#COPY run.sh /
#CMD ["sh", "/run.sh"]

View File

@ -0,0 +1,2 @@
${GIT_IP} ${GIT_DOMAIN}

2
drone-runner/run.sh Normal file
View File

@ -0,0 +1,2 @@
envsubst < /etc/hosts.template >> /etc/hosts
/bin/drone-runner-docker

17
drone/Dockerfile Normal file
View File

@ -0,0 +1,17 @@
FROM ${REGISTRY}drone/drone:2.12.0
# USER root
#RUN apk update
#RUN apk add gettext
#COPY hosts.template /etc/hosts.template
#COPY run.sh /
#ENTRYPOINT sh /run.sh
#CMD ["sh", "/run.sh"]
#COPY config.production.json.template /var/lib/ghost/
#COPY --from=git /themes/ /var/lib/ghost/content/themes/
#COPY post.hbs /hbs/
#COPY run.sh /
#CMD ["sh", "/run.sh"]

2
drone/hosts.template Normal file
View File

@ -0,0 +1,2 @@
${GIT_IP} ${GIT_DOMAIN}

2
drone/run.sh Normal file
View File

@ -0,0 +1,2 @@
envsubst < /etc/hosts.template >> /etc/hosts
drone-server