2020-08-28 20:53:01 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: register
|
|
|
|
|
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: amd64
|
|
|
|
|
|
|
|
clone:
|
|
|
|
disable: true
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
exclude:
|
|
|
|
- promote
|
|
|
|
|
2020-09-25 08:11:19 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: registry
|
|
|
|
|
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: amd64
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: "dockerpull and save docker images:"
|
|
|
|
image: docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f
|
|
|
|
commands:
|
|
|
|
- set -e
|
|
|
|
- export REGISTRY=$${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/
|
2020-10-06 19:08:40 +00:00
|
|
|
- sh .drone/scripts/initialise-images.sh $${REGISTRY} "$${REGISTRY_PASSWORD}"
|
2020-09-25 08:11:19 +00:00
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run
|
|
|
|
|
|
|
|
services:
|
|
|
|
- name: docker
|
|
|
|
image: docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f
|
|
|
|
privileged: true
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run
|
|
|
|
- name: ca
|
|
|
|
path: /etc/docker/certs.d
|
2020-10-22 14:52:00 +00:00
|
|
|
- name: daemonjson
|
|
|
|
path: /etc/docker/daemon.json
|
2020-09-25 08:11:19 +00:00
|
|
|
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
temp: {}
|
|
|
|
- name: ca
|
|
|
|
host:
|
|
|
|
path: /etc/docker/certs.d
|
2020-10-22 14:52:00 +00:00
|
|
|
- name: daemonjson
|
|
|
|
host:
|
|
|
|
path: /etc/docker/daemon.json
|
2020-09-25 08:11:19 +00:00
|
|
|
|
|
|
|
image_pull_secrets:
|
|
|
|
- dockerconfigjson
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- promote
|
|
|
|
target:
|
|
|
|
- registry
|
|
|
|
|
2020-08-28 20:53:01 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: deploy
|
|
|
|
|
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: amd64
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: print env
|
|
|
|
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
|
|
|
|
settings:
|
|
|
|
envs:
|
|
|
|
- drone_tag
|
|
|
|
- drone_commit
|
|
|
|
- drone_build_number
|
|
|
|
- drone_repo_name
|
|
|
|
- drone_repo_namespace
|
2020-10-22 15:16:00 +00:00
|
|
|
- theme
|
2020-08-28 20:53:01 +00:00
|
|
|
- mail_service
|
|
|
|
- mail_user
|
|
|
|
- commento_origin
|
2020-10-22 15:07:21 +00:00
|
|
|
- theme
|
2020-08-28 20:53:01 +00:00
|
|
|
- mysql_root_password
|
|
|
|
script:
|
|
|
|
- rm -f env-ghost
|
2020-10-22 15:16:00 +00:00
|
|
|
- "echo \"export THEME='$${THEME}'\" >> env-ghost # \"theme\""
|
2020-08-28 20:53:01 +00:00
|
|
|
- "echo \"export MAIL_SERVICE='$${MAIL_SERVICE}'\" >> env-ghost # \"mail-service\""
|
|
|
|
- "echo \"export MAIL_USER='$${MAIL_USER}'\" >> env-ghost # \"mail-user\""
|
|
|
|
- "echo \"export COMMENTO_ORIGIN='$${COMMENTO_ORIGIN}'\" >> env-ghost # \"commento-origin\""
|
2020-10-22 15:07:21 +00:00
|
|
|
- "echo \"export THEME='$${THEME}'\" >> env-ghost # \"theme\""
|
2020-08-28 20:53:01 +00:00
|
|
|
- "echo \"export MYSQL_ROOT_PASSWORD='$${MYSQL_ROOT_PASSWORD}'\" >> env-ghost # \"mysql-root-password\""
|
|
|
|
environment:
|
|
|
|
COMMENTO_ORIGIN:
|
|
|
|
from_secret: commento-origin
|
|
|
|
MAIL_SERVICE:
|
|
|
|
from_secret: mail-service
|
|
|
|
MAIL_USER:
|
|
|
|
from_secret: mail-user
|
|
|
|
MYSQL_ROOT_PASSWORD:
|
|
|
|
from_secret: mysql-root-password
|
2020-10-22 15:07:21 +00:00
|
|
|
THEME:
|
|
|
|
from_secret: theme
|
2020-08-28 20:53:01 +00:00
|
|
|
|
|
|
|
- name: scp
|
|
|
|
image: appleboy/drone-scp:1.6.2@sha256:bd37a55f4b97e7742b0de7333669b96220b3cc422d366e1fa8c34059b736ab47
|
|
|
|
settings:
|
|
|
|
command_timeout: 2m
|
|
|
|
source:
|
|
|
|
- .
|
|
|
|
target: /stack/ghost
|
|
|
|
|
|
|
|
- name: wait
|
|
|
|
image: alpine:3.12.0@sha256:90baa0922fe90624b05cb5766fa5da4e337921656c2f8e2b13bd3c052a0baac1
|
|
|
|
commands:
|
|
|
|
- sleep 15
|
|
|
|
|
|
|
|
- name: "dockerbuild:"
|
|
|
|
image: docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f
|
|
|
|
commands:
|
|
|
|
- set -e
|
|
|
|
- sh .drone/login.sh
|
|
|
|
- sh .drone/build.sh
|
|
|
|
- sh .drone/push.sh
|
|
|
|
- sh .drone/logout.sh
|
2020-10-22 15:16:00 +00:00
|
|
|
environment:
|
|
|
|
THEME:
|
|
|
|
from_secret: theme
|
2020-08-28 20:53:01 +00:00
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run
|
|
|
|
|
|
|
|
- name: deploy
|
|
|
|
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
|
|
|
|
settings:
|
|
|
|
envs:
|
|
|
|
- drone_tag
|
|
|
|
- drone_commit
|
|
|
|
- drone_build_number
|
|
|
|
- drone_repo_name
|
|
|
|
- drone_repo_namespace
|
2020-10-22 15:07:21 +00:00
|
|
|
- scheme
|
2020-08-28 20:53:01 +00:00
|
|
|
- domain
|
|
|
|
- registry_domain
|
|
|
|
- registry_port
|
|
|
|
- registry_password
|
|
|
|
- mail_service
|
|
|
|
- mail_user
|
|
|
|
- commento_origin
|
2020-10-22 15:07:21 +00:00
|
|
|
- theme
|
2020-08-28 20:53:01 +00:00
|
|
|
- mysql_root_password
|
2020-10-22 15:16:00 +00:00
|
|
|
- theme
|
2020-08-28 20:53:01 +00:00
|
|
|
script:
|
|
|
|
- export MYSQL_ROOT_PASSWORD=$${MYSQL_ROOT_PASSWORD}
|
|
|
|
- export MAIL_SERVICE=$${MAIL_SERVICE}
|
|
|
|
- export MAIL_USER=$${MAIL_USER}
|
|
|
|
- export COMMENTO_ORIGIN=$${COMMENTO_ORIGIN}
|
2020-10-22 15:07:21 +00:00
|
|
|
- export THEME=$${THEME}
|
2020-10-22 15:16:00 +00:00
|
|
|
- export THEME=$${THEME}
|
2020-10-22 14:35:59 +00:00
|
|
|
- export SCHEME=$${SCHEME}
|
2020-08-28 20:53:01 +00:00
|
|
|
- export DOMAIN=$${DOMAIN}
|
|
|
|
- export REGISTRY_DOMAIN=$${REGISTRY_DOMAIN}
|
|
|
|
- export REGISTRY_PORT=$${REGISTRY_PORT}
|
|
|
|
- export REGISTRY_PASSWORD=$${REGISTRY_PASSWORD}
|
|
|
|
- set -e
|
|
|
|
- cd /stack/ghost
|
|
|
|
- sh .drone/login.sh
|
|
|
|
- sh .drone/pull.sh
|
|
|
|
- sh .drone/deploy.sh
|
|
|
|
environment:
|
|
|
|
COMMENTO_ORIGIN:
|
|
|
|
from_secret: commento-origin
|
|
|
|
MAIL_SERVICE:
|
|
|
|
from_secret: mail-service
|
|
|
|
MAIL_USER:
|
|
|
|
from_secret: mail-user
|
|
|
|
MYSQL_ROOT_PASSWORD:
|
|
|
|
from_secret: mysql-root-password
|
2020-10-22 15:07:21 +00:00
|
|
|
THEME:
|
|
|
|
from_secret: theme
|
2020-08-28 20:53:01 +00:00
|
|
|
|
|
|
|
services:
|
|
|
|
- name: docker
|
|
|
|
image: docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f
|
|
|
|
privileged: true
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run
|
|
|
|
- name: ca
|
|
|
|
path: /etc/docker/certs.d
|
2020-10-22 14:52:00 +00:00
|
|
|
- name: daemonjson
|
|
|
|
path: /etc/docker/daemon.json
|
2020-08-28 20:53:01 +00:00
|
|
|
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
temp: {}
|
|
|
|
- name: ca
|
|
|
|
host:
|
|
|
|
path: /etc/docker/certs.d
|
2020-10-22 14:52:00 +00:00
|
|
|
- name: daemonjson
|
|
|
|
host:
|
|
|
|
path: /etc/docker/daemon.json
|
2020-08-28 20:53:01 +00:00
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- promote
|
|
|
|
target:
|
|
|
|
- production
|
|
|
|
|
|
|
|
...
|