Add automatic deployment for dev and production environments

This commit is contained in:
Sven-Hendrik Haase 2020-07-25 04:09:13 +02:00
parent 485b9513d7
commit 42af2a1af8
2 changed files with 41 additions and 0 deletions

View file

@ -1,5 +1,9 @@
image: archlinux image: archlinux
stages:
- test
- deploy
cache: cache:
key: system-v1 key: system-v1
paths: paths:
@ -15,5 +19,31 @@ before_script:
python-itsdangerous python-httpx python-itsdangerous python-httpx
test: test:
stage: test
script: script:
- make -C test - make -C test
deploy_dev:
stage: deploy
environment:
name: dev
url: https://aur-dev.archlinux.org
script: "ssh deployme@aur-dev.archlinux.org"
only:
- develop
resource_group: dev # Ensure only a single deployment can run per time
tags:
- secure-general
deploy_production:
stage: deploy
environment:
name: production
url: https://aur.archlinux.org
script: "ssh deployme@aur.archlinux.org"
when: manual
only:
- master
resource_group: production # Ensure only a single deployment can run per time
tags:
- secure-general

11
deploy/deployme.sh Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -eux
BASEDIR=$(dirname $(readlink -f "$0"))
cd "$BASEDIR/.."
echo "=> Deploying in $(pwd)"
git fetch origin && git reset --hard origin/master
( cd doc/ && make )
( cd po/ && make && make install )
alembic upgrade head