2018-08-15 00:49:40 +02:00
|
|
|
stages:
|
|
|
|
- pages
|
|
|
|
- calendar
|
|
|
|
- deploy
|
|
|
|
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- ~/.cache/pip/
|
2018-08-15 10:46:19 +02:00
|
|
|
- public/
|
2018-08-15 00:49:40 +02:00
|
|
|
|
|
|
|
variables:
|
|
|
|
GIT_SUBMODULE_STRATEGY: recursive
|
|
|
|
|
|
|
|
build_pages:
|
|
|
|
image: "golang:1.10-alpine3.8"
|
2018-08-15 00:50:57 +02:00
|
|
|
stage: pages
|
2018-08-15 00:49:40 +02:00
|
|
|
variables:
|
|
|
|
SHELL: "/bin/sh"
|
2018-08-16 22:09:39 +02:00
|
|
|
artifacts:
|
2019-03-14 23:01:32 +01:00
|
|
|
expire_in: "1 week"
|
2018-08-16 22:09:39 +02:00
|
|
|
untracked: true
|
2018-08-15 00:49:40 +02:00
|
|
|
script:
|
2019-08-14 00:51:17 +02:00
|
|
|
- rm -rf public/*
|
2018-08-15 00:49:40 +02:00
|
|
|
- apk add --no-cache --upgrade hugo
|
2019-03-13 23:45:59 +01:00
|
|
|
- hugo $(cat .hugo-params)
|
2018-08-15 00:49:40 +02:00
|
|
|
|
|
|
|
build_calendar:
|
2023-01-28 20:55:09 +01:00
|
|
|
image: "python:3.11.1-alpine3.17"
|
2018-08-15 00:49:40 +02:00
|
|
|
stage: calendar
|
2018-08-16 22:09:39 +02:00
|
|
|
dependencies:
|
2018-08-16 22:11:01 +02:00
|
|
|
- build_pages
|
2018-08-16 22:09:39 +02:00
|
|
|
artifacts:
|
2019-03-14 23:01:32 +01:00
|
|
|
expire_in: "1 week"
|
2018-08-16 22:09:39 +02:00
|
|
|
untracked: true
|
2018-08-15 00:49:40 +02:00
|
|
|
variables:
|
|
|
|
SHELL: "/bin/sh"
|
|
|
|
script:
|
|
|
|
- apk --no-cache update
|
|
|
|
- pip install -r requirements.txt
|
|
|
|
- python tools/merge_cals.py
|
2018-08-16 23:22:24 +02:00
|
|
|
- cp static/all.ics public/all.ics
|
2019-08-14 00:32:02 +02:00
|
|
|
- upcoming="$(python tools/gen_upcoming.py static/all.ics 20 5|tr '\n' ' ')" && sed -i "s#CALENDAR#$upcoming#g" public/index.html
|
2018-08-15 00:49:40 +02:00
|
|
|
|
|
|
|
deploy_staging:
|
2023-01-28 20:08:58 +01:00
|
|
|
image: "alpine:3.17"
|
2018-08-15 00:49:40 +02:00
|
|
|
stage: deploy
|
2018-08-16 22:09:39 +02:00
|
|
|
dependencies:
|
2018-08-16 22:11:01 +02:00
|
|
|
- build_calendar
|
2018-08-15 00:49:40 +02:00
|
|
|
variables:
|
|
|
|
SHELL: "/bin/sh"
|
|
|
|
script:
|
2018-08-16 22:53:05 +02:00
|
|
|
- apk --no-cache --upgrade add openssh-client rsync
|
|
|
|
- mkdir -p ~/.ssh
|
|
|
|
- eval $(ssh-agent -s)
|
|
|
|
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
|
2018-08-16 22:57:53 +02:00
|
|
|
- echo "$PRIVATE_KEY" | ssh-add -
|
2021-07-01 15:34:06 +02:00
|
|
|
- rsync -e "ssh -l deploy -p 31337" -av --delete public/ 195.160.173.9:staging
|
2018-08-15 00:49:40 +02:00
|
|
|
when: on_success
|
|
|
|
environment:
|
|
|
|
name: staging
|
|
|
|
url: https://staging.berlin.ccc.de/
|
|
|
|
artifacts:
|
2019-03-14 23:01:32 +01:00
|
|
|
expire_in: "1 week"
|
2018-08-15 00:49:40 +02:00
|
|
|
paths:
|
|
|
|
- public/
|
2018-08-16 23:38:10 +02:00
|
|
|
only:
|
|
|
|
- staging
|
|
|
|
|
|
|
|
deploy_production:
|
2023-01-28 20:08:58 +01:00
|
|
|
image: "alpine:3.17"
|
2018-08-16 23:38:10 +02:00
|
|
|
stage: deploy
|
|
|
|
dependencies:
|
|
|
|
- build_calendar
|
|
|
|
variables:
|
|
|
|
SHELL: "/bin/sh"
|
|
|
|
script:
|
|
|
|
- apk --no-cache --upgrade add openssh-client rsync
|
|
|
|
- mkdir -p ~/.ssh
|
|
|
|
- eval $(ssh-agent -s)
|
|
|
|
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
|
|
|
|
- echo "$PRIVATE_KEY" | ssh-add -
|
2021-07-01 15:34:41 +02:00
|
|
|
- rsync -e "ssh -l deploy -p 31337" -av --delete public/ 195.160.173.9:production
|
2018-08-16 23:38:10 +02:00
|
|
|
when: on_success
|
|
|
|
environment:
|
2018-08-17 00:07:17 +02:00
|
|
|
name: production
|
2018-08-16 23:38:10 +02:00
|
|
|
url: https://berlin.ccc.de/
|
|
|
|
artifacts:
|
2019-03-14 23:01:32 +01:00
|
|
|
expire_in: "1 week"
|
2018-08-16 23:38:10 +02:00
|
|
|
paths:
|
|
|
|
- public/
|
|
|
|
only:
|
2018-08-16 23:42:37 +02:00
|
|
|
- production
|
2018-08-15 00:49:40 +02:00
|
|
|
|