Compare commits

...

22 Commits

Author SHA1 Message Date
giles cb9eb16bb7 Merge pull request 'build-tag' (#3) from build-tag into master
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is running Details
Reviewed-on: #3
2023-10-20 10:48:51 +00:00
giles 40efa5fbd3 buidling and deoploying on tag
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-10-20 11:47:01 +01:00
giles 2d04d35025 buidling and deoploying on tag
continuous-integration/drone/push Build encountered an error Details
2023-10-20 11:45:38 +01:00
giles 5ec55ad284 Merge pull request 'separate-database' (#2) from separate-database into master
continuous-integration/drone/push Build is passing Details
Reviewed-on: #2
2023-10-20 10:16:51 +00:00
giles 98bbf1ed70 1.20.5
continuous-integration/drone/push Build is running Details
continuous-integration/drone/pr Build is passing Details
2023-10-19 20:44:11 +01:00
giles 624f5c9ea9 17
continuous-integration/drone/push Build is running Details
2023-10-19 20:42:09 +01:00
giles 90c25b5f9d retry
continuous-integration/drone/push Build is running Details
2023-10-19 20:38:24 +01:00
giles 5bfa1f7f65 retry
continuous-integration/drone/push Build is running Details
2023-10-19 20:35:41 +01:00
giles 48114020c3 retry
continuous-integration/drone/push Build is failing Details
2023-10-19 20:31:40 +01:00
giles 19f51b34fa retry
continuous-integration/drone/push Build is failing Details
2023-10-19 20:29:41 +01:00
giles 37dd57e75a retry
continuous-integration/drone/push Build is failing Details
2023-10-19 20:28:09 +01:00
giles 0e140963aa retry
continuous-integration/drone/push Build is failing Details
2023-10-19 20:25:34 +01:00
giles cd12ee1ace versioned build 2023-10-19 20:21:08 +01:00
giles 87ed972d98 15 2023-10-19 19:49:40 +01:00
giles 3550cefc3e 16 2023-10-19 19:34:20 +01:00
giles a0cb0afea7 15
continuous-integration/drone/push Build is running Details
2023-10-19 19:32:20 +01:00
giles fa2a2b8733 15 2023-10-19 19:28:44 +01:00
giles 2a56e560c9 14
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/promote/build Build is passing Details
continuous-integration/drone/promote/deploy Build is failing Details
2023-10-19 19:23:37 +01:00
giles ef48885fd7 update to v1.13.0
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/promote/build Build is passing Details
continuous-integration/drone/promote/deploy Build is running Details
2023-10-19 19:19:47 +01:00
giles efbed6064b update to v1.13.0
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/promote/build Build is failing Details
2023-10-19 19:16:57 +01:00
giles 16e37774ac missed off env var
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/promote/deploy Build is running Details
2023-10-02 17:54:33 +01:00
giles 52e30b186c added mailer protocol
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/promote/print Build is passing Details
continuous-integration/drone/promote/deploy Build is running Details
2023-10-02 17:31:14 +01:00
8 changed files with 123 additions and 169 deletions

View File

@ -2,4 +2,4 @@ sleep 10
docker build gitea \
--build-arg REGISTRY=${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/ \
-t ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/gitea
-t ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/gitea:$1

View File

@ -1,4 +1,6 @@
export LOCAL_DOCKER_REGISTRY=${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/ \
&& echo $1 \
&& export TAG=$1 \
&& docker stack rm gitea \
&& echo 'sleeping...zzz' \
&& sleep 60 \

View File

@ -1,148 +1,3 @@
---
kind: pipeline
type: docker
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
clone:
disable: true
steps:
- name: gitea/gitea:1.12.3-linux-amd64
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 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"
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
- 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
image_pull_secrets:
- dockerconfigjson
trigger:
event:
- promote
target:
- registry
---
kind: pipeline
type: docker
name: save
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/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.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea
settings:
envs:
- drone_tag
- drone_commit
- drone_build_number
- drone_repo_name
- drone_repo_namespace
- registry_domain
- registry_port
- registry_password
- 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"
- docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/gitea/gitea/gitea:1.12.3-linux-amd64
- 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 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
- drone_commit
- drone_build_number
- drone_repo_name
- drone_repo_namespace
- registry_domain
- registry_port
- registry_password
- 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"
- docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/gitea/gitea
- docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/stack/gitea/gitea -o /stack/.images/gitea/built/gitea.tar
- 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
trigger:
event:
- promote
target:
- save
---
kind: pipeline
type: docker
name: print
@ -170,6 +25,7 @@ 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\""
@ -181,6 +37,7 @@ 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
@ -190,6 +47,8 @@ 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:
@ -217,18 +76,37 @@ platform:
arch: amd64
steps:
- name: "dockerbuild:"
- name: "build commit"
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
- sh .drone/push.sh
- sh .drone/build.sh ${DRONE_COMMIT_SHA}
- sh .drone/push.sh ${DRONE_COMMIT_SHA}
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
services:
- name: docker
@ -252,17 +130,14 @@ volumes:
host:
path: /etc/docker/daemon.json
trigger:
event:
- promote
target:
- build
---
kind: pipeline
type: docker
name: deploy
depends_on:
- build
platform:
os: linux
arch: amd64
@ -276,12 +151,16 @@ steps:
- .
target: /stack/gitea
- name: deploy
- 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
@ -299,12 +178,14 @@ steps:
- 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}
@ -319,8 +200,9 @@ steps:
- 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
- printenv
- sh .drone/pull.sh ${DRONE_COMMIT_SHA}
- sh .drone/deploy.sh ${DRONE_COMMIT_SHA}
environment:
GITEA_APP_NAME:
from_secret: gitea-app-name
@ -330,6 +212,81 @@ 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:
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:
@ -341,10 +298,4 @@ steps:
GITEA_SERVER_LFS_JWT_SECRET:
from_secret: gitea-server-lfs-jwt-secret
trigger:
event:
- promote
target:
- deploy
...

View File

@ -1 +1 @@
docker pull ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/gitea
docker pull ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/gitea:$1

View File

@ -1 +1 @@
docker push ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/gitea
docker push ${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/gitea:$1

View File

@ -7,7 +7,7 @@ services:
replicas: 1
restart_policy:
condition: any
image: ${LOCAL_DOCKER_REGISTRY}gitea
image: ${LOCAL_DOCKER_REGISTRY}gitea:${TAG}
environment:
- USER_UID=1000
- USER_GID=1000
@ -23,6 +23,7 @@ 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

View File

@ -1,5 +1,5 @@
ARG REGISTRY
FROM ${REGISTRY}gitea/gitea:1.12.3-linux-amd64
FROM gitea/gitea:1.20.5-linux-amd64
COPY app.ini /init/
COPY ./templates /init/templates/
COPY run.sh /

View 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="{{StaticUrlPrefix}}/img/gitea-lg.png" />
<img class="logo" src="{{AssetUrlPrefix}}/img/gitea-lg.png" />
</div>
<div class="hero">
<h1 class="ui icon header title">