61 lines
1.9 KiB
YAML
61 lines
1.9 KiB
YAML
---
|
|
stages:
|
|
- deploy
|
|
|
|
# TODO: research and add a suitable WorkFlow.
|
|
|
|
variables:
|
|
ANSIBLE_FORCE_COLOR: "True"
|
|
INVENTORY: ${CI_PROJECT_DIR}/ansible/inventory/free-flow/hosts
|
|
PLEROMA_PLAYBOOK_DIRECTORY: /ansible/pleroma-playbook
|
|
PLEROMA_INFRASTRUCTURE_DIRECTORY: ${CI_PROJECT_DIR}
|
|
VAULT_AUTH_METHOD: approle
|
|
|
|
image: registry.gitlab.com/dananglin/pleroma-ansible-playbook:v0.1.3
|
|
|
|
before_script:
|
|
- .gitlab/ci/bin/generate-inventory
|
|
- .gitlab/ci/bin/update-config-for-testing
|
|
- cd ${PLEROMA_PLAYBOOK_DIRECTORY}
|
|
|
|
deploy:testing:
|
|
environment:
|
|
name: ${PLEROMA_ENVIRONMENT}
|
|
url: ${TESTING_PLEROMA_FQDN}
|
|
rules:
|
|
- if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "testing" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
|
|
when: always
|
|
script:
|
|
- "make pleroma"
|
|
stage: deploy
|
|
tags:
|
|
- pleroma-ansible-testing
|
|
variables:
|
|
EXTRA_ARGS: "--extra-vars enable_pleroma_upgrade=True"
|
|
PLEROMA_ENVIRONMENT: testing
|
|
PLEROMA_ANSIBLE_HOST: ${TESTING_PLEROMA_ANSIBLE_HOST}
|
|
PLEROMA_ANSIBLE_USER: ${TESTING_PLEROMA_ANSIBLE_USER}
|
|
PLEROMA_ANSIBLE_PASSWORD: ${TESTING_PLEROMA_ANSIBLE_PASSWORD}
|
|
VAULT_ROLE_ID: ${TESTING_VAULT_ROLE_ID}
|
|
VAULT_SECRET_ID: ${TESTING_VAULT_SECRET_ID}
|
|
|
|
deploy:production:
|
|
environment:
|
|
name: ${PLEROMA_ENVIRONMENT}
|
|
url: https://fedi.dananglin.me.uk
|
|
rules:
|
|
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PROJECT_PATH == "dananglin/pleroma-platform"'
|
|
when: always
|
|
script:
|
|
- "make pleroma"
|
|
stage: deploy
|
|
tags:
|
|
- pleroma-ansible-production
|
|
variables:
|
|
ANSIBLE_PRIVATE_KEY_FILE: ${PRODUCTION_PLEROMA_ANSIBLE_PRIVATE_KEY_FILE}
|
|
EXTRA_ARGS: "--extra-vars enable_pleroma_upgrade=True"
|
|
PLEROMA_ENVIRONMENT: production
|
|
PLEROMA_ANSIBLE_HOST: ${PRODUCTION_PLEROMA_ANSIBLE_HOST}
|
|
PLEROMA_ANSIBLE_USER: ${PRODUCTION_PLEROMA_ANSIBLE_USER}
|
|
VAULT_ROLE_ID: ${PRODUCTION_PLEROMA_VAULT_ROLE_ID}
|
|
VAULT_SECRET_ID: ${PRODUCTION_PLEROMA_VAULT_SECRET_ID}
|