2020-08-28 15:23:47 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: register
|
|
|
|
|
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: amd64
|
|
|
|
|
|
|
|
clone:
|
|
|
|
disable: true
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
exclude:
|
|
|
|
- promote
|
|
|
|
|
2020-08-13 18:36:40 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
2020-08-19 21:00:32 +00:00
|
|
|
name: deploy
|
2020-08-13 18:36:40 +00:00
|
|
|
|
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: amd64
|
|
|
|
|
|
|
|
steps:
|
2020-09-22 13:43:14 +00:00
|
|
|
- name: print env1
|
2020-08-28 15:23:47 +00:00
|
|
|
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
|
2020-08-13 18:36:40 +00:00
|
|
|
settings:
|
|
|
|
envs:
|
|
|
|
- drone_tag
|
|
|
|
- drone_commit
|
2020-09-22 13:44:39 +00:00
|
|
|
- dronsigyle_build_number
|
2020-08-13 18:36:40 +00:00
|
|
|
- drone_repo_name
|
|
|
|
- drone_repo_namespace
|
|
|
|
- gitea_mailer_host
|
|
|
|
- gitea_mailer_from
|
|
|
|
- gitea_mailer_user
|
|
|
|
- gitea_app_name
|
2020-08-19 21:00:32 +00:00
|
|
|
- gitea_server_lfs_jwt_secret
|
|
|
|
- gitea_security_secret_key
|
|
|
|
- gitea_security_internal_token
|
|
|
|
- gitea_oauth2_jwt_secret
|
|
|
|
- gitea_mailer_passwd
|
2020-08-13 18:36:40 +00:00
|
|
|
script:
|
|
|
|
- rm -f env-gitea
|
2020-09-22 13:21:12 +00:00
|
|
|
- echo $${DOMAIN}
|
2020-08-13 18:36:40 +00:00
|
|
|
- "echo \"export GITEA_MAILER_HOST='$${GITEA_MAILER_HOST}'\" >> env-gitea # \"gitea-mailer-host\""
|
|
|
|
- "echo \"export GITEA_MAILER_FROM='$${GITEA_MAILER_FROM}'\" >> env-gitea # \"gitea-mailer-from\""
|
|
|
|
- "echo \"export GITEA_MAILER_USER='$${GITEA_MAILER_USER}'\" >> env-gitea # \"gitea-mailer-user\""
|
|
|
|
- "echo \"export GITEA_APP_NAME='$${GITEA_APP_NAME}'\" >> env-gitea # \"gitea-app-name\""
|
2020-08-19 21:00:32 +00:00
|
|
|
- "echo \"export GITEA_SERVER_LFS_JWT_SECRET='$${GITEA_SERVER_LFS_JWT_SECRET}'\" >> env-gitea # \"gitea-server-lfs-jwt-secret\""
|
|
|
|
- "echo \"export GITEA_SECURITY_SECRET_KEY='$${GITEA_SECURITY_SECRET_KEY}'\" >> env-gitea # \"gitea-security-secret-key\""
|
|
|
|
- "echo \"export GITEA_SECURITY_INTERNAL_TOKEN='$${GITEA_SECURITY_INTERNAL_TOKEN}'\" >> env-gitea # \"gitea-security-internal-token\""
|
|
|
|
- "echo \"export GITEA_OAUTH2_JWT_SECRET='$${GITEA_OAUTH2_JWT_SECRET}'\" >> env-gitea # \"gitea-oauth2-jwt-secret\""
|
|
|
|
- "echo \"export GITEA_MAILER_PASSWD='$${GITEA_MAILER_PASSWD}'\" >> env-gitea # \"gitea-mailer-passwd\""
|
2020-09-22 13:44:39 +00:00
|
|
|
username: giles
|
2020-09-22 13:47:23 +00:00
|
|
|
port: 2022
|
|
|
|
host: git.target-domain
|
2020-08-13 18:36:40 +00:00
|
|
|
environment:
|
|
|
|
GITEA_APP_NAME:
|
|
|
|
from_secret: gitea-app-name
|
|
|
|
GITEA_MAILER_FROM:
|
|
|
|
from_secret: gitea-mailer-from
|
|
|
|
GITEA_MAILER_HOST:
|
|
|
|
from_secret: gitea-mailer-host
|
2020-08-19 21:00:32 +00:00
|
|
|
GITEA_MAILER_PASSWD:
|
|
|
|
from_secret: gitea-mailer-passwd
|
2020-08-13 18:36:40 +00:00
|
|
|
GITEA_MAILER_USER:
|
|
|
|
from_secret: gitea-mailer-user
|
2020-08-19 21:00:32 +00:00
|
|
|
GITEA_OAUTH2_JWT_SECRET:
|
|
|
|
from_secret: gitea-oauth2-jwt-secret
|
|
|
|
GITEA_SECURITY_INTERNAL_TOKEN:
|
|
|
|
from_secret: gitea-security-internal-token
|
|
|
|
GITEA_SECURITY_SECRET_KEY:
|
|
|
|
from_secret: gitea-security-secret-key
|
|
|
|
GITEA_SERVER_LFS_JWT_SECRET:
|
|
|
|
from_secret: gitea-server-lfs-jwt-secret
|
2020-08-13 18:36:40 +00:00
|
|
|
|
|
|
|
- name: scp
|
2020-08-28 15:23:47 +00:00
|
|
|
image: appleboy/drone-scp:1.6.2@sha256:bd37a55f4b97e7742b0de7333669b96220b3cc422d366e1fa8c34059b736ab47
|
2020-08-13 18:36:40 +00:00
|
|
|
settings:
|
|
|
|
command_timeout: 2m
|
|
|
|
source:
|
|
|
|
- .
|
|
|
|
target: /stack/gitea
|
|
|
|
|
|
|
|
- name: wait
|
2020-08-28 15:23:47 +00:00
|
|
|
image: alpine:3.12.0@sha256:90baa0922fe90624b05cb5766fa5da4e337921656c2f8e2b13bd3c052a0baac1
|
2020-08-13 18:36:40 +00:00
|
|
|
commands:
|
|
|
|
- sleep 15
|
|
|
|
|
2020-08-19 21:00:32 +00:00
|
|
|
- name: "dockerbuild:"
|
2020-08-28 15:23:47 +00:00
|
|
|
image: docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f
|
2020-08-19 21:00:32 +00:00
|
|
|
commands:
|
|
|
|
- set -e
|
|
|
|
- sh .drone/login.sh
|
|
|
|
- sh .drone/build.sh
|
|
|
|
- sh .drone/push.sh
|
|
|
|
- sh .drone/logout.sh
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run
|
|
|
|
|
|
|
|
- name: deploy
|
2020-08-28 15:23:47 +00:00
|
|
|
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
|
2020-08-13 18:36:40 +00:00
|
|
|
settings:
|
|
|
|
envs:
|
|
|
|
- drone_tag
|
|
|
|
- drone_commit
|
|
|
|
- drone_build_number
|
|
|
|
- drone_repo_name
|
|
|
|
- drone_repo_namespace
|
2020-08-28 15:23:47 +00:00
|
|
|
- domain
|
|
|
|
- registry_domain
|
|
|
|
- registry_port
|
|
|
|
- registry_password
|
2020-08-13 18:36:40 +00:00
|
|
|
- gitea_mailer_host
|
|
|
|
- gitea_mailer_from
|
|
|
|
- gitea_mailer_user
|
|
|
|
- gitea_app_name
|
|
|
|
- gitea_server_lfs_jwt_secret
|
|
|
|
- gitea_security_secret_key
|
|
|
|
- gitea_security_internal_token
|
|
|
|
- gitea_oauth2_jwt_secret
|
|
|
|
- gitea_mailer_passwd
|
|
|
|
script:
|
|
|
|
- export GITEA_SERVER_LFS_JWT_SECRET=$${GITEA_SERVER_LFS_JWT_SECRET}
|
|
|
|
- export GITEA_SECURITY_SECRET_KEY=$${GITEA_SECURITY_SECRET_KEY}
|
|
|
|
- export GITEA_SECURITY_INTERNAL_TOKEN=$${GITEA_SECURITY_INTERNAL_TOKEN}
|
|
|
|
- export GITEA_OAUTH2_JWT_SECRET=$${GITEA_OAUTH2_JWT_SECRET}
|
|
|
|
- export GITEA_MAILER_PASSWD=$${GITEA_MAILER_PASSWD}
|
|
|
|
- export GITEA_MAILER_HOST=$${GITEA_MAILER_HOST}
|
|
|
|
- export GITEA_MAILER_FROM=$${GITEA_MAILER_FROM}
|
|
|
|
- export GITEA_MAILER_USER=$${GITEA_MAILER_USER}
|
|
|
|
- export GITEA_APP_NAME=$${GITEA_APP_NAME}
|
2020-08-28 15:23:47 +00:00
|
|
|
- export DOMAIN=$${DOMAIN}
|
|
|
|
- export REGISTRY_DOMAIN=$${REGISTRY_DOMAIN}
|
|
|
|
- export REGISTRY_PORT=$${REGISTRY_PORT}
|
2020-08-21 07:11:30 +00:00
|
|
|
- export REGISTRY_PASSWORD=$${REGISTRY_PASSWORD}
|
2020-08-13 18:36:40 +00:00
|
|
|
- set -e
|
|
|
|
- cd /stack/gitea
|
2020-08-19 21:00:32 +00:00
|
|
|
- sh .drone/login.sh
|
|
|
|
- sh .drone/pull.sh
|
|
|
|
- sh .drone/deploy.sh
|
2020-08-13 18:36:40 +00:00
|
|
|
environment:
|
|
|
|
GITEA_APP_NAME:
|
|
|
|
from_secret: gitea-app-name
|
|
|
|
GITEA_MAILER_FROM:
|
|
|
|
from_secret: gitea-mailer-from
|
|
|
|
GITEA_MAILER_HOST:
|
|
|
|
from_secret: gitea-mailer-host
|
|
|
|
GITEA_MAILER_PASSWD:
|
|
|
|
from_secret: gitea-mailer-passwd
|
|
|
|
GITEA_MAILER_USER:
|
|
|
|
from_secret: gitea-mailer-user
|
|
|
|
GITEA_OAUTH2_JWT_SECRET:
|
|
|
|
from_secret: gitea-oauth2-jwt-secret
|
|
|
|
GITEA_SECURITY_INTERNAL_TOKEN:
|
|
|
|
from_secret: gitea-security-internal-token
|
|
|
|
GITEA_SECURITY_SECRET_KEY:
|
|
|
|
from_secret: gitea-security-secret-key
|
|
|
|
GITEA_SERVER_LFS_JWT_SECRET:
|
|
|
|
from_secret: gitea-server-lfs-jwt-secret
|
|
|
|
|
|
|
|
services:
|
|
|
|
- name: docker
|
2020-08-28 15:23:47 +00:00
|
|
|
image: docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f
|
2020-08-13 18:36:40 +00:00
|
|
|
privileged: true
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run
|
|
|
|
- name: ca
|
|
|
|
path: /etc/docker/certs.d
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
temp: {}
|
|
|
|
- name: ca
|
|
|
|
host:
|
|
|
|
path: /etc/docker/certs.d
|
|
|
|
|
2020-08-28 15:23:47 +00:00
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- promote
|
|
|
|
target:
|
|
|
|
- production
|
|
|
|
|
2020-08-13 18:36:40 +00:00
|
|
|
...
|