forked from packit/deployment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·52 lines (40 loc) · 1.64 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
.PHONY: send-release-event deploy tags cleanup zuul-secrets move-stable
ANSIBLE_PYTHON ?= $(shell command -v /usr/bin/python3 2> /dev/null || echo /usr/bin/python2)
CONT_HOME := /opt/app-root/src
AP := ansible-playbook -vv -c local -i localhost, -e ansible_python_interpreter=$(ANSIBLE_PYTHON)
# "By default, Ansible runs as if --tags all had been specified."
# https://docs.ansible.com/ansible/latest/user_guide/playbooks_tags.html#special-tags
TAGS ?= all
ifneq "$(shell whoami)" "root"
ASK_PASS ?= --ask-become-pass
endif
# Only for Packit team members with access to Bitwarden vault
download-secrets:
./scripts/download_secrets.sh
# Mimic what we do during deployment when we render secret files
# from their templates before we create k8s secrets from them.
render-secrets-from-templates:
./scripts/render_secrets_from_templates.sh
# If you're sure you want to skip the secrets downloading,
# because for example you just did it and you don't want to wait for it again
# just set SKIP_SECRETS_SYNC or SSS to any value.
deploy: download-secrets
$(AP) playbooks/deploy.yml --tags $(TAGS)
tags:
$(AP) playbooks/deploy.yml --list-tags
cleanup:
$(AP) playbooks/cleanup.yml
# Import newer images from registry.
# Causes re-deployment of components with newer image available.
import-images:
$(AP) playbooks/import-images.yml
zuul-secrets:
$(AP) playbooks/zuul-secrets.yml
generate-local-secrets:
$(AP) $(ASK_PASS) playbooks/generate-local-secrets.yml
# Check whether everything has been deployed OK with 'make deploy'
check:
$(AP) playbooks/check.yml
move-stable:
[[ -d move_stable_repositories ]] || scripts/move_stable.py init
scripts/move_stable.py move-all