Compare commits

..

1 Commits

Author SHA1 Message Date
Giles Bradshaw bfdd554655 .
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2020-10-23 09:37:04 +01:00
11 changed files with 39 additions and 59 deletions

View File

@ -1,6 +1,4 @@
sleep 10 docker build ghost -t ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/my-ghost \
--build-arg REGISTRY=${REGISTRY_DOMAIN}:${REGISTRY_PORT}/ \
docker build ghost -t ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/my-ghost \
--build-arg REGISTRY=${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/ \
--build-arg THEME=${THEME} --build-arg THEME=${THEME}

View File

@ -1,4 +1,4 @@
export LOCAL_DOCKER_REGISTRY=${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/ \ export LOCAL_DOCKER_REGISTRY=${REGISTRY_DOMAIN}:${REGISTRY_PORT}/ \
&& echo "scheme: ${SCHEME}" \ && echo "scheme: ${SCHEME}" \
&& docker stack rm ghost \ && docker stack rm ghost \
&& echo 'sleeping...zzz' \ && echo 'sleeping...zzz' \

View File

@ -128,13 +128,12 @@ steps:
- registry_domain - registry_domain
- registry_port - registry_port
- registry_password - registry_password
- destination_registry
script: script:
- "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n" - "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n"
- docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/alpine/git:v2.26.2 - docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/alpine/git:v2.26.2
- docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/alpine/git:v2.26.2 -o /stack/.images/ghost/alpine_git:v2.26.2.tar - docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/alpine/git:v2.26.2 -o /stack/.images/ghost/alpine_git:v2.26.2.tar
- echo "docker load < alpine_git:v2.26.2.tar" >> /stack/.images/ghost/load.sh - echo "docker load alpine_git:v2.26.2.tar" >> /stack/.images/ghost/load.sh
- echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/alpine/git:v2.26.2 $${DESTINATION_REGISTRY}/stack/ghost/alpine/git:v2.26.2" >> /stack/.images/ghost/load.sh - echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/alpine/git:v2.26.2 /stack/DOLLAR1/alpine/git:v2.26.2" >> /stack/.images/ghost/load.sh
- name: ghost:3.14.0 - name: ghost:3.14.0
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
@ -148,13 +147,12 @@ steps:
- registry_domain - registry_domain
- registry_port - registry_port
- registry_password - registry_password
- destination_registry
script: script:
- "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n" - "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n"
- docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/ghost:3.14.0 - docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/ghost:3.14.0
- docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/ghost:3.14.0 -o /stack/.images/ghost/ghost:3.14.0.tar - docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/ghost:3.14.0 -o /stack/.images/ghost/ghost:3.14.0.tar
- echo "docker load < ghost:3.14.0.tar" >> /stack/.images/ghost/load.sh - echo "docker load ghost:3.14.0.tar" >> /stack/.images/ghost/load.sh
- echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/ghost:3.14.0 $${DESTINATION_REGISTRY}/stack/ghost/ghost:3.14.0" >> /stack/.images/ghost/load.sh - echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/ghost:3.14.0 /stack/DOLLAR1/ghost:3.14.0" >> /stack/.images/ghost/load.sh
- name: mysql:5.7 - name: mysql:5.7
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
@ -168,13 +166,12 @@ steps:
- registry_domain - registry_domain
- registry_port - registry_port
- registry_password - registry_password
- destination_registry
script: script:
- "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n" - "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n"
- docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/mysql:5.7 - docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/mysql:5.7
- docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/mysql:5.7 -o /stack/.images/ghost/mysql:5.7.tar - docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/mysql:5.7 -o /stack/.images/ghost/mysql:5.7.tar
- echo "docker load < mysql:5.7.tar" >> /stack/.images/ghost/load.sh - echo "docker load mysql:5.7.tar" >> /stack/.images/ghost/load.sh
- echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/mysql:5.7 $${DESTINATION_REGISTRY}/stack/ghost/mysql:5.7" >> /stack/.images/ghost/load.sh - echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/mysql:5.7 /stack/DOLLAR1/mysql:5.7" >> /stack/.images/ghost/load.sh
- name: my-ghost - name: my-ghost
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
@ -188,13 +185,12 @@ steps:
- registry_domain - registry_domain
- registry_port - registry_port
- registry_password - registry_password
- destination_registry
script: script:
- "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n" - "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n"
- docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/my-ghost - docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/my-ghost
- docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/my-ghost -o /stack/.images/ghost/built/my-ghost.tar - docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/my-ghost -o /stack/.images/ghost/built/my-ghost.tar
- echo "docker load my-ghost.tar" >> /stack/.images/ghost/built/load.sh - echo "docker load my-ghost.tar" >> /stack/.images/ghost/built/load.sh
- echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/my-ghost ${DESINATION_REGISTRY}/stack/ghost/my-ghost" >> /stack/.images/ghost/built/load.sh - echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/ghost/my-ghost /stack/DOLLAR1/my-ghost" >> /stack/.images/ghost/built/load.sh
trigger: trigger:
event: event:
@ -221,21 +217,25 @@ steps:
- drone_build_number - drone_build_number
- drone_repo_name - drone_repo_name
- drone_repo_namespace - drone_repo_namespace
- mail - mail_service
- mail_user
- commento_origin - commento_origin
- theme - theme
- mysql_root_password - mysql_root_password
script: script:
- rm -f env-ghost - rm -f env-ghost
- "echo \"export MAIL='$${MAIL}'\" >> env-ghost # \"mail\"" - "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\"" - "echo \"export COMMENTO_ORIGIN='$${COMMENTO_ORIGIN}'\" >> env-ghost # \"commento-origin\""
- "echo \"export THEME='$${THEME}'\" >> env-ghost # \"theme\"" - "echo \"export THEME='$${THEME}'\" >> env-ghost # \"theme\""
- "echo \"export MYSQL_ROOT_PASSWORD='$${MYSQL_ROOT_PASSWORD}'\" >> env-ghost # \"mysql-root-password\"" - "echo \"export MYSQL_ROOT_PASSWORD='$${MYSQL_ROOT_PASSWORD}'\" >> env-ghost # \"mysql-root-password\""
environment: environment:
COMMENTO_ORIGIN: COMMENTO_ORIGIN:
from_secret: commento-origin from_secret: commento-origin
MAIL: MAIL_SERVICE:
from_secret: mail from_secret: mail-service
MAIL_USER:
from_secret: mail-user
MYSQL_ROOT_PASSWORD: MYSQL_ROOT_PASSWORD:
from_secret: mysql-root-password from_secret: mysql-root-password
THEME: THEME:
@ -333,16 +333,19 @@ steps:
- registry_domain - registry_domain
- registry_port - registry_port
- registry_password - registry_password
- mail - mail_service
- mail_user
- commento_origin - commento_origin
- theme - theme
- mysql_root_password - mysql_root_password
- theme - theme
script: script:
- export MYSQL_ROOT_PASSWORD=$${MYSQL_ROOT_PASSWORD} - export MYSQL_ROOT_PASSWORD=$${MYSQL_ROOT_PASSWORD}
- export MAIL=$${MAIL} - export MAIL_SERVICE=$${MAIL_SERVICE}
- export MAIL_USER=$${MAIL_USER}
- export COMMENTO_ORIGIN=$${COMMENTO_ORIGIN} - export COMMENTO_ORIGIN=$${COMMENTO_ORIGIN}
- export THEME=$${THEME} - export THEME=$${THEME}
- export THEME=$${THEME}
- export SCHEME=$${SCHEME} - export SCHEME=$${SCHEME}
- export DOMAIN=$${DOMAIN} - export DOMAIN=$${DOMAIN}
- export REGISTRY_DOMAIN=$${REGISTRY_DOMAIN} - export REGISTRY_DOMAIN=$${REGISTRY_DOMAIN}
@ -358,8 +361,10 @@ steps:
environment: environment:
COMMENTO_ORIGIN: COMMENTO_ORIGIN:
from_secret: commento-origin from_secret: commento-origin
MAIL: MAIL_SERVICE:
from_secret: mail from_secret: mail-service
MAIL_USER:
from_secret: mail-user
MYSQL_ROOT_PASSWORD: MYSQL_ROOT_PASSWORD:
from_secret: mysql-root-password from_secret: mysql-root-password
THEME: THEME:

View File

@ -1,6 +1,6 @@
{ {
"private": true, "private": true,
"dependencies": { "dependencies": {
"@sigyl/jsonnet-drone": "^1.0.0" "@sigyl/jsonnet-drone": "^0.4.5"
} }
} }

View File

@ -1 +1 @@
docker pull ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/my-ghost docker pull ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/my-ghost

View File

@ -1 +1 @@
docker push ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/my-ghost docker push ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/my-ghost

View File

@ -12,10 +12,10 @@
resolved "https://registry.yarnpkg.com/@sigyl/jsonnet-drone-environment/-/jsonnet-drone-environment-0.0.5.tgz#9ea85e08904777bd21a3e4b30b0b91461d0285ff" resolved "https://registry.yarnpkg.com/@sigyl/jsonnet-drone-environment/-/jsonnet-drone-environment-0.0.5.tgz#9ea85e08904777bd21a3e4b30b0b91461d0285ff"
integrity sha512-xVGmdMO1pOyozAWUbJm6mzKBgsLPJ+1hWnGCK3AxPkr7kkDh18hu30+TLzlcQtqq76s5jUfvJUztezsGj/mIcw== integrity sha512-xVGmdMO1pOyozAWUbJm6mzKBgsLPJ+1hWnGCK3AxPkr7kkDh18hu30+TLzlcQtqq76s5jUfvJUztezsGj/mIcw==
"@sigyl/jsonnet-drone@^1.0.0": "@sigyl/jsonnet-drone@^0.4.5":
version "1.0.0" version "0.4.5"
resolved "https://registry.yarnpkg.com/@sigyl/jsonnet-drone/-/jsonnet-drone-1.0.0.tgz#943bd8a1abc8a916026944816709f5ed1d8e7ef8" resolved "https://registry.yarnpkg.com/@sigyl/jsonnet-drone/-/jsonnet-drone-0.4.5.tgz#deb45b3fa837650d518b651044e993266c7386ac"
integrity sha512-ubyVC1/nAM584wTnnRBZTOP18z28Yy7SRApvSuo/3y2arngKlNI1FwOzKTFt/7L9+rNy19dRO/g0obEkyR3KmA== integrity sha512-s7/QHlT4YydwDPz/puR4iy7rcTl5vqR4YQmqlXCMA7VlcYPT4tC3GOb38njwZfNN4mxNa6oDKaM6eZEJX4SpiQ==
dependencies: dependencies:
"@sigyl/jsonnet-compose" "^0.0.2" "@sigyl/jsonnet-compose" "^0.0.2"
"@sigyl/jsonnet-drone-environment" "0.0.5" "@sigyl/jsonnet-drone-environment" "0.0.5"

View File

@ -16,11 +16,12 @@ services:
- ghost-content-data:/var/lib/ghost/content/data - ghost-content-data:/var/lib/ghost/content/data
- ghost-content-logs:/var/lib/ghost/content/logs - ghost-content-logs:/var/lib/ghost/content/logs
environment: environment:
- NODE_ENV=production
- DOMAIN=$DOMAIN - DOMAIN=$DOMAIN
- SCHEME=$SCHEME - SCHEME=$SCHEME
- MAIL-SERVICE=$MAIL-SERVICE
- MAIL-USER=$MAIL-USER
- MAIL-PASSWORD=$MAIL-PASSWORD
- COMMENTO_ORIGIN=$COMMENTO_ORIGIN - COMMENTO_ORIGIN=$COMMENTO_ORIGIN
- MAIL=$MAIL
- database__client=mysql - database__client=mysql
- database__connection__host=ghost-mysql - database__connection__host=ghost-mysql
- database__connection__user=root - database__connection__user=root

View File

@ -10,7 +10,7 @@ FROM ${REGISTRY}ghost:3.14.0
RUN apt-get update RUN apt-get update
RUN apt-get install -y gettext RUN apt-get install -y gettext
COPY config.production.json.template /var/lib/ghost/ COPY config.production.json /var/lib/ghost/
COPY --from=git /themes/ /var/lib/ghost/content/themes/ COPY --from=git /themes/ /var/lib/ghost/content/themes/
COPY post.hbs /hbs/ COPY post.hbs /hbs/
COPY run.sh / COPY run.sh /

View File

@ -1,24 +0,0 @@
{
"url": "${SCHEME}://${DOMAIN}/",
"server": {
"port": 2368,
"host": "0.0.0.0"
},
"database": {
"client": "sqlite3",
"connection": {
"filename": "/var/lib/ghost/content/data/ghost.db"
}
},
"mail": ${MAIL},
"logging": {
"transports": [
"file",
"stdout"
]
},
"process": "systemd",
"paths": {
"contentPath": "/var/lib/ghost/content"
}
}

View File

@ -1,3 +1,3 @@
envsubst < /var/lib/ghost/config.production.json.template > /var/lib/ghost/config.production.json envsubst < /var/lib/ghost/config.production.json > __tmp && mv __tmp /var/lib/ghost/config.production.json
envsubst < /hbs/post.hbs > /var/lib/ghost/content/themes/casper/post.hbs envsubst < /hbs/post.hbs > /var/lib/ghost/content/themes/casper/post.hbs
node "current/index.js" node "current/index.js"