|
|
@ -1,350 +1,449 @@
|
|
|
|
---
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
{
|
|
|
|
type: docker
|
|
|
|
"clone": {
|
|
|
|
name: register
|
|
|
|
"disable": true
|
|
|
|
|
|
|
|
},
|
|
|
|
platform:
|
|
|
|
"kind": "pipeline",
|
|
|
|
os: linux
|
|
|
|
"name": "register",
|
|
|
|
arch: amd64
|
|
|
|
"trigger": {
|
|
|
|
|
|
|
|
"event": {
|
|
|
|
clone:
|
|
|
|
"exclude": [
|
|
|
|
disable: true
|
|
|
|
"promote"
|
|
|
|
|
|
|
|
]
|
|
|
|
trigger:
|
|
|
|
}
|
|
|
|
event:
|
|
|
|
},
|
|
|
|
exclude:
|
|
|
|
"type": "docker"
|
|
|
|
- promote
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
{
|
|
|
|
type: docker
|
|
|
|
"clone": {
|
|
|
|
name: registry
|
|
|
|
"disable": true
|
|
|
|
|
|
|
|
},
|
|
|
|
platform:
|
|
|
|
"image_pull_secrets": [
|
|
|
|
os: linux
|
|
|
|
"dockerconfigjson"
|
|
|
|
arch: amd64
|
|
|
|
],
|
|
|
|
|
|
|
|
"kind": "pipeline",
|
|
|
|
clone:
|
|
|
|
"name": "registry",
|
|
|
|
disable: true
|
|
|
|
"services": [
|
|
|
|
|
|
|
|
{
|
|
|
|
steps:
|
|
|
|
"image": "docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f",
|
|
|
|
- name: gitea/gitea:1.12.3-linux-amd64
|
|
|
|
"name": "docker",
|
|
|
|
image: docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f
|
|
|
|
"privileged": true,
|
|
|
|
commands:
|
|
|
|
"volumes": [
|
|
|
|
- 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"
|
|
|
|
"name": "dockersock",
|
|
|
|
- "n=0\nwhile :\ndo\n docker pull gitea/gitea:1.12.3-linux-amd64@sha256:38b8222941d8acffb7bb9c3fb0e9e0b657e06815a090f1fb11ed6900a3c9f384 \\\\\n && docker tag gitea/gitea:1.12.3-linux-amd64@sha256:38b8222941d8acffb7bb9c3fb0e9e0b657e06815a090f1fb11ed6900a3c9f384 $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/gitea/gitea/gitea:1.12.3-linux-amd64 \\\\\n && docker push $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/gitea/gitea/gitea:1.12.3-linux-amd64 && 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"
|
|
|
|
"path": "/var/run"
|
|
|
|
volumes:
|
|
|
|
},
|
|
|
|
- name: dockersock
|
|
|
|
{
|
|
|
|
path: /var/run
|
|
|
|
"name": "ca",
|
|
|
|
|
|
|
|
"path": "/etc/docker/certs.d"
|
|
|
|
services:
|
|
|
|
},
|
|
|
|
- name: docker
|
|
|
|
{
|
|
|
|
image: docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f
|
|
|
|
"name": "daemonjson",
|
|
|
|
privileged: true
|
|
|
|
"path": "/etc/docker/daemon.json"
|
|
|
|
volumes:
|
|
|
|
}
|
|
|
|
- name: dockersock
|
|
|
|
]
|
|
|
|
path: /var/run
|
|
|
|
}
|
|
|
|
- name: ca
|
|
|
|
],
|
|
|
|
path: /etc/docker/certs.d
|
|
|
|
"steps": [
|
|
|
|
- name: daemonjson
|
|
|
|
{
|
|
|
|
path: /etc/docker/daemon.json
|
|
|
|
"commands": [
|
|
|
|
|
|
|
|
"set -e",
|
|
|
|
volumes:
|
|
|
|
"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",
|
|
|
|
- name: dockersock
|
|
|
|
"n=0\nwhile :\ndo\n docker pull gitea/gitea:1.12.3-linux-amd64@sha256:38b8222941d8acffb7bb9c3fb0e9e0b657e06815a090f1fb11ed6900a3c9f384 \\\\\n && docker tag gitea/gitea:1.12.3-linux-amd64@sha256:38b8222941d8acffb7bb9c3fb0e9e0b657e06815a090f1fb11ed6900a3c9f384 $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/gitea/gitea/gitea:1.12.3-linux-amd64 \\\\\n && docker push $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/gitea/gitea/gitea:1.12.3-linux-amd64 && 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"
|
|
|
|
temp: {}
|
|
|
|
],
|
|
|
|
- name: ca
|
|
|
|
"environment": { },
|
|
|
|
host:
|
|
|
|
"image": "docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f",
|
|
|
|
path: /etc/docker/certs.d
|
|
|
|
"name": "gitea/gitea:1.12.3-linux-amd64",
|
|
|
|
- name: daemonjson
|
|
|
|
"volumes": [
|
|
|
|
host:
|
|
|
|
{
|
|
|
|
path: /etc/docker/daemon.json
|
|
|
|
"name": "dockersock",
|
|
|
|
|
|
|
|
"path": "/var/run"
|
|
|
|
image_pull_secrets:
|
|
|
|
}
|
|
|
|
- dockerconfigjson
|
|
|
|
]
|
|
|
|
|
|
|
|
}
|
|
|
|
trigger:
|
|
|
|
],
|
|
|
|
event:
|
|
|
|
"trigger": {
|
|
|
|
- promote
|
|
|
|
"event": [
|
|
|
|
target:
|
|
|
|
"promote"
|
|
|
|
- registry
|
|
|
|
],
|
|
|
|
|
|
|
|
"target": [
|
|
|
|
|
|
|
|
"registry"
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"type": "docker",
|
|
|
|
|
|
|
|
"volumes": [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"name": "dockersock",
|
|
|
|
|
|
|
|
"temp": { }
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"host": {
|
|
|
|
|
|
|
|
"path": "/etc/docker/certs.d"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"name": "ca"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"host": {
|
|
|
|
|
|
|
|
"path": "/etc/docker/daemon.json"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"name": "daemonjson"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
}
|
|
|
|
---
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
{
|
|
|
|
type: docker
|
|
|
|
"clone": {
|
|
|
|
name: save
|
|
|
|
"disable": true
|
|
|
|
|
|
|
|
},
|
|
|
|
platform:
|
|
|
|
"kind": "pipeline",
|
|
|
|
os: linux
|
|
|
|
"name": "save",
|
|
|
|
arch: amd64
|
|
|
|
"steps": [
|
|
|
|
|
|
|
|
{
|
|
|
|
clone:
|
|
|
|
"image": "appleboy/drone-ssh:1.6.3",
|
|
|
|
disable: true
|
|
|
|
"name": "mkdir",
|
|
|
|
|
|
|
|
"settings": {
|
|
|
|
steps:
|
|
|
|
"envs": [
|
|
|
|
- name: mkdir
|
|
|
|
"drone_tag",
|
|
|
|
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
|
|
|
|
"drone_commit",
|
|
|
|
settings:
|
|
|
|
"drone_build_number",
|
|
|
|
envs:
|
|
|
|
"drone_repo_name",
|
|
|
|
- drone_tag
|
|
|
|
"drone_repo_namespace"
|
|
|
|
- drone_commit
|
|
|
|
],
|
|
|
|
- drone_build_number
|
|
|
|
"script": [
|
|
|
|
- drone_repo_name
|
|
|
|
"mkdir -p /stack/.images/gitea/built",
|
|
|
|
- drone_repo_namespace
|
|
|
|
"rm -f /stack/.images/gitea/*.*",
|
|
|
|
script:
|
|
|
|
"rm -f /stack/.images/gitea/built/*.*"
|
|
|
|
- mkdir -p /stack/.images/gitea/built
|
|
|
|
]
|
|
|
|
- rm -f /stack/.images/gitea/*.*
|
|
|
|
}
|
|
|
|
- rm -f /stack/.images/gitea/built/*.*
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
- name: gitea/gitea:1.12.3-linux-amd64
|
|
|
|
"image": "appleboy/drone-ssh:1.6.3",
|
|
|
|
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
|
|
|
|
"name": "gitea/gitea:1.12.3-linux-amd64",
|
|
|
|
settings:
|
|
|
|
"settings": {
|
|
|
|
envs:
|
|
|
|
"envs": [
|
|
|
|
- drone_tag
|
|
|
|
"drone_tag",
|
|
|
|
- drone_commit
|
|
|
|
"drone_commit",
|
|
|
|
- drone_build_number
|
|
|
|
"drone_build_number",
|
|
|
|
- drone_repo_name
|
|
|
|
"drone_repo_name",
|
|
|
|
- drone_repo_namespace
|
|
|
|
"drone_repo_namespace",
|
|
|
|
- registry_domain
|
|
|
|
"registry_domain",
|
|
|
|
- registry_port
|
|
|
|
"registry_port",
|
|
|
|
- registry_password
|
|
|
|
"registry_password",
|
|
|
|
- destination_registry
|
|
|
|
"destination_registry"
|
|
|
|
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"
|
|
|
|
"script": [
|
|
|
|
- docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/gitea/gitea/gitea:1.12.3-linux-amd64
|
|
|
|
"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 save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/gitea/gitea/gitea:1.12.3-linux-amd64 -o /stack/.images/gitea/gitea_gitea:1.12.3-linux-amd64.tar
|
|
|
|
"docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/gitea/gitea/gitea:1.12.3-linux-amd64",
|
|
|
|
- echo "docker load < gitea_gitea:1.12.3-linux-amd64.tar" >> /stack/.images/gitea/load.sh
|
|
|
|
"docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/gitea/gitea/gitea:1.12.3-linux-amd64 -o /stack/.images/gitea/gitea_gitea:1.12.3-linux-amd64.tar",
|
|
|
|
- echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/gitea/gitea/gitea:1.12.3-linux-amd64 $${DESTINATION_REGISTRY}/stack/gitea/gitea/gitea:1.12.3-linux-amd64" >> /stack/.images/gitea/load.sh
|
|
|
|
"echo \"docker load < gitea_gitea:1.12.3-linux-amd64.tar\" >> /stack/.images/gitea/load.sh",
|
|
|
|
|
|
|
|
"echo \"docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/gitea/gitea/gitea:1.12.3-linux-amd64 $${DESTINATION_REGISTRY}/stack/gitea/gitea/gitea:1.12.3-linux-amd64\" >> /stack/.images/gitea/load.sh"
|
|
|
|
- name: gitea
|
|
|
|
]
|
|
|
|
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
|
|
|
|
}
|
|
|
|
settings:
|
|
|
|
},
|
|
|
|
envs:
|
|
|
|
{
|
|
|
|
- drone_tag
|
|
|
|
"image": "appleboy/drone-ssh:1.6.3",
|
|
|
|
- drone_commit
|
|
|
|
"name": "gitea",
|
|
|
|
- drone_build_number
|
|
|
|
"settings": {
|
|
|
|
- drone_repo_name
|
|
|
|
"envs": [
|
|
|
|
- drone_repo_namespace
|
|
|
|
"drone_tag",
|
|
|
|
- registry_domain
|
|
|
|
"drone_commit",
|
|
|
|
- registry_port
|
|
|
|
"drone_build_number",
|
|
|
|
- registry_password
|
|
|
|
"drone_repo_name",
|
|
|
|
- destination_registry
|
|
|
|
"drone_repo_namespace",
|
|
|
|
script:
|
|
|
|
"registry_domain",
|
|
|
|
- "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"
|
|
|
|
"registry_port",
|
|
|
|
- docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/gitea/gitea
|
|
|
|
"registry_password",
|
|
|
|
- docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/gitea/gitea -o /stack/.images/gitea/built/gitea.tar
|
|
|
|
"destination_registry"
|
|
|
|
- echo "docker load gitea.tar" >> /stack/.images/gitea/built/load.sh
|
|
|
|
],
|
|
|
|
- echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/gitea/gitea ${DESINATION_REGISTRY}/stack/gitea/gitea" >> /stack/.images/gitea/built/load.sh
|
|
|
|
"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",
|
|
|
|
trigger:
|
|
|
|
"docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/gitea/gitea",
|
|
|
|
event:
|
|
|
|
"docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/gitea/gitea -o /stack/.images/gitea/built/gitea.tar",
|
|
|
|
- promote
|
|
|
|
"echo \"docker load gitea.tar\" >> /stack/.images/gitea/built/load.sh",
|
|
|
|
target:
|
|
|
|
"echo \"docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/gitea/gitea ${DESINATION_REGISTRY}/stack/gitea/gitea\" >> /stack/.images/gitea/built/load.sh"
|
|
|
|
- save
|
|
|
|
]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
"trigger": {
|
|
|
|
|
|
|
|
"event": [
|
|
|
|
|
|
|
|
"promote"
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
"target": [
|
|
|
|
|
|
|
|
"save"
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"type": "docker"
|
|
|
|
|
|
|
|
}
|
|
|
|
---
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
{
|
|
|
|
type: docker
|
|
|
|
"clone": {
|
|
|
|
name: print
|
|
|
|
"depth": 0,
|
|
|
|
|
|
|
|
"disable": false
|
|
|
|
platform:
|
|
|
|
},
|
|
|
|
os: linux
|
|
|
|
"kind": "pipeline",
|
|
|
|
arch: amd64
|
|
|
|
"name": "print",
|
|
|
|
|
|
|
|
"steps": [
|
|
|
|
steps:
|
|
|
|
{
|
|
|
|
- name: print env
|
|
|
|
"environment": {
|
|
|
|
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
|
|
|
|
"GITEA_APP_NAME": {
|
|
|
|
settings:
|
|
|
|
"from_secret": "gitea-app-name"
|
|
|
|
envs:
|
|
|
|
},
|
|
|
|
- drone_tag
|
|
|
|
"GITEA_MAILER_FROM": {
|
|
|
|
- drone_commit
|
|
|
|
"from_secret": "gitea-mailer-from"
|
|
|
|
- drone_build_number
|
|
|
|
},
|
|
|
|
- drone_repo_name
|
|
|
|
"GITEA_MAILER_HOST": {
|
|
|
|
- drone_repo_namespace
|
|
|
|
"from_secret": "gitea-mailer-host"
|
|
|
|
- gitea_mailer_host
|
|
|
|
},
|
|
|
|
- gitea_mailer_from
|
|
|
|
"GITEA_MAILER_PASSWD": {
|
|
|
|
- gitea_mailer_user
|
|
|
|
"from_secret": "gitea-mailer-passwd"
|
|
|
|
- gitea_app_name
|
|
|
|
},
|
|
|
|
- gitea_server_lfs_jwt_secret
|
|
|
|
"GITEA_MAILER_USER": {
|
|
|
|
- gitea_security_secret_key
|
|
|
|
"from_secret": "gitea-mailer-user"
|
|
|
|
- gitea_security_internal_token
|
|
|
|
},
|
|
|
|
- gitea_oauth2_jwt_secret
|
|
|
|
"GITEA_OAUTH2_JWT_SECRET": {
|
|
|
|
- gitea_mailer_passwd
|
|
|
|
"from_secret": "gitea-oauth2-jwt-secret"
|
|
|
|
script:
|
|
|
|
},
|
|
|
|
- rm -f env-gitea
|
|
|
|
"GITEA_SECURITY_INTERNAL_TOKEN": {
|
|
|
|
- "echo \"export GITEA_MAILER_HOST='$${GITEA_MAILER_HOST}'\" >> env-gitea # \"gitea-mailer-host\""
|
|
|
|
"from_secret": "gitea-security-internal-token"
|
|
|
|
- "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\""
|
|
|
|
"GITEA_SECURITY_SECRET_KEY": {
|
|
|
|
- "echo \"export GITEA_APP_NAME='$${GITEA_APP_NAME}'\" >> env-gitea # \"gitea-app-name\""
|
|
|
|
"from_secret": "gitea-security-secret-key"
|
|
|
|
- "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\""
|
|
|
|
"GITEA_SERVER_LFS_JWT_SECRET": {
|
|
|
|
- "echo \"export GITEA_SECURITY_INTERNAL_TOKEN='$${GITEA_SECURITY_INTERNAL_TOKEN}'\" >> env-gitea # \"gitea-security-internal-token\""
|
|
|
|
"from_secret": "gitea-server-lfs-jwt-secret"
|
|
|
|
- "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\""
|
|
|
|
},
|
|
|
|
environment:
|
|
|
|
"image": "appleboy/drone-ssh:1.6.3",
|
|
|
|
GITEA_APP_NAME:
|
|
|
|
"name": "print env",
|
|
|
|
from_secret: gitea-app-name
|
|
|
|
"settings": {
|
|
|
|
GITEA_MAILER_FROM:
|
|
|
|
"envs": [
|
|
|
|
from_secret: gitea-mailer-from
|
|
|
|
"drone_tag",
|
|
|
|
GITEA_MAILER_HOST:
|
|
|
|
"drone_commit",
|
|
|
|
from_secret: gitea-mailer-host
|
|
|
|
"drone_build_number",
|
|
|
|
GITEA_MAILER_PASSWD:
|
|
|
|
"drone_repo_name",
|
|
|
|
from_secret: gitea-mailer-passwd
|
|
|
|
"drone_repo_namespace",
|
|
|
|
GITEA_MAILER_USER:
|
|
|
|
"gitea_mailer_host",
|
|
|
|
from_secret: gitea-mailer-user
|
|
|
|
"gitea_mailer_from",
|
|
|
|
GITEA_OAUTH2_JWT_SECRET:
|
|
|
|
"gitea_mailer_user",
|
|
|
|
from_secret: gitea-oauth2-jwt-secret
|
|
|
|
"gitea_app_name",
|
|
|
|
GITEA_SECURITY_INTERNAL_TOKEN:
|
|
|
|
"gitea_server_lfs_jwt_secret",
|
|
|
|
from_secret: gitea-security-internal-token
|
|
|
|
"gitea_security_secret_key",
|
|
|
|
GITEA_SECURITY_SECRET_KEY:
|
|
|
|
"gitea_security_internal_token",
|
|
|
|
from_secret: gitea-security-secret-key
|
|
|
|
"gitea_oauth2_jwt_secret",
|
|
|
|
GITEA_SERVER_LFS_JWT_SECRET:
|
|
|
|
"gitea_mailer_passwd"
|
|
|
|
from_secret: gitea-server-lfs-jwt-secret
|
|
|
|
],
|
|
|
|
|
|
|
|
"script": [
|
|
|
|
trigger:
|
|
|
|
"rm -f env-gitea",
|
|
|
|
event:
|
|
|
|
"echo \"export GITEA_MAILER_HOST='$${GITEA_MAILER_HOST}'\" >> env-gitea # \"gitea-mailer-host\"",
|
|
|
|
- promote
|
|
|
|
"echo \"export GITEA_MAILER_FROM='$${GITEA_MAILER_FROM}'\" >> env-gitea # \"gitea-mailer-from\"",
|
|
|
|
target:
|
|
|
|
"echo \"export GITEA_MAILER_USER='$${GITEA_MAILER_USER}'\" >> env-gitea # \"gitea-mailer-user\"",
|
|
|
|
- print
|
|
|
|
"echo \"export GITEA_APP_NAME='$${GITEA_APP_NAME}'\" >> env-gitea # \"gitea-app-name\"",
|
|
|
|
|
|
|
|
"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\""
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
"trigger": {
|
|
|
|
|
|
|
|
"event": [
|
|
|
|
|
|
|
|
"promote"
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
"target": [
|
|
|
|
|
|
|
|
"print"
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"type": "docker"
|
|
|
|
|
|
|
|
}
|
|
|
|
---
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
{
|
|
|
|
type: docker
|
|
|
|
"clone": {
|
|
|
|
name: build
|
|
|
|
"depth": 0,
|
|
|
|
|
|
|
|
"disable": false
|
|
|
|
platform:
|
|
|
|
},
|
|
|
|
os: linux
|
|
|
|
"kind": "pipeline",
|
|
|
|
arch: amd64
|
|
|
|
"name": "build",
|
|
|
|
|
|
|
|
"services": [
|
|
|
|
steps:
|
|
|
|
{
|
|
|
|
- name: "dockerbuild:"
|
|
|
|
"image": "docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f",
|
|
|
|
image: docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f
|
|
|
|
"name": "docker",
|
|
|
|
commands:
|
|
|
|
"privileged": true,
|
|
|
|
- set -e
|
|
|
|
"volumes": [
|
|
|
|
- export NAME=gitea
|
|
|
|
{
|
|
|
|
- export ROOT=stack
|
|
|
|
"name": "dockersock",
|
|
|
|
- "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"
|
|
|
|
"path": "/var/run"
|
|
|
|
- sh .drone/build.sh
|
|
|
|
},
|
|
|
|
- sh .drone/push.sh
|
|
|
|
{
|
|
|
|
volumes:
|
|
|
|
"name": "ca",
|
|
|
|
- name: dockersock
|
|
|
|
"path": "/etc/docker/certs.d"
|
|
|
|
path: /var/run
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
services:
|
|
|
|
"name": "daemonjson",
|
|
|
|
- name: docker
|
|
|
|
"path": "/etc/docker/daemon.json"
|
|
|
|
image: docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f
|
|
|
|
}
|
|
|
|
privileged: true
|
|
|
|
]
|
|
|
|
volumes:
|
|
|
|
}
|
|
|
|
- name: dockersock
|
|
|
|
],
|
|
|
|
path: /var/run
|
|
|
|
"steps": [
|
|
|
|
- name: ca
|
|
|
|
{
|
|
|
|
path: /etc/docker/certs.d
|
|
|
|
"commands": [
|
|
|
|
- name: daemonjson
|
|
|
|
"set -e",
|
|
|
|
path: /etc/docker/daemon.json
|
|
|
|
"export NAME=gitea",
|
|
|
|
|
|
|
|
"export ROOT=stack",
|
|
|
|
volumes:
|
|
|
|
"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",
|
|
|
|
- name: dockersock
|
|
|
|
"sh .drone/build.sh",
|
|
|
|
temp: {}
|
|
|
|
"sh .drone/push.sh"
|
|
|
|
- name: ca
|
|
|
|
],
|
|
|
|
host:
|
|
|
|
"environment": { },
|
|
|
|
path: /etc/docker/certs.d
|
|
|
|
"image": "docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f",
|
|
|
|
- name: daemonjson
|
|
|
|
"name": "dockerbuild:",
|
|
|
|
host:
|
|
|
|
"volumes": [
|
|
|
|
path: /etc/docker/daemon.json
|
|
|
|
{
|
|
|
|
|
|
|
|
"name": "dockersock",
|
|
|
|
trigger:
|
|
|
|
"path": "/var/run"
|
|
|
|
event:
|
|
|
|
}
|
|
|
|
- promote
|
|
|
|
]
|
|
|
|
target:
|
|
|
|
}
|
|
|
|
- build
|
|
|
|
],
|
|
|
|
|
|
|
|
"trigger": {
|
|
|
|
|
|
|
|
"event": [
|
|
|
|
|
|
|
|
"promote"
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
"target": [
|
|
|
|
|
|
|
|
"build"
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"type": "docker",
|
|
|
|
|
|
|
|
"volumes": [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"name": "dockersock",
|
|
|
|
|
|
|
|
"temp": { }
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"host": {
|
|
|
|
|
|
|
|
"path": "/etc/docker/certs.d"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"name": "ca"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"host": {
|
|
|
|
|
|
|
|
"path": "/etc/docker/daemon.json"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"name": "daemonjson"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
}
|
|
|
|
---
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
{
|
|
|
|
type: docker
|
|
|
|
"clone": {
|
|
|
|
name: deploy
|
|
|
|
"depth": 0,
|
|
|
|
|
|
|
|
"disable": false
|
|
|
|
platform:
|
|
|
|
},
|
|
|
|
os: linux
|
|
|
|
"kind": "pipeline",
|
|
|
|
arch: amd64
|
|
|
|
"name": "deploy",
|
|
|
|
|
|
|
|
"steps": [
|
|
|
|
steps:
|
|
|
|
{
|
|
|
|
- name: scp
|
|
|
|
"image": "appleboy/drone-scp:1.6.2@sha256:bd37a55f4b97e7742b0de7333669b96220b3cc422d366e1fa8c34059b736ab47",
|
|
|
|
image: appleboy/drone-scp:1.6.2@sha256:bd37a55f4b97e7742b0de7333669b96220b3cc422d366e1fa8c34059b736ab47
|
|
|
|
"name": "scp",
|
|
|
|
settings:
|
|
|
|
"settings": {
|
|
|
|
command_timeout: 2m
|
|
|
|
"command_timeout": "2m",
|
|
|
|
source:
|
|
|
|
"source": [
|
|
|
|
- .
|
|
|
|
"."
|
|
|
|
target: /stack/gitea
|
|
|
|
],
|
|
|
|
|
|
|
|
"target": "/stack/gitea"
|
|
|
|
- name: deploy
|
|
|
|
}
|
|
|
|
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
|
|
|
|
},
|
|
|
|
settings:
|
|
|
|
{
|
|
|
|
envs:
|
|
|
|
"environment": {
|
|
|
|
- drone_tag
|
|
|
|
"GITEA_APP_NAME": {
|
|
|
|
- drone_commit
|
|
|
|
"from_secret": "gitea-app-name"
|
|
|
|
- drone_build_number
|
|
|
|
},
|
|
|
|
- drone_repo_name
|
|
|
|
"GITEA_MAILER_FROM": {
|
|
|
|
- drone_repo_namespace
|
|
|
|
"from_secret": "gitea-mailer-from"
|
|
|
|
- scheme
|
|
|
|
},
|
|
|
|
- domain
|
|
|
|
"GITEA_MAILER_HOST": {
|
|
|
|
- registry_domain
|
|
|
|
"from_secret": "gitea-mailer-host"
|
|
|
|
- registry_port
|
|
|
|
},
|
|
|
|
- registry_password
|
|
|
|
"GITEA_MAILER_PASSWD": {
|
|
|
|
- gitea_mailer_host
|
|
|
|
"from_secret": "gitea-mailer-passwd"
|
|
|
|
- gitea_mailer_from
|
|
|
|
},
|
|
|
|
- gitea_mailer_user
|
|
|
|
"GITEA_MAILER_USER": {
|
|
|
|
- gitea_app_name
|
|
|
|
"from_secret": "gitea-mailer-user"
|
|
|
|
- gitea_server_lfs_jwt_secret
|
|
|
|
},
|
|
|
|
- gitea_security_secret_key
|
|
|
|
"GITEA_OAUTH2_JWT_SECRET": {
|
|
|
|
- gitea_security_internal_token
|
|
|
|
"from_secret": "gitea-oauth2-jwt-secret"
|
|
|
|
- gitea_oauth2_jwt_secret
|
|
|
|
},
|
|
|
|
- gitea_mailer_passwd
|
|
|
|
"GITEA_SECURITY_INTERNAL_TOKEN": {
|
|
|
|
script:
|
|
|
|
"from_secret": "gitea-security-internal-token"
|
|
|
|
- export GITEA_SERVER_LFS_JWT_SECRET=$${GITEA_SERVER_LFS_JWT_SECRET}
|
|
|
|
},
|
|
|
|
- export GITEA_SECURITY_SECRET_KEY=$${GITEA_SECURITY_SECRET_KEY}
|
|
|
|
"GITEA_SECURITY_SECRET_KEY": {
|
|
|
|
- export GITEA_SECURITY_INTERNAL_TOKEN=$${GITEA_SECURITY_INTERNAL_TOKEN}
|
|
|
|
"from_secret": "gitea-security-secret-key"
|
|
|
|
- export GITEA_OAUTH2_JWT_SECRET=$${GITEA_OAUTH2_JWT_SECRET}
|
|
|
|
},
|
|
|
|
- export GITEA_MAILER_PASSWD=$${GITEA_MAILER_PASSWD}
|
|
|
|
"GITEA_SERVER_LFS_JWT_SECRET": {
|
|
|
|
- export GITEA_MAILER_HOST=$${GITEA_MAILER_HOST}
|
|
|
|
"from_secret": "gitea-server-lfs-jwt-secret"
|
|
|
|
- export GITEA_MAILER_FROM=$${GITEA_MAILER_FROM}
|
|
|
|
}
|
|
|
|
- export GITEA_MAILER_USER=$${GITEA_MAILER_USER}
|
|
|
|
},
|
|
|
|
- export GITEA_APP_NAME=$${GITEA_APP_NAME}
|
|
|
|
"image": "appleboy/drone-ssh:1.6.3",
|
|
|
|
- export SCHEME=$${SCHEME}
|
|
|
|
"name": "deploy",
|
|
|
|
- export DOMAIN=$${DOMAIN}
|
|
|
|
"settings": {
|
|
|
|
- export REGISTRY_DOMAIN=$${REGISTRY_DOMAIN}
|
|
|
|
"envs": [
|
|
|
|
- export REGISTRY_PORT=$${REGISTRY_PORT}
|
|
|
|
"drone_tag",
|
|
|
|
- export REGISTRY_PASSWORD=$${REGISTRY_PASSWORD}
|
|
|
|
"drone_commit",
|
|
|
|
- set -e
|
|
|
|
"drone_build_number",
|
|
|
|
- export NAME=gitea
|
|
|
|
"drone_repo_name",
|
|
|
|
- export ROOT=stack
|
|
|
|
"drone_repo_namespace",
|
|
|
|
- cd /stack/gitea
|
|
|
|
"scheme",
|
|
|
|
- "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"
|
|
|
|
"domain",
|
|
|
|
- sh .drone/pull.sh
|
|
|
|
"registry_domain",
|
|
|
|
- sh .drone/deploy.sh
|
|
|
|
"registry_port",
|
|
|
|
environment:
|
|
|
|
"registry_password",
|
|
|
|
GITEA_APP_NAME:
|
|
|
|
"gitea_mailer_host",
|
|
|
|
from_secret: gitea-app-name
|
|
|
|
"gitea_mailer_from",
|
|
|
|
GITEA_MAILER_FROM:
|
|
|
|
"gitea_mailer_user",
|
|
|
|
from_secret: gitea-mailer-from
|
|
|
|
"gitea_app_name",
|
|
|
|
GITEA_MAILER_HOST:
|
|
|
|
"gitea_server_lfs_jwt_secret",
|
|
|
|
from_secret: gitea-mailer-host
|
|
|
|
"gitea_security_secret_key",
|
|
|
|
GITEA_MAILER_PASSWD:
|
|
|
|
"gitea_security_internal_token",
|
|
|
|
from_secret: gitea-mailer-passwd
|
|
|
|
"gitea_oauth2_jwt_secret",
|
|
|
|
GITEA_MAILER_USER:
|
|
|
|
"gitea_mailer_passwd"
|
|
|
|
from_secret: gitea-mailer-user
|
|
|
|
],
|
|
|
|
GITEA_OAUTH2_JWT_SECRET:
|
|
|
|
"script": [
|
|
|
|
from_secret: gitea-oauth2-jwt-secret
|
|
|
|
"export GITEA_SERVER_LFS_JWT_SECRET=$${GITEA_SERVER_LFS_JWT_SECRET}",
|
|
|
|
GITEA_SECURITY_INTERNAL_TOKEN:
|
|
|
|
"export GITEA_SECURITY_SECRET_KEY=$${GITEA_SECURITY_SECRET_KEY}",
|
|
|
|
from_secret: gitea-security-internal-token
|
|
|
|
"export GITEA_SECURITY_INTERNAL_TOKEN=$${GITEA_SECURITY_INTERNAL_TOKEN}",
|
|
|
|
GITEA_SECURITY_SECRET_KEY:
|
|
|
|
"export GITEA_OAUTH2_JWT_SECRET=$${GITEA_OAUTH2_JWT_SECRET}",
|
|
|
|
from_secret: gitea-security-secret-key
|
|
|
|
"export GITEA_MAILER_PASSWD=$${GITEA_MAILER_PASSWD}",
|
|
|
|
GITEA_SERVER_LFS_JWT_SECRET:
|
|
|
|
"export GITEA_MAILER_HOST=$${GITEA_MAILER_HOST}",
|
|
|
|
from_secret: gitea-server-lfs-jwt-secret
|
|
|
|
"export GITEA_MAILER_FROM=$${GITEA_MAILER_FROM}",
|
|
|
|
|
|
|
|
"export GITEA_MAILER_USER=$${GITEA_MAILER_USER}",
|
|
|
|
trigger:
|
|
|
|
"export GITEA_APP_NAME=$${GITEA_APP_NAME}",
|
|
|
|
event:
|
|
|
|
"export SCHEME=$${SCHEME}",
|
|
|
|
- promote
|
|
|
|
"export DOMAIN=$${DOMAIN}",
|
|
|
|
target:
|
|
|
|
"export REGISTRY_DOMAIN=$${REGISTRY_DOMAIN}",
|
|
|
|
- deploy
|
|
|
|
"export REGISTRY_PORT=$${REGISTRY_PORT}",
|
|
|
|
|
|
|
|
"export REGISTRY_PASSWORD=$${REGISTRY_PASSWORD}",
|
|
|
|
...
|
|
|
|
"set -e",
|
|
|
|
|
|
|
|
"export NAME=gitea",
|
|
|
|
|
|
|
|
"export ROOT=stack",
|
|
|
|
|
|
|
|
"cd /stack/gitea",
|
|
|
|
|
|
|
|
"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",
|
|
|
|
|
|
|
|
"sh .drone/pull.sh",
|
|
|
|
|
|
|
|
"sh .drone/deploy.sh"
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
"trigger": {
|
|
|
|
|
|
|
|
"event": [
|
|
|
|
|
|
|
|
"promote"
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
"target": [
|
|
|
|
|
|
|
|
"deploy"
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"type": "docker"
|
|
|
|
|
|
|
|
}
|
|
|
|