This repository has been archived by the owner on Mar 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 393
/
release.yml
93 lines (93 loc) · 2.51 KB
/
release.yml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
- hosts: localhost
gather_facts: no
vars:
cwd: "{{ lookup('env', 'PWD') }}"
tasks:
- name: Get version tag
command: python -c "import container, sys; sys.stdout.write(container.__version__)"
register: container_version_result
tags:
- always
- name: Register version tag
set_fact:
ansible_container_version: "{{ container_version_result.stdout }}"
tags:
- always
- name: Build pre-baked Conductor bases
command: python setup.py prebake
tags:
- prebake
- name: Build distribution
command: python setup.py sdist
tags:
- test
- release
- name: Make tempdir for tests
tempfile:
path: "/tmp"
state: directory
notify: Cleanup tempdir
tags:
- test
register: tempdir
- name: Make virtualenv for tests
command: virtualenv "{{ tempdir.path }}/venv"
tags:
- test
- name: Make tmp/src dir
file:
name: "{{ tempdir.path }}/src"
state: directory
tags:
- test
- name: Unarchive the sdist
command: "tar -xzf {{ cwd }}/dist/ansible-container-{{ ansible_container_version }}.tar.gz"
args:
chdir: "{{ tempdir.path }}/src"
tags:
- test
- name: Install from sdist
command: "{{ tempdir.path }}/venv/bin/pip install -e .[docker]"
args:
chdir: "{{ tempdir.path }}/src/ansible-container-{{ ansible_container_version }}"
tags:
- test
- name: Install ansible
command: "{{ tempdir.path }}/venv/bin/pip install ansible>=2.3"
tags:
- test
- name: Run full test suite
command: "{{ tempdir.path }}/venv/bin/ansible-playbook -vvv test/run_tests.yml"
args:
chdir: "{{ cwd }}"
environment:
TMPDIR: /tmp
tags:
- test
- name: Preflight checks [git branch]
command: git rev-parse --abbrev-ref HEAD
register: git_branch
tags:
- release
- name: Preflight checks
assert:
that:
- "{{ git_branch.stdout }} == 'master'"
tags:
- release
- name: Confirm release
pause:
prompt: >
Are you sure you want to release Ansible Container
{{ ansible_container_version }} to PyPI?
tags:
- release
- name: Upload to PyPI
command: python setup.py upload
tags:
- release
handlers:
- name: Cleanup tempdir
file:
path: "{{ tempdir.path }}"
state: absent