Compare commits
6 Commits
Author | SHA1 | Date |
---|---|---|
Giles Bradshaw | 02c2ed0406 | |
Giles Bradshaw | f5443f34db | |
Giles Bradshaw | 3feb328c0a | |
Giles Bradshaw | fa79a40bb4 | |
Giles Bradshaw | 0f4d6dbfd7 | |
Giles Bradshaw | f3efe5079b |
|
@ -1,5 +1,3 @@
|
|||
sleep 10
|
||||
|
||||
docker build gitea \
|
||||
--build-arg REGISTRY=${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/ \
|
||||
-t ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/gitea:$1
|
||||
--build-arg REGISTRY=${REGISTRY_DOMAIN}:${REGISTRY_PORT}/ \
|
||||
-t ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/gitea
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
export LOCAL_DOCKER_REGISTRY=${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/ \
|
||||
&& echo $1 \
|
||||
&& export TAG=$1 \
|
||||
export LOCAL_DOCKER_REGISTRY=${REGISTRY_DOMAIN}:${REGISTRY_PORT}/ \
|
||||
&& docker stack rm gitea \
|
||||
&& echo 'sleeping...zzz' \
|
||||
&& sleep 60 \
|
||||
&& docker stack deploy -c docker-compose.yml gitea --with-registry-auth
|
||||
&& docker stack deploy -c docker-compose.yml gitea
|
||||
|
|
|
@ -5,56 +5,48 @@ 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';
|
||||
local registry = import 'node_modules/@sigyl/jsonnet-drone/registry.libsonnet';
|
||||
local save = import 'node_modules/@sigyl/jsonnet-drone/save.libsonnet';
|
||||
local build = import 'node_modules/@sigyl/jsonnet-drone/build.libsonnet';
|
||||
local print = import 'node_modules/@sigyl/jsonnet-drone/print.libsonnet';
|
||||
|
||||
local config = {
|
||||
registry: '',
|
||||
name: 'gitea',
|
||||
root: 'stack',
|
||||
};
|
||||
|
||||
local defs = [
|
||||
{
|
||||
load: 'gitea/gitea:1.12.3-linux-amd64@sha256:38b8222941d8acffb7bb9c3fb0e9e0b657e06815a090f1fb11ed6900a3c9f384',
|
||||
save: 'gitea/gitea:1.12.3-linux-amd64'
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
[
|
||||
register,
|
||||
registry(
|
||||
config {
|
||||
script: 'sh .drone/scripts/initialise-images.sh',
|
||||
secrets: [],
|
||||
images: defs,
|
||||
},
|
||||
),
|
||||
save(config)(
|
||||
defs,
|
||||
[
|
||||
'gitea',
|
||||
],
|
||||
),
|
||||
print(config)(
|
||||
[],
|
||||
publicSecrets,
|
||||
secretSecrets,
|
||||
),
|
||||
build(config)(
|
||||
[],
|
||||
),
|
||||
) {
|
||||
trigger +: {
|
||||
event +: [
|
||||
'promote',
|
||||
],
|
||||
target +: [
|
||||
'registry',
|
||||
],
|
||||
},
|
||||
},
|
||||
deploy(config)(
|
||||
'gitea',
|
||||
'/stack/',
|
||||
[],
|
||||
publicSecrets,
|
||||
secretSecrets,
|
||||
[
|
||||
'SCHEME',
|
||||
'DOMAIN',
|
||||
'REGISTRY_DOMAIN',
|
||||
'REGISTRY_PORT',
|
||||
'REGISTRY_PASSWORD',
|
||||
],
|
||||
),
|
||||
) {
|
||||
trigger +: {
|
||||
event +: [
|
||||
'promote',
|
||||
],
|
||||
target +: [
|
||||
'production',
|
||||
],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,6 +1,70 @@
|
|||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: print
|
||||
name: register
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
clone:
|
||||
disable: true
|
||||
|
||||
trigger:
|
||||
event:
|
||||
exclude:
|
||||
- promote
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: registry
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: "dockerpull and save docker images:"
|
||||
image: docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f
|
||||
commands:
|
||||
- set -e
|
||||
- export REGISTRY=$${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/
|
||||
- sh .drone/scripts/initialise-images.sh $${REGISTRY} "$${REGISTRY_PASSWORD}"
|
||||
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
|
||||
|
||||
volumes:
|
||||
- name: dockersock
|
||||
temp: {}
|
||||
- name: ca
|
||||
host:
|
||||
path: /etc/docker/certs.d
|
||||
|
||||
image_pull_secrets:
|
||||
- dockerconfigjson
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- promote
|
||||
target:
|
||||
- registry
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: deploy
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
|
@ -25,7 +89,6 @@ steps:
|
|||
- gitea_security_internal_token
|
||||
- gitea_oauth2_jwt_secret
|
||||
- gitea_mailer_passwd
|
||||
- gitea_mailer_protocol
|
||||
script:
|
||||
- rm -f env-gitea
|
||||
- "echo \"export GITEA_MAILER_HOST='$${GITEA_MAILER_HOST}'\" >> env-gitea # \"gitea-mailer-host\""
|
||||
|
@ -37,7 +100,6 @@ steps:
|
|||
- "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\""
|
||||
- "echo \"export GITEA_MAILER_PROTOCOL='$${GITEA_MAILER_PROTOCOL}'\" >> env-gitea # \"gitea-mailer-protocol\""
|
||||
environment:
|
||||
GITEA_APP_NAME:
|
||||
from_secret: gitea-app-name
|
||||
|
@ -47,8 +109,6 @@ steps:
|
|||
from_secret: gitea-mailer-host
|
||||
GITEA_MAILER_PASSWD:
|
||||
from_secret: gitea-mailer-passwd
|
||||
GITEA_MAILER_PROTOCOL:
|
||||
from_secret: gitea-mailer-protocol
|
||||
GITEA_MAILER_USER:
|
||||
from_secret: gitea-mailer-user
|
||||
GITEA_OAUTH2_JWT_SECRET:
|
||||
|
@ -60,53 +120,91 @@ steps:
|
|||
GITEA_SERVER_LFS_JWT_SECRET:
|
||||
from_secret: gitea-server-lfs-jwt-secret
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- promote
|
||||
target:
|
||||
- print
|
||||
- name: scp
|
||||
image: appleboy/drone-scp:1.6.2@sha256:bd37a55f4b97e7742b0de7333669b96220b3cc422d366e1fa8c34059b736ab47
|
||||
settings:
|
||||
command_timeout: 2m
|
||||
source:
|
||||
- .
|
||||
target: /stack/gitea
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: build
|
||||
- name: wait
|
||||
image: alpine:3.12.0@sha256:90baa0922fe90624b05cb5766fa5da4e337921656c2f8e2b13bd3c052a0baac1
|
||||
commands:
|
||||
- sleep 15
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: "build commit"
|
||||
- name: "dockerbuild:"
|
||||
image: docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f
|
||||
commands:
|
||||
- set -e
|
||||
- export NAME=gitea
|
||||
- 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"
|
||||
- sh .drone/build.sh ${DRONE_COMMIT_SHA}
|
||||
- sh .drone/push.sh ${DRONE_COMMIT_SHA}
|
||||
- sh .drone/login.sh
|
||||
- sh .drone/build.sh
|
||||
- sh .drone/push.sh
|
||||
- sh .drone/logout.sh
|
||||
volumes:
|
||||
- name: dockersock
|
||||
path: /var/run
|
||||
when:
|
||||
branch:
|
||||
- action
|
||||
- name: "build tag"
|
||||
image: docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f
|
||||
commands:
|
||||
- set -e
|
||||
- export NAME=gitea
|
||||
- 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"
|
||||
- sh .drone/build.sh ${DRONE_TAG}
|
||||
- sh .drone/push.sh ${DRONE_TAG}
|
||||
volumes:
|
||||
- name: dockersock
|
||||
path: /var/run
|
||||
when:
|
||||
event:
|
||||
- tag
|
||||
|
||||
- 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
|
||||
- registry_domain
|
||||
- registry_port
|
||||
- registry_password
|
||||
- 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}
|
||||
- export DOMAIN=$${DOMAIN}
|
||||
- export REGISTRY_DOMAIN=$${REGISTRY_DOMAIN}
|
||||
- export REGISTRY_PORT=$${REGISTRY_PORT}
|
||||
- export REGISTRY_PASSWORD=$${REGISTRY_PASSWORD}
|
||||
- set -e
|
||||
- cd /stack/gitea
|
||||
- sh .drone/login.sh
|
||||
- sh .drone/pull.sh
|
||||
- sh .drone/deploy.sh
|
||||
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
|
||||
|
@ -117,8 +215,6 @@ services:
|
|||
path: /var/run
|
||||
- name: ca
|
||||
path: /etc/docker/certs.d
|
||||
- name: daemonjson
|
||||
path: /etc/docker/daemon.json
|
||||
|
||||
volumes:
|
||||
- name: dockersock
|
||||
|
@ -126,176 +222,11 @@ volumes:
|
|||
- name: ca
|
||||
host:
|
||||
path: /etc/docker/certs.d
|
||||
- name: daemonjson
|
||||
host:
|
||||
path: /etc/docker/daemon.json
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: deploy
|
||||
|
||||
depends_on:
|
||||
- build
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: scp
|
||||
image: appleboy/drone-scp:1.6.2@sha256:bd37a55f4b97e7742b0de7333669b96220b3cc422d366e1fa8c34059b736ab47
|
||||
settings:
|
||||
command_timeout: 2m
|
||||
source:
|
||||
- .
|
||||
target: /stack/gitea
|
||||
|
||||
- name: deploy commit
|
||||
when:
|
||||
branch:
|
||||
- action
|
||||
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
|
||||
settings:
|
||||
envs:
|
||||
- drone_tag
|
||||
- drone_commit
|
||||
- drone_commit_sha
|
||||
- drone_build_number
|
||||
- drone_repo_name
|
||||
- drone_repo_namespace
|
||||
- scheme
|
||||
- domain
|
||||
- registry_domain
|
||||
- registry_port
|
||||
- registry_password
|
||||
- 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
|
||||
- gitea_mailer_protocol
|
||||
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_PROTOCOL=$${GITEA_MAILER_PROTOCOL}
|
||||
- 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}
|
||||
- export SCHEME=$${SCHEME}
|
||||
- export DOMAIN=$${DOMAIN}
|
||||
- export REGISTRY_DOMAIN=$${REGISTRY_DOMAIN}
|
||||
- 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"
|
||||
- printenv
|
||||
- sh .drone/pull.sh ${DRONE_COMMIT_SHA}
|
||||
- sh .drone/deploy.sh ${DRONE_COMMIT_SHA}
|
||||
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_PROTOCOL:
|
||||
from_secret: gitea-mailer-protocol
|
||||
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
|
||||
- name: deploy tag
|
||||
when:
|
||||
event:
|
||||
- tag
|
||||
image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
|
||||
settings:
|
||||
envs:
|
||||
- drone_tag
|
||||
- drone_commit
|
||||
- drone_commit_sha
|
||||
- drone_build_number
|
||||
- drone_repo_name
|
||||
- drone_repo_namespace
|
||||
- scheme
|
||||
- domain
|
||||
- registry_domain
|
||||
- registry_port
|
||||
- registry_password
|
||||
- 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
|
||||
- gitea_mailer_protocol
|
||||
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_PROTOCOL=$${GITEA_MAILER_PROTOCOL}
|
||||
- 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}
|
||||
- export SCHEME=$${SCHEME}
|
||||
- export DOMAIN=$${DOMAIN}
|
||||
- export REGISTRY_DOMAIN=$${REGISTRY_DOMAIN}
|
||||
- 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"
|
||||
- printenv
|
||||
- sh .drone/pull.sh ${DRONE_TAG}
|
||||
- sh .drone/deploy.sh ${DRONE_TAG}
|
||||
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_PROTOCOL:
|
||||
from_secret: gitea-mailer-protocol
|
||||
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
|
||||
trigger:
|
||||
event:
|
||||
- promote
|
||||
target:
|
||||
- production
|
||||
|
||||
...
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
docker login ${REGISTRY_DOMAIN}:${REGISTRY_PORT} --username client --password "${REGISTRY_PASSWORD}"
|
|
@ -0,0 +1 @@
|
|||
docker logout ${REGISTRY_DOMAIN}:${REGISTRY_PORT}
|
|
@ -4,6 +4,6 @@
|
|||
"build": "drone jsonnet --source drone-home.jsonnet --target drone-home.yml --stream"
|
||||
},
|
||||
"dependencies": {
|
||||
"@sigyl/jsonnet-drone": "^1.0.0"
|
||||
"@sigyl/jsonnet-drone": "^0.4.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
docker pull ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/gitea:$1
|
||||
docker pull ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/gitea
|
||||
|
|
|
@ -1 +1 @@
|
|||
docker push ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/gitea:$1
|
||||
docker push ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/gitea
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
n=0
|
||||
while :
|
||||
do
|
||||
docker pull $2 \
|
||||
&& docker tag $2 $1$2 \
|
||||
&& docker push $1$2 && break # substitute your command here
|
||||
n=$((n+1))
|
||||
if [ $n -ge 10 ]; then
|
||||
echo "initialise failed"
|
||||
exit 1
|
||||
fi
|
||||
echo "retrying..$n"
|
||||
sleep 5
|
||||
done
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
sh $(dirname $0)/login.sh $1 "$2" \
|
||||
&& sh $(dirname $0)/initialise-image.sh $1 gitea/gitea:1.12.3-linux-amd64
|
|
@ -0,0 +1,13 @@
|
|||
n=0
|
||||
while :
|
||||
do
|
||||
docker login $1 --username client --password "$2" \
|
||||
&& break # substitute your command here
|
||||
n=$((n+1))
|
||||
if [ $n -ge 10 ]; then
|
||||
echo "login failed"
|
||||
exit 1
|
||||
fi
|
||||
echo "retrying login..$n"
|
||||
sleep 5
|
||||
done
|
|
@ -12,10 +12,10 @@
|
|||
resolved "https://registry.yarnpkg.com/@sigyl/jsonnet-drone-environment/-/jsonnet-drone-environment-0.0.5.tgz#9ea85e08904777bd21a3e4b30b0b91461d0285ff"
|
||||
integrity sha512-xVGmdMO1pOyozAWUbJm6mzKBgsLPJ+1hWnGCK3AxPkr7kkDh18hu30+TLzlcQtqq76s5jUfvJUztezsGj/mIcw==
|
||||
|
||||
"@sigyl/jsonnet-drone@^1.0.0":
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@sigyl/jsonnet-drone/-/jsonnet-drone-1.0.0.tgz#943bd8a1abc8a916026944816709f5ed1d8e7ef8"
|
||||
integrity sha512-ubyVC1/nAM584wTnnRBZTOP18z28Yy7SRApvSuo/3y2arngKlNI1FwOzKTFt/7L9+rNy19dRO/g0obEkyR3KmA==
|
||||
"@sigyl/jsonnet-drone@^0.4.0":
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/@sigyl/jsonnet-drone/-/jsonnet-drone-0.4.0.tgz#ebf7bc5e076d7252195fee7be2d1eafd24ee0435"
|
||||
integrity sha512-96Adxqgo4SIU7skhiD0oPRproK4hy+Gvulym0p0bcSod5bv6b94BcYSfMyJye+sy6oRD0gosJY2uet1rgoB8UA==
|
||||
dependencies:
|
||||
"@sigyl/jsonnet-compose" "^0.0.2"
|
||||
"@sigyl/jsonnet-drone-environment" "0.0.5"
|
||||
|
|
|
@ -7,12 +7,11 @@ services:
|
|||
replicas: 1
|
||||
restart_policy:
|
||||
condition: any
|
||||
image: ${LOCAL_DOCKER_REGISTRY}gitea:${TAG}
|
||||
image: ${LOCAL_DOCKER_REGISTRY}gitea
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
- SSH_DOMAIN=${DOMAIN}
|
||||
- SCHEME=${SCHEME}
|
||||
- GITEA_APP_NAME=${GITEA_APP_NAME}
|
||||
- GITEA_DOMAIN=${DOMAIN}
|
||||
- GITEA_SERVER_LFS_JWT_SECRET=$GITEA_SERVER_LFS_JWT_SECRET
|
||||
|
@ -23,7 +22,6 @@ services:
|
|||
- GITEA_MAILER_USER=$GITEA_MAILER_USER
|
||||
- GITEA_MAILER_FROM=$GITEA_MAILER_FROM
|
||||
- GITEA_MAILER_PASSWD=$GITEA_MAILER_PASSWD
|
||||
- GITEA_MAILER_PROTOCOL=$GITEA_MAILER_PROTOCOL
|
||||
|
||||
volumes:
|
||||
- gitea-app:/data
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
ARG REGISTRY
|
||||
FROM gitea/gitea:1.20.5-linux-amd64
|
||||
FROM ${REGISTRY}gitea/gitea:1.12.3-linux-amd64
|
||||
COPY app.ini /init/
|
||||
COPY ./templates /init/templates/
|
||||
COPY run.sh /
|
||||
|
|
|
@ -17,7 +17,7 @@ TEMP_PATH = /data/gitea/uploads
|
|||
APP_DATA_PATH = /data/gitea
|
||||
SSH_DOMAIN = ${DOMAIN}
|
||||
HTTP_PORT = 3000
|
||||
ROOT_URL = ${SCHEME}://${GITEA_DOMAIN}/git/
|
||||
ROOT_URL = https://${GITEA_DOMAIN}/git/
|
||||
DISABLE_SSH = false
|
||||
SSH_PORT = 22
|
||||
SSH_LISTEN_PORT = 22
|
||||
|
@ -65,7 +65,7 @@ SECRET_KEY = ${GITEA_SECURITY_SECRET_KEY}
|
|||
INTERNAL_TOKEN = ${GITEA_SECURITY_INTERNAL_TOKEN}
|
||||
PASSWORD_COMPLEXITY = off
|
||||
[service]
|
||||
DISABLE_REGISTRATION = true
|
||||
DISABLE_REGISTRATION = false
|
||||
REQUIRE_SIGNIN_VIEW = false
|
||||
REGISTER_EMAIL_CONFIRM = true
|
||||
ENABLE_NOTIFY_MAIL = true
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
envsubst < /init/app.ini > /data/gitea/conf/app.ini
|
||||
mkdir -p /data/gitea/templates
|
||||
mkdir /data/gitea/templates
|
||||
for file in /init/templates/*
|
||||
do
|
||||
FILENAME=$(basename "$file")
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="ui stackable middle very relaxed page grid">
|
||||
<div class="sixteen wide center aligned centered column">
|
||||
<div>
|
||||
<img class="logo" src="{{AssetUrlPrefix}}/img/gitea-lg.png" />
|
||||
<img class="logo" src="{{StaticUrlPrefix}}/img/gitea-lg.png" />
|
||||
</div>
|
||||
<div class="hero">
|
||||
<h1 class="ui icon header title">
|
||||
|
|
Loading…
Reference in New Issue