Merge pull request 'separate-database' (#2) from separate-database into master
continuous-integration/drone/push Build is passing Details

Reviewed-on: #2
This commit is contained in:
giles 2023-10-20 10:16:51 +00:00
commit 5ec55ad284
8 changed files with 29 additions and 18 deletions

View File

@ -2,4 +2,4 @@ sleep 10
docker build gitea \ docker build gitea \
--build-arg REGISTRY=${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/ \ --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}/ \ export LOCAL_DOCKER_REGISTRY=${REGISTRY_DOMAIN}:${REGISTRY_PORT}/${ROOT}/${NAME}/ \
&& echo $1 \
&& export TAG=$1 \
&& docker stack rm gitea \ && docker stack rm gitea \
&& echo 'sleeping...zzz' \ && echo 'sleeping...zzz' \
&& sleep 60 \ && sleep 60 \

View File

@ -228,8 +228,8 @@ steps:
- export NAME=gitea - export NAME=gitea
- export ROOT=stack - 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" - "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/build.sh ${DRONE_COMMIT_SHA}
- sh .drone/push.sh - sh .drone/push.sh ${DRONE_COMMIT_SHA}
volumes: volumes:
- name: dockersock - name: dockersock
path: /var/run path: /var/run
@ -257,16 +257,21 @@ volumes:
path: /etc/docker/daemon.json path: /etc/docker/daemon.json
trigger: trigger:
event: branch:
- promote - separate-database
target: #event:
- build #- promote
#target:
#- build
--- ---
kind: pipeline kind: pipeline
type: docker type: docker
name: deploy name: deploy
depends_on:
- build
platform: platform:
os: linux os: linux
arch: amd64 arch: amd64
@ -286,6 +291,7 @@ steps:
envs: envs:
- drone_tag - drone_tag
- drone_commit - drone_commit
- drone_commit_sha
- drone_build_number - drone_build_number
- drone_repo_name - drone_repo_name
- drone_repo_namespace - drone_repo_namespace
@ -325,8 +331,9 @@ steps:
- export ROOT=stack - export ROOT=stack
- cd /stack/gitea - 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" - "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 - printenv
- sh .drone/deploy.sh - sh .drone/pull.sh ${DRONE_COMMIT_SHA}
- sh .drone/deploy.sh ${DRONE_COMMIT_SHA}
environment: environment:
GITEA_APP_NAME: GITEA_APP_NAME:
from_secret: gitea-app-name from_secret: gitea-app-name
@ -350,9 +357,11 @@ steps:
from_secret: gitea-server-lfs-jwt-secret from_secret: gitea-server-lfs-jwt-secret
trigger: trigger:
event: branch:
- promote - separate-database
target: #event:
- deploy #- 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 replicas: 1
restart_policy: restart_policy:
condition: any condition: any
image: ${LOCAL_DOCKER_REGISTRY}gitea image: ${LOCAL_DOCKER_REGISTRY}gitea:${TAG}
environment: environment:
- USER_UID=1000 - USER_UID=1000
- USER_GID=1000 - USER_GID=1000

View File

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

View File

@ -3,7 +3,7 @@
<div class="ui stackable middle very relaxed page grid"> <div class="ui stackable middle very relaxed page grid">
<div class="sixteen wide center aligned centered column"> <div class="sixteen wide center aligned centered column">
<div> <div>
<img class="logo" src="{{StaticUrlPrefix}}/img/gitea-lg.png" /> <img class="logo" src="{{AssetUrlPrefix}}/img/gitea-lg.png" />
</div> </div>
<div class="hero"> <div class="hero">
<h1 class="ui icon header title"> <h1 class="ui icon header title">