symposion_app/.gitlab-ci.yml
2022-12-08 00:08:54 +10:00

83 lines
2.1 KiB
YAML

stages:
- build
- deploy
variables:
DOCKER_TLS_CERTDIR: "/certs"
CONTAINER_PREFIX: 2023
CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/$CONTAINER_PREFIX:$CI_COMMIT_SHA
build-image:
image: docker:git
stage: build
services:
- docker:dind
script:
- apk update && apk add git
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build --pull -f docker/Dockerfile -t $CONTAINER_IMAGE .
- docker push $CONTAINER_IMAGE
only:
- conf/2023
k8s-deploy-staging:
image: google/cloud-sdk
stage: deploy
script:
- echo "${CA_CERT}" > cert.crt
- kubectl config set-cluster cluster --server="${KUBE_SERVER}" --embed-certs=true --certificate-authority=cert.crt
- kubectl config set-context cluster --cluster=cluster --namespace=eo2023-staging --user=gitlab-ci
- kubectl config use-context cluster
- kubectl --token "${KUBE_TOKEN}" set image deployment/symposion-app symposion-app=$CONTAINER_IMAGE
when: manual
only:
- dev/2023
environment:
name: 2023/staging
url: https://staging-eo2023.osaconftools.net/
k8s-deploy-prod:
image: google/cloud-sdk
stage: deploy
script:
- echo "${CA_CERT}" > cert.crt
- kubectl config set-cluster cluster --server="${KUBE_SERVER}" --embed-certs=true --certificate-authority=cert.crt
- kubectl config set-context cluster --cluster=cluster --namespace=eo2023-prod --user=gitlab-ci
- kubectl config use-context cluster
- kubectl --token "${KUBE_TOKEN}" set image deployment/symposion-app symposion-app=$CONTAINER_IMAGE
when: manual
only:
- conf/2023
environment:
name: 2023/prod
url: https://2023.everythingopen.au/
.docs_template: &sphinx
image: alpine
script:
- apk --no-cache add py3-pip python3-dev make
- pip install sphinx
- cd docs
- make html
- cd ..
- mv docs/_build/html public
artifacts:
paths:
- public
pages:
<<: *sphinx
stage: build
only:
- master
- conf/2023
environment:
name: docs
url: https://laconfdev.gitlab.io/symposion_app/
build-sphinx:
<<: *sphinx
stage: build
except:
- master
- conf/2023