Compare commits
43 Commits
Author | SHA1 | Date |
---|---|---|
Giles Bradshaw | 823abc8289 | |
Giles Bradshaw | 613c03b193 | |
Giles Bradshaw | c9d91569db | |
Giles Bradshaw | 660a573678 | |
Giles Bradshaw | f369c07b17 | |
Giles Bradshaw | 7a39cefc00 | |
Giles Bradshaw | 2b8825cf86 | |
Giles Bradshaw | 1cbfd70b3e | |
Giles Bradshaw | 7168b57c05 | |
Giles Bradshaw | aa2c4d3233 | |
Giles Bradshaw | 8eb8efc14e | |
Giles Bradshaw | cc824b438e | |
Giles Bradshaw | a18c423a5b | |
Giles Bradshaw | a4ea555cf2 | |
Giles Bradshaw | 917dcf8be3 | |
Giles Bradshaw | fc80a55d38 | |
Giles Bradshaw | 2b0c16a963 | |
Giles Bradshaw | e80329d17e | |
Giles Bradshaw | 4a1760b858 | |
Giles Bradshaw | 1893d59dd8 | |
Giles Bradshaw | cbcc794d19 | |
Giles Bradshaw | c3a63307b8 | |
Giles Bradshaw | e43dc9e43a | |
Giles Bradshaw | fbfd7a0a51 | |
Giles Bradshaw | 9e908bab59 | |
Giles Bradshaw | ae2f946c4a | |
Giles Bradshaw | 0ab3b5fe8c | |
Giles Bradshaw | f4f84dbef0 | |
Giles Bradshaw | 5dc23e2ff4 | |
Giles Bradshaw | 9cecf4228b | |
Giles Bradshaw | dbfb050e8c | |
Giles Bradshaw | d2be2b84ab | |
Giles Bradshaw | fd2b0a69b7 | |
Giles Bradshaw | 20d63e3b86 | |
Giles Bradshaw | be8b531e5d | |
Giles Bradshaw | b67829dde9 | |
Giles Bradshaw | 71736fa726 | |
Giles Bradshaw | 9a5dfad5a5 | |
Giles Bradshaw | f60d5b35ce | |
Giles Bradshaw | 9a559a9fd6 | |
Giles Bradshaw | 7ee2accafb | |
Giles Bradshaw | e0ef961fda | |
Giles Bradshaw | a85cf890f1 |
|
@ -42,15 +42,11 @@ steps:
|
|||
- drone_gitea_server
|
||||
- drone_server_host
|
||||
- ssh_host
|
||||
- ssh_user
|
||||
- ssh_username
|
||||
- ssh_port
|
||||
- drone_gitea_client_secret
|
||||
- drone_rpc_secret
|
||||
- ssh_key
|
||||
host: ${SSH_HOST}
|
||||
key: ${SSH_KEY}
|
||||
passphrase: ${SSH_PASSPHRASE}
|
||||
port: ${SSH_PORT}
|
||||
script:
|
||||
- rm -f env-drone
|
||||
- "echo \"export REGISTRY_DOMAIN='$${REGISTRY_DOMAIN}'\" >> env-drone # \"registry-domain\""
|
||||
|
@ -61,12 +57,11 @@ steps:
|
|||
- "echo \"export DRONE_GITEA_SERVER='$${DRONE_GITEA_SERVER}'\" >> env-drone # \"drone-gitea-server\""
|
||||
- "echo \"export DRONE_SERVER_HOST='$${DRONE_SERVER_HOST}'\" >> env-drone # \"drone-server-host\""
|
||||
- "echo \"export SSH_HOST='$${SSH_HOST}'\" >> env-drone # \"ssh-host\""
|
||||
- "echo \"export SSH_USER='$${SSH_USER}'\" >> env-drone # \"ssh-user\""
|
||||
- "echo \"export SSH_USERNAME='$${SSH_USERNAME}'\" >> env-drone # \"ssh-username\""
|
||||
- "echo \"export SSH_PORT='$${SSH_PORT}'\" >> env-drone # \"ssh-port\""
|
||||
- "echo \"export DRONE_GITEA_CLIENT_SECRET='$${DRONE_GITEA_CLIENT_SECRET}'\" >> env-drone # \"drone-gitea-client-secret\""
|
||||
- "echo \"export DRONE_RPC_SECRET='$${DRONE_RPC_SECRET}'\" >> env-drone # \"drone-rpc-secret\""
|
||||
- "echo \"export SSH_KEY='$${SSH_KEY}'\" >> env-drone # \"ssh-key\""
|
||||
username: ${SSH_USER}
|
||||
environment:
|
||||
DOMAIN:
|
||||
from_secret: domain
|
||||
|
@ -92,21 +87,16 @@ steps:
|
|||
from_secret: ssh-key
|
||||
SSH_PORT:
|
||||
from_secret: ssh-port
|
||||
SSH_USER:
|
||||
from_secret: ssh-user
|
||||
SSH_USERNAME:
|
||||
from_secret: ssh-username
|
||||
|
||||
- name: scp
|
||||
image: appleboy/drone-scp:1.6.2@sha256:bd37a55f4b97e7742b0de7333669b96220b3cc422d366e1fa8c34059b736ab47
|
||||
settings:
|
||||
command_timeout: 2m
|
||||
host: ${SSH_HOST}
|
||||
key: ${SSH_KEY}
|
||||
passphrase: ${SSH_PASSPHRASE}
|
||||
port: ${SSH_PORT}
|
||||
source:
|
||||
- .
|
||||
target: /stack/drone
|
||||
username: ${SSH_USER}
|
||||
|
||||
- name: wait
|
||||
image: alpine:3.12.0@sha256:90baa0922fe90624b05cb5766fa5da4e337921656c2f8e2b13bd3c052a0baac1
|
||||
|
@ -146,7 +136,7 @@ steps:
|
|||
- drone_gitea_server
|
||||
- drone_server_host
|
||||
- ssh_host
|
||||
- ssh_user
|
||||
- ssh_username
|
||||
- ssh_port
|
||||
- drone_gitea_client_secret
|
||||
- drone_rpc_secret
|
||||
|
@ -154,10 +144,6 @@ steps:
|
|||
- registry_domain
|
||||
- registry_port
|
||||
- registry_password
|
||||
host: ${SSH_HOST}
|
||||
key: ${SSH_KEY}
|
||||
passphrase: ${SSH_PASSPHRASE}
|
||||
port: ${SSH_PORT}
|
||||
script:
|
||||
- export DRONE_GITEA_CLIENT_SECRET=$${DRONE_GITEA_CLIENT_SECRET}
|
||||
- export DRONE_RPC_SECRET=$${DRONE_RPC_SECRET}
|
||||
|
@ -167,7 +153,7 @@ steps:
|
|||
- export DRONE_GITEA_SERVER=$${DRONE_GITEA_SERVER}
|
||||
- export DRONE_SERVER_HOST=$${DRONE_SERVER_HOST}
|
||||
- export SSH_HOST=$${SSH_HOST}
|
||||
- export SSH_USER=$${SSH_USER}
|
||||
- export SSH_USERNAME=$${SSH_USERNAME}
|
||||
- export SSH_PORT=$${SSH_PORT}
|
||||
- export REGISTRY_DOMAIN=$${REGISTRY_DOMAIN}
|
||||
- export REGISTRY_PORT=$${REGISTRY_PORT}
|
||||
|
@ -177,7 +163,6 @@ steps:
|
|||
- sh .drone/login.sh
|
||||
- sh .drone/pull.sh
|
||||
- sh .drone/deploy.sh
|
||||
username: ${SSH_USER}
|
||||
environment:
|
||||
DOMAIN:
|
||||
from_secret: domain
|
||||
|
@ -203,8 +188,8 @@ steps:
|
|||
from_secret: ssh-key
|
||||
SSH_PORT:
|
||||
from_secret: ssh-port
|
||||
SSH_USER:
|
||||
from_secret: ssh-user
|
||||
SSH_USERNAME:
|
||||
from_secret: ssh-username
|
||||
|
||||
services:
|
||||
- name: docker
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
local secretSecrets = import 'lib/secret-secrets.libsonnet';
|
||||
local publicSecrets = import 'lib/public-secrets.libsonnet';
|
||||
|
||||
local deploy = import 'node_modules/@sigyl/jsonnet-drone/deploy.libsonnet';
|
||||
local register = import 'node_modules/@sigyl/jsonnet-drone/register.libsonnet';
|
||||
[
|
||||
register,
|
||||
deploy(
|
||||
'drone',
|
||||
'/stack/',
|
||||
[
|
||||
'REGISTRY_DOMAIN',
|
||||
'REGISTRY_PORT',
|
||||
'REGISTRY_PASSWORD',
|
||||
],
|
||||
publicSecrets,
|
||||
secretSecrets,
|
||||
[],
|
||||
),
|
||||
]
|
|
@ -0,0 +1,211 @@
|
|||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: register
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
clone:
|
||||
disable: true
|
||||
|
||||
trigger:
|
||||
event:
|
||||
exclude:
|
||||
- promote
|
||||
|
||||
---
|
||||
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
|
||||
- registry_domain
|
||||
- registry_port
|
||||
- registry_password
|
||||
- domain
|
||||
- drone_gitea_client_id
|
||||
- drone_gitea_server
|
||||
- drone_server_host
|
||||
- ssh_host
|
||||
- ssh_username
|
||||
- ssh_port
|
||||
- drone_gitea_client_secret
|
||||
- drone_rpc_secret
|
||||
- ssh_key
|
||||
script:
|
||||
- rm -f env-drone
|
||||
- "echo \"export REGISTRY_DOMAIN='$${REGISTRY_DOMAIN}'\" >> env-drone # \"registry-domain\""
|
||||
- "echo \"export REGISTRY_PORT='$${REGISTRY_PORT}'\" >> env-drone # \"registry-port\""
|
||||
- "echo \"export REGISTRY_PASSWORD='$${REGISTRY_PASSWORD}'\" >> env-drone # \"registry-password\""
|
||||
- "echo \"export DOMAIN='$${DOMAIN}'\" >> env-drone # \"domain\""
|
||||
- "echo \"export DRONE_GITEA_CLIENT_ID='$${DRONE_GITEA_CLIENT_ID}'\" >> env-drone # \"drone-gitea-client-id\""
|
||||
- "echo \"export DRONE_GITEA_SERVER='$${DRONE_GITEA_SERVER}'\" >> env-drone # \"drone-gitea-server\""
|
||||
- "echo \"export DRONE_SERVER_HOST='$${DRONE_SERVER_HOST}'\" >> env-drone # \"drone-server-host\""
|
||||
- "echo \"export SSH_HOST='$${SSH_HOST}'\" >> env-drone # \"ssh-host\""
|
||||
- "echo \"export SSH_USERNAME='$${SSH_USERNAME}'\" >> env-drone # \"ssh-username\""
|
||||
- "echo \"export SSH_PORT='$${SSH_PORT}'\" >> env-drone # \"ssh-port\""
|
||||
- "echo \"export DRONE_GITEA_CLIENT_SECRET='$${DRONE_GITEA_CLIENT_SECRET}'\" >> env-drone # \"drone-gitea-client-secret\""
|
||||
- "echo \"export DRONE_RPC_SECRET='$${DRONE_RPC_SECRET}'\" >> env-drone # \"drone-rpc-secret\""
|
||||
- "echo \"export SSH_KEY='$${SSH_KEY}'\" >> env-drone # \"ssh-key\""
|
||||
environment:
|
||||
DOMAIN:
|
||||
from_secret: domain
|
||||
DRONE_GITEA_CLIENT_ID:
|
||||
from_secret: drone-gitea-client-id
|
||||
DRONE_GITEA_CLIENT_SECRET:
|
||||
from_secret: drone-gitea-client-secret
|
||||
DRONE_GITEA_SERVER:
|
||||
from_secret: drone-gitea-server
|
||||
DRONE_RPC_SECRET:
|
||||
from_secret: drone-rpc-secret
|
||||
DRONE_SERVER_HOST:
|
||||
from_secret: drone-server-host
|
||||
REGISTRY_DOMAIN:
|
||||
from_secret: registry-domain
|
||||
REGISTRY_PASSWORD:
|
||||
from_secret: registry-password
|
||||
REGISTRY_PORT:
|
||||
from_secret: registry-port
|
||||
SSH_HOST:
|
||||
from_secret: ssh-host
|
||||
SSH_KEY:
|
||||
from_secret: ssh-key
|
||||
SSH_PORT:
|
||||
from_secret: ssh-port
|
||||
SSH_USERNAME:
|
||||
from_secret: ssh-username
|
||||
|
||||
- name: scp
|
||||
image: appleboy/drone-scp:1.6.2@sha256:bd37a55f4b97e7742b0de7333669b96220b3cc422d366e1fa8c34059b736ab47
|
||||
settings:
|
||||
command_timeout: 2m
|
||||
source:
|
||||
- .
|
||||
target: /stack/drone
|
||||
|
||||
- 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
|
||||
environment:
|
||||
REGISTRY_DOMAIN:
|
||||
from_secret: registry-domain
|
||||
REGISTRY_PASSWORD:
|
||||
from_secret: registry-password
|
||||
REGISTRY_PORT:
|
||||
from_secret: registry-port
|
||||
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
|
||||
- domain
|
||||
- drone_gitea_client_id
|
||||
- drone_gitea_server
|
||||
- drone_server_host
|
||||
- ssh_host
|
||||
- ssh_username
|
||||
- ssh_port
|
||||
- drone_gitea_client_secret
|
||||
- drone_rpc_secret
|
||||
- ssh_key
|
||||
- registry_domain
|
||||
- registry_port
|
||||
- registry_password
|
||||
script:
|
||||
- export DRONE_GITEA_CLIENT_SECRET=$${DRONE_GITEA_CLIENT_SECRET}
|
||||
- export DRONE_RPC_SECRET=$${DRONE_RPC_SECRET}
|
||||
- export SSH_KEY=$${SSH_KEY}
|
||||
- export DOMAIN=$${DOMAIN}
|
||||
- export DRONE_GITEA_CLIENT_ID=$${DRONE_GITEA_CLIENT_ID}
|
||||
- export DRONE_GITEA_SERVER=$${DRONE_GITEA_SERVER}
|
||||
- export DRONE_SERVER_HOST=$${DRONE_SERVER_HOST}
|
||||
- export SSH_HOST=$${SSH_HOST}
|
||||
- export SSH_USERNAME=$${SSH_USERNAME}
|
||||
- export SSH_PORT=$${SSH_PORT}
|
||||
- export REGISTRY_DOMAIN=$${REGISTRY_DOMAIN}
|
||||
- export REGISTRY_PORT=$${REGISTRY_PORT}
|
||||
- export REGISTRY_PASSWORD=$${REGISTRY_PASSWORD}
|
||||
- set -e
|
||||
- cd /stack/drone
|
||||
- sh .drone/login.sh
|
||||
- sh .drone/pull.sh
|
||||
- sh .drone/deploy.sh
|
||||
environment:
|
||||
DOMAIN:
|
||||
from_secret: domain
|
||||
DRONE_GITEA_CLIENT_ID:
|
||||
from_secret: drone-gitea-client-id
|
||||
DRONE_GITEA_CLIENT_SECRET:
|
||||
from_secret: drone-gitea-client-secret
|
||||
DRONE_GITEA_SERVER:
|
||||
from_secret: drone-gitea-server
|
||||
DRONE_RPC_SECRET:
|
||||
from_secret: drone-rpc-secret
|
||||
DRONE_SERVER_HOST:
|
||||
from_secret: drone-server-host
|
||||
REGISTRY_DOMAIN:
|
||||
from_secret: registry-domain
|
||||
REGISTRY_PASSWORD:
|
||||
from_secret: registry-password
|
||||
REGISTRY_PORT:
|
||||
from_secret: registry-port
|
||||
SSH_HOST:
|
||||
from_secret: ssh-host
|
||||
SSH_KEY:
|
||||
from_secret: ssh-key
|
||||
SSH_PORT:
|
||||
from_secret: ssh-port
|
||||
SSH_USERNAME:
|
||||
from_secret: ssh-username
|
||||
|
||||
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
|
||||
|
||||
volumes:
|
||||
- name: dockersock
|
||||
temp: {}
|
||||
- name: ca
|
||||
host:
|
||||
path: /etc/docker/certs.d
|
||||
|
||||
...
|
|
@ -4,6 +4,6 @@
|
|||
'drone-gitea-server',
|
||||
'drone-server-host',
|
||||
'ssh-host',
|
||||
'ssh-user',
|
||||
'ssh-username',
|
||||
'ssh-port'
|
||||
]
|
||||
|
|
|
@ -46,7 +46,7 @@ services:
|
|||
- DRONE_RPC_SECRET=${DRONE_RPC_SECRET}
|
||||
- DRONE_RUNNER_CAPACITY=8
|
||||
- DRONE_RUNNER_NAME="docker-runner"
|
||||
- DRONE_RUNNER_ENVIRON=DOMAIN:$DOMAIN,REGISTRY_DOMAIN:$REGISTRY_DOMAIN,REGISTRY_PORT:$REGISTRY_PORT,REGISTRY_PASSWORD:$REGISTRY_PASSWORD,SSH_HOST:$SSH_HOST,SSH_PORT:$SSH_PORT,SSH_USER:$SSH_USER,SSH_KEY:$SSH_KEY
|
||||
- DRONE_RUNNER_ENVIRON=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
|
||||
networks:
|
||||
- appnet
|
||||
volumes:
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
drone jsonnet --source .drone/$1.jsonnet --target .drone/$1.yml --stream \
|
||||
&& git add .drone/$1.yml \
|
||||
&& echo .drone/$1.yml \
|
|
@ -1,3 +1,3 @@
|
|||
drone jsonnet --source .drone/drone-home.jsonnet --target .drone/drone-home.yml --stream \
|
||||
&& git add .drone/drone-home.yml \
|
||||
sh git-hooks/build.sh drone \
|
||||
&& sh git-hooks/build.sh drone-home \
|
||||
&& echo "jsonnet built"
|
Loading…
Reference in New Issue