mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Add logic for deploying with docker-compose
This commit is contained in:
parent
d7ac95a707
commit
a333cd0fee
1 changed files with 29 additions and 15 deletions
|
@ -11,6 +11,8 @@ variables:
|
|||
DB_HOST: localhost
|
||||
TEST_RECURSION_LIMIT: 10000
|
||||
|
||||
test:
|
||||
stage: test
|
||||
before_script:
|
||||
- export PATH="$HOME/.poetry/bin:${PATH}"
|
||||
- ./docker/scripts/install-deps.sh
|
||||
|
@ -25,8 +27,6 @@ before_script:
|
|||
- python -m aurweb.initdb # Initialize MySQL tables.
|
||||
- AUR_CONFIG=conf/config.sqlite python -m aurweb.initdb
|
||||
- make -C test clean
|
||||
|
||||
test:
|
||||
script:
|
||||
- make -C test sh pytest # sharness tests use sqlite & pytest w/ mysql.
|
||||
- AUR_CONFIG=conf/config.sqlite make -C test pytest
|
||||
|
@ -41,3 +41,17 @@ test:
|
|||
artifacts:
|
||||
reports:
|
||||
cobertura: coverage.xml
|
||||
|
||||
deploy:
|
||||
stage: deploy
|
||||
tags:
|
||||
- secure
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "docker-deploy"
|
||||
script:
|
||||
- pacman -Syu --noconfirm docker-compose socat openssh
|
||||
- chmod 600 ${SSH_KEY}
|
||||
- socat "UNIX-LISTEN:/tmp/docker.sock,reuseaddr,fork" EXEC:"ssh -o UserKnownHostsFile=${SSH_KNOWN_HOSTS} -Ti ${SSH_KEY} ${SSH_USER}@${SSH_HOST}" &
|
||||
- export DOCKER_HOST="unix:///tmp/docker.sock"
|
||||
- docker-compose build
|
||||
- docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
|
||||
|
|
Loading…
Add table
Reference in a new issue