2020-08-26 23:45:17 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: register
|
|
|
|
|
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: amd64
|
|
|
|
|
|
|
|
clone:
|
|
|
|
disable: true
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
exclude:
|
|
|
|
- promote
|
|
|
|
|
2020-09-24 13:08:36 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: registry
|
|
|
|
|
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: amd64
|
|
|
|
|
2020-10-23 09:24:14 +00:00
|
|
|
clone:
|
|
|
|
disable: true
|
|
|
|
|
2020-09-24 13:08:36 +00:00
|
|
|
steps:
|
2020-10-23 09:24:14 +00:00
|
|
|
- name: drone/drone:1.9.1
|
|
|
|
image: docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f
|
|
|
|
commands:
|
|
|
|
- set -e
|
|
|
|
- "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 pull drone/drone:1.9.1@sha256:f07d1719b75a404c142b95b47598d7658805359d2416e8f36ddfc0385120e9a6 \\\\\n && docker tag drone/drone:1.9.1@sha256:f07d1719b75a404c142b95b47598d7658805359d2416e8f36ddfc0385120e9a6 $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/drone/drone/drone:1.9.1 \\\\\n && docker push $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/drone/drone/drone:1.9.1 && break\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"initialise failed\"\n exit 1\n fi\n echo \"retrying..$n\"\n sleep 5\ndone\n"
|
|
|
|
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: drone/drone-runner-docker:1.5.3
|
2020-09-24 13:08:36 +00:00
|
|
|
image: docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f
|
|
|
|
commands:
|
|
|
|
- set -e
|
2020-10-23 09:24:14 +00:00
|
|
|
- "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 pull drone/drone-runner-docker:1.5.3@sha256:8554bbb53c482324f544091ec9b6e855e8581cb27cb9fbfb2c38fd4574dfcd8e \\\\\n && docker tag drone/drone-runner-docker:1.5.3@sha256:8554bbb53c482324f544091ec9b6e855e8581cb27cb9fbfb2c38fd4574dfcd8e $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/drone/drone/drone-runner-docker:1.5.3 \\\\\n && docker push $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/drone/drone/drone-runner-docker:1.5.3 && break\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"initialise failed\"\n exit 1\n fi\n echo \"retrying..$n\"\n sleep 5\ndone\n"
|
2020-09-24 13:08:36 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
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-23 09:10:47 +00:00
|
|
|
- name: daemonjson
|
|
|
|
path: /etc/docker/daemon.json
|
2020-09-24 13:08:36 +00:00
|
|
|
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
temp: {}
|
|
|
|
- name: ca
|
|
|
|
host:
|
|
|
|
path: /etc/docker/certs.d
|
2020-10-23 09:10:47 +00:00
|
|
|
- name: daemonjson
|
|
|
|
host:
|
|
|
|
path: /etc/docker/daemon.json
|
2020-09-24 13:08:36 +00:00
|
|
|
|
|
|
|
image_pull_secrets:
|
|
|
|
- dockerconfigjson
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- promote
|
|
|
|
target:
|
|
|
|
- registry
|
|
|
|
|
2020-08-26 23:14:17 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
2020-10-23 09:24:14 +00:00
|
|
|
name: save
|
2020-08-26 23:14:17 +00:00
|
|
|
|
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: amd64
|
|
|
|
|
2020-10-23 09:24:14 +00:00
|
|
|
clone:
|
|
|
|
disable: true
|
|
|
|
|
2020-08-26 23:14:17 +00:00
|
|
|
steps:
|
2020-10-23 09:24:14 +00:00
|
|
|
- name: mkdir
|
|
|
|
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
|
|
|
|
settings:
|
|
|
|
envs:
|
|
|
|
- drone_tag
|
|
|
|
- drone_commit
|
|
|
|
- drone_build_number
|
|
|
|
- drone_repo_name
|
|
|
|
- drone_repo_namespace
|
|
|
|
script:
|
|
|
|
- mkdir -p /stack/.images/drone/built
|
|
|
|
- rm -f /stack/.images/drone/*.*
|
|
|
|
- rm -f /stack/.images/drone/built/*.*
|
|
|
|
|
|
|
|
- name: drone/drone:1.9.1
|
2020-08-28 20:51:50 +00:00
|
|
|
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
|
2020-08-26 23:14:17 +00:00
|
|
|
settings:
|
|
|
|
envs:
|
|
|
|
- drone_tag
|
|
|
|
- drone_commit
|
|
|
|
- drone_build_number
|
|
|
|
- drone_repo_name
|
|
|
|
- drone_repo_namespace
|
2020-08-28 20:51:50 +00:00
|
|
|
- registry_domain
|
|
|
|
- registry_port
|
2020-08-26 23:14:17 +00:00
|
|
|
- registry_password
|
2020-10-24 08:54:57 +00:00
|
|
|
- destination_registry
|
2020-10-23 09:24:14 +00:00
|
|
|
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"
|
|
|
|
- docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/drone/drone/drone:1.9.1
|
|
|
|
- docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/drone/drone/drone:1.9.1 -o /stack/.images/drone/drone_drone:1.9.1.tar
|
2020-10-24 08:54:57 +00:00
|
|
|
- echo "docker load < drone_drone:1.9.1.tar" >> /stack/.images/drone/load.sh
|
2020-10-24 09:25:21 +00:00
|
|
|
- echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/drone/drone/drone:1.9.1 $${DESTINATION_REGISTRY}/stack/drone/drone/drone:1.9.1" >> /stack/.images/drone/load.sh
|
2020-10-23 09:24:14 +00:00
|
|
|
|
|
|
|
- name: drone/drone-runner-docker:1.5.3
|
|
|
|
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
|
2020-10-24 08:54:57 +00:00
|
|
|
- destination_registry
|
2020-10-23 09:24:14 +00:00
|
|
|
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"
|
|
|
|
- docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/drone/drone/drone-runner-docker:1.5.3
|
|
|
|
- docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/drone/drone/drone-runner-docker:1.5.3 -o /stack/.images/drone/drone_drone-runner-docker:1.5.3.tar
|
2020-10-24 08:54:57 +00:00
|
|
|
- echo "docker load < drone_drone-runner-docker:1.5.3.tar" >> /stack/.images/drone/load.sh
|
2020-10-24 09:25:21 +00:00
|
|
|
- echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/drone/drone/drone-runner-docker:1.5.3 $${DESTINATION_REGISTRY}/stack/drone/drone/drone-runner-docker:1.5.3" >> /stack/.images/drone/load.sh
|
2020-10-23 09:24:14 +00:00
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- promote
|
|
|
|
target:
|
|
|
|
- save
|
|
|
|
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: print
|
|
|
|
|
|
|
|
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-23 09:10:47 +00:00
|
|
|
- scheme
|
2020-08-28 20:51:50 +00:00
|
|
|
- domain
|
2020-10-23 16:23:02 +00:00
|
|
|
- registry_domain
|
|
|
|
- registry_port
|
2020-08-26 23:14:17 +00:00
|
|
|
- drone_gitea_client_id
|
|
|
|
- drone_gitea_server
|
|
|
|
- drone_server_host
|
2020-08-28 20:51:50 +00:00
|
|
|
- ssh_host
|
2020-09-22 11:41:05 +00:00
|
|
|
- ssh_username
|
2020-08-28 20:51:50 +00:00
|
|
|
- ssh_port
|
2020-08-26 23:14:17 +00:00
|
|
|
- drone_gitea_client_secret
|
|
|
|
- drone_rpc_secret
|
2020-08-28 20:51:50 +00:00
|
|
|
- ssh_key
|
2020-10-23 16:23:02 +00:00
|
|
|
- registry_password
|
2020-08-26 23:14:17 +00:00
|
|
|
script:
|
|
|
|
- rm -f env-drone
|
2020-10-23 09:10:47 +00:00
|
|
|
- "echo \"export SCHEME='$${SCHEME}'\" >> env-drone # \"scheme\""
|
2020-08-28 20:51:50 +00:00
|
|
|
- "echo \"export DOMAIN='$${DOMAIN}'\" >> env-drone # \"domain\""
|
2020-10-23 16:23:02 +00:00
|
|
|
- "echo \"export REGISTRY_DOMAIN='$${REGISTRY_DOMAIN}'\" >> env-drone # \"registry-domain\""
|
|
|
|
- "echo \"export REGISTRY_PORT='$${REGISTRY_PORT}'\" >> env-drone # \"registry-port\""
|
2020-08-26 23:14:17 +00:00
|
|
|
- "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\""
|
2020-08-28 20:51:50 +00:00
|
|
|
- "echo \"export SSH_HOST='$${SSH_HOST}'\" >> env-drone # \"ssh-host\""
|
2020-09-22 11:41:05 +00:00
|
|
|
- "echo \"export SSH_USERNAME='$${SSH_USERNAME}'\" >> env-drone # \"ssh-username\""
|
2020-08-28 20:51:50 +00:00
|
|
|
- "echo \"export SSH_PORT='$${SSH_PORT}'\" >> env-drone # \"ssh-port\""
|
2020-08-26 23:14:17 +00:00
|
|
|
- "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\""
|
2020-08-28 20:51:50 +00:00
|
|
|
- "echo \"export SSH_KEY='$${SSH_KEY}'\" >> env-drone # \"ssh-key\""
|
2020-10-23 16:23:02 +00:00
|
|
|
- "echo \"export REGISTRY_PASSWORD='$${REGISTRY_PASSWORD}'\" >> env-drone # \"registry-password\""
|
2020-08-26 23:14:17 +00:00
|
|
|
environment:
|
2020-08-28 20:51:50 +00:00
|
|
|
DOMAIN:
|
|
|
|
from_secret: domain
|
2020-08-26 23:14:17 +00:00
|
|
|
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
|
2020-10-23 16:23:02 +00:00
|
|
|
REGISTRY_DOMAIN:
|
|
|
|
from_secret: registry-domain
|
|
|
|
REGISTRY_PASSWORD:
|
|
|
|
from_secret: registry-password
|
|
|
|
REGISTRY_PORT:
|
|
|
|
from_secret: registry-port
|
2020-10-21 11:01:04 +00:00
|
|
|
SCHEME:
|
|
|
|
from_secret: scheme
|
2020-08-28 20:51:50 +00:00
|
|
|
SSH_HOST:
|
|
|
|
from_secret: ssh-host
|
|
|
|
SSH_KEY:
|
|
|
|
from_secret: ssh-key
|
|
|
|
SSH_PORT:
|
|
|
|
from_secret: ssh-port
|
2020-09-22 11:41:05 +00:00
|
|
|
SSH_USERNAME:
|
|
|
|
from_secret: ssh-username
|
2020-08-26 23:14:17 +00:00
|
|
|
|
2020-10-23 09:24:14 +00:00
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- promote
|
|
|
|
target:
|
|
|
|
- print
|
2020-08-26 23:14:17 +00:00
|
|
|
|
2020-10-23 09:24:14 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: build
|
2020-08-26 23:14:17 +00:00
|
|
|
|
2020-10-23 09:24:14 +00:00
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: amd64
|
|
|
|
|
|
|
|
steps:
|
2020-08-26 23:14:17 +00:00
|
|
|
- name: "dockerbuild:"
|
2020-08-28 20:51:50 +00:00
|
|
|
image: docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f
|
2020-08-26 23:14:17 +00:00
|
|
|
commands:
|
|
|
|
- set -e
|
2020-10-23 09:24:14 +00:00
|
|
|
- export NAME=drone
|
|
|
|
- export ROOT=stack
|
|
|
|
- "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"
|
2020-08-26 23:14:17 +00:00
|
|
|
- sh .drone/build.sh
|
|
|
|
- sh .drone/push.sh
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run
|
|
|
|
|
2020-10-23 09:24:14 +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
|
|
|
|
- name: daemonjson
|
|
|
|
path: /etc/docker/daemon.json
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
temp: {}
|
|
|
|
- name: ca
|
|
|
|
host:
|
|
|
|
path: /etc/docker/certs.d
|
|
|
|
- name: daemonjson
|
|
|
|
host:
|
|
|
|
path: /etc/docker/daemon.json
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- promote
|
|
|
|
target:
|
|
|
|
- build
|
|
|
|
|
2020-10-23 19:22:53 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: drone-images
|
|
|
|
|
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: amd64
|
|
|
|
|
|
|
|
clone:
|
|
|
|
disable: true
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: mkdir
|
|
|
|
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
|
|
|
|
settings:
|
|
|
|
envs:
|
|
|
|
- drone_tag
|
|
|
|
- drone_commit
|
|
|
|
- drone_build_number
|
|
|
|
- drone_repo_name
|
|
|
|
- drone_repo_namespace
|
|
|
|
script:
|
|
|
|
- mkdir -p /stack/.images/drone/drone-images
|
|
|
|
- rm -f /stack/.images/drone/drone-images/*.*
|
|
|
|
|
|
|
|
- name: docker
|
|
|
|
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
|
|
|
|
script:
|
|
|
|
- docker pull docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f
|
|
|
|
- docker save docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f -o /stack/.images/drone/drone-images/docker.tar
|
|
|
|
- echo "docker load docker.tar" >> /stack/.images/drone/drone-images/load.sh
|
|
|
|
|
|
|
|
- name: scp
|
|
|
|
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
|
|
|
|
script:
|
|
|
|
- docker pull appleboy/drone-scp:1.6.2@sha256:bd37a55f4b97e7742b0de7333669b96220b3cc422d366e1fa8c34059b736ab47
|
|
|
|
- docker save appleboy/drone-scp:1.6.2@sha256:bd37a55f4b97e7742b0de7333669b96220b3cc422d366e1fa8c34059b736ab47 -o /stack/.images/drone/drone-images/scp.tar
|
|
|
|
- echo "docker load scp.tar" >> /stack/.images/drone/drone-images/load.sh
|
|
|
|
|
|
|
|
- name: ssh
|
|
|
|
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
|
|
|
|
script:
|
|
|
|
- docker pull appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
|
|
|
|
- docker save appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea -o /stack/.images/drone/drone-images/ssh.tar
|
|
|
|
- echo "docker load ssh.tar" >> /stack/.images/drone/drone-images/load.sh
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- promote
|
|
|
|
target:
|
|
|
|
- drone-images
|
|
|
|
|
2020-10-23 09:24:14 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: deploy
|
|
|
|
|
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: amd64
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: scp
|
|
|
|
image: appleboy/drone-scp:1.6.2@sha256:bd37a55f4b97e7742b0de7333669b96220b3cc422d366e1fa8c34059b736ab47
|
|
|
|
settings:
|
|
|
|
command_timeout: 2m
|
|
|
|
source:
|
|
|
|
- .
|
|
|
|
target: /stack/drone
|
|
|
|
|
2020-08-26 23:14:17 +00:00
|
|
|
- name: deploy
|
2020-08-28 20:51:50 +00:00
|
|
|
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
|
2020-08-26 23:14:17 +00:00
|
|
|
settings:
|
|
|
|
envs:
|
|
|
|
- drone_tag
|
|
|
|
- drone_commit
|
|
|
|
- drone_build_number
|
|
|
|
- drone_repo_name
|
|
|
|
- drone_repo_namespace
|
2020-10-23 09:10:47 +00:00
|
|
|
- scheme
|
2020-08-28 20:51:50 +00:00
|
|
|
- domain
|
2020-10-23 16:23:02 +00:00
|
|
|
- registry_domain
|
|
|
|
- registry_port
|
2020-08-26 23:14:17 +00:00
|
|
|
- drone_gitea_client_id
|
|
|
|
- drone_gitea_server
|
|
|
|
- drone_server_host
|
2020-08-28 20:51:50 +00:00
|
|
|
- ssh_host
|
2020-09-22 11:41:05 +00:00
|
|
|
- ssh_username
|
2020-08-28 20:51:50 +00:00
|
|
|
- ssh_port
|
2020-08-26 23:14:17 +00:00
|
|
|
- drone_gitea_client_secret
|
|
|
|
- drone_rpc_secret
|
2020-08-28 20:51:50 +00:00
|
|
|
- ssh_key
|
2020-10-23 16:23:02 +00:00
|
|
|
- registry_password
|
2020-08-28 20:51:50 +00:00
|
|
|
- registry_domain
|
|
|
|
- registry_port
|
2020-08-26 23:14:17 +00:00
|
|
|
- registry_password
|
2020-10-21 11:01:04 +00:00
|
|
|
- scheme
|
2020-08-26 23:14:17 +00:00
|
|
|
script:
|
|
|
|
- export DRONE_GITEA_CLIENT_SECRET=$${DRONE_GITEA_CLIENT_SECRET}
|
|
|
|
- export DRONE_RPC_SECRET=$${DRONE_RPC_SECRET}
|
2020-08-28 20:51:50 +00:00
|
|
|
- export SSH_KEY=$${SSH_KEY}
|
2020-10-23 16:23:02 +00:00
|
|
|
- export REGISTRY_PASSWORD=$${REGISTRY_PASSWORD}
|
2020-10-23 09:10:47 +00:00
|
|
|
- export SCHEME=$${SCHEME}
|
2020-08-28 20:51:50 +00:00
|
|
|
- export DOMAIN=$${DOMAIN}
|
2020-10-23 16:23:02 +00:00
|
|
|
- export REGISTRY_DOMAIN=$${REGISTRY_DOMAIN}
|
|
|
|
- export REGISTRY_PORT=$${REGISTRY_PORT}
|
2020-08-26 23:14:17 +00:00
|
|
|
- export DRONE_GITEA_CLIENT_ID=$${DRONE_GITEA_CLIENT_ID}
|
|
|
|
- export DRONE_GITEA_SERVER=$${DRONE_GITEA_SERVER}
|
|
|
|
- export DRONE_SERVER_HOST=$${DRONE_SERVER_HOST}
|
2020-08-28 20:51:50 +00:00
|
|
|
- export SSH_HOST=$${SSH_HOST}
|
2020-09-22 11:41:05 +00:00
|
|
|
- export SSH_USERNAME=$${SSH_USERNAME}
|
2020-08-28 20:51:50 +00:00
|
|
|
- export SSH_PORT=$${SSH_PORT}
|
|
|
|
- export REGISTRY_DOMAIN=$${REGISTRY_DOMAIN}
|
|
|
|
- export REGISTRY_PORT=$${REGISTRY_PORT}
|
2020-08-26 23:14:17 +00:00
|
|
|
- export REGISTRY_PASSWORD=$${REGISTRY_PASSWORD}
|
2020-10-21 11:01:04 +00:00
|
|
|
- export SCHEME=$${SCHEME}
|
2020-08-26 23:14:17 +00:00
|
|
|
- set -e
|
2020-10-23 09:24:14 +00:00
|
|
|
- export NAME=drone
|
|
|
|
- export ROOT=stack
|
2020-08-26 23:14:17 +00:00
|
|
|
- cd /stack/drone
|
2020-10-23 09:24:14 +00:00
|
|
|
- "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"
|
2020-08-26 23:14:17 +00:00
|
|
|
- sh .drone/pull.sh
|
|
|
|
- sh .drone/deploy.sh
|
|
|
|
environment:
|
2020-08-28 20:51:50 +00:00
|
|
|
DOMAIN:
|
|
|
|
from_secret: domain
|
2020-08-26 23:14:17 +00:00
|
|
|
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
|
2020-08-28 20:51:50 +00:00
|
|
|
REGISTRY_DOMAIN:
|
|
|
|
from_secret: registry-domain
|
2020-08-26 23:14:17 +00:00
|
|
|
REGISTRY_PASSWORD:
|
|
|
|
from_secret: registry-password
|
2020-08-28 20:51:50 +00:00
|
|
|
REGISTRY_PORT:
|
|
|
|
from_secret: registry-port
|
2020-10-21 11:01:04 +00:00
|
|
|
SCHEME:
|
|
|
|
from_secret: scheme
|
2020-08-28 20:51:50 +00:00
|
|
|
SSH_HOST:
|
|
|
|
from_secret: ssh-host
|
|
|
|
SSH_KEY:
|
|
|
|
from_secret: ssh-key
|
|
|
|
SSH_PORT:
|
|
|
|
from_secret: ssh-port
|
2020-09-22 11:41:05 +00:00
|
|
|
SSH_USERNAME:
|
|
|
|
from_secret: ssh-username
|
2020-08-26 23:14:17 +00:00
|
|
|
|
2020-08-26 23:45:17 +00:00
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- promote
|
2020-10-23 09:24:14 +00:00
|
|
|
- promote
|
2020-08-26 23:45:17 +00:00
|
|
|
target:
|
2020-10-23 09:24:14 +00:00
|
|
|
- deploy
|
2020-08-26 23:45:17 +00:00
|
|
|
- production
|
|
|
|
|
2020-08-26 23:14:17 +00:00
|
|
|
...
|