Skip to content
This repository was archived by the owner on Nov 12, 2023. It is now read-only.

Commit 8bbad6f

Browse files
authored
Merge pull request #1 from cloudalchemy/skeleton
[REPO SYNC] Merge pull request #9 from cloudalchemy/superq/more_updates
2 parents 5a8975f + 60ab20c commit 8bbad6f

File tree

8 files changed

+34
-68
lines changed

8 files changed

+34
-68
lines changed

.ansible-lint

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
skip_list:
3-
- '106'
4-
- '204'
5-
- '208'
3+
- '106'
4+
- '204'
5+
- '208'

.circleci/config.yml

Lines changed: 14 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@ executors:
55
python:
66
docker:
77
- image: cimg/python:3.9
8+
publisher:
9+
docker:
10+
- image: quay.io/cloudalchemy/publisher:latest
811

912
jobs:
1013
lint:
1114
executor: python
1215
steps:
1316
- checkout
14-
- run: pip install ansible-lint yamllint flake8
17+
- run: pip install ansible ansible-lint yamllint flake8
18+
- run: mkdir -p .cache/roles && ln -s ../.. .cache/roles/${CIRCLE_PROJECT_REPONAME}
1519
- run: ansible-lint
1620
- run: yamllint .
1721
- run: flake8
@@ -21,70 +25,34 @@ jobs:
2125
parameters:
2226
ansible:
2327
type: string
24-
environment:
25-
ANSIBLE: "<< parameters.ansible >>"
2628
steps:
2729
- checkout
2830
- setup_remote_docker
2931
- run: ln -s ~/project ~/${CIRCLE_PROJECT_REPONAME}
32+
- run: pip install "ansible~=<<parameters.ansible >>.0"
3033
- run: pip install -r test-requirements.txt
3134
- run: molecule test -s default --destroy always
3235
- run: |
3336
if [[ -d 'molecule/alternative' ]]; then
34-
molecule test -s alternative --destroy never
37+
molecule test -s alternative --destroy always
3538
else
3639
echo 'No alternative test'
3740
fi
3841
- run: |
39-
if [[ -z "${CIRCLE_PULL_REQUEST}" ]]; then
40-
molecule test -s latest --destroy never
42+
if [[ -z "${CIRCLE_PULL_REQUEST}" ]] && [[ -d 'molecule/latest' ]]; then
43+
molecule test -s latest --destroy always
4144
else
4245
echo 'Not running latest on PR'
4346
fi
4447
release:
45-
executor: python
46-
environment:
47-
48-
GIT_USER: cloudalchemybot
48+
executor: publisher
4949
steps:
5050
- checkout
51-
- setup_remote_docker
52-
- run: pip install git-semver
53-
- run: git config --global user.email "${GIT_MAIL}"
54-
- run: git config --global user.name "${GIT_USER}"
5551
- run: |
56-
GIT_TAG=none
57-
GIT_COMMIT_DESC=$(git log --format=%B -n 1 ${CIRCLE_SHA1})
58-
echo "Last commit message: ${GIT_COMMIT_DESC}"
59-
case "${GIT_COMMIT_DESC}" in
60-
*"[patch]"*|*"[fix]"*|*"[bugfix]"* ) GIT_TAG=$(git semver --next-patch) ;;
61-
*"[minor]"*|*"[feat]"*|*"[feature]"* ) GIT_TAG=$(git semver --next-minor) ;;
62-
*"[major]"*|*"[breaking change]"* ) GIT_TAG=$(git semver --next-major) ;;
63-
*) echo "Keyword not detected. Doing nothing" && circleci-agent step halt ;;
64-
esac
65-
echo "GIT_TAG=${GIT_TAG}" >> $BASH_ENV
66-
- run: |
67-
docker run -it --rm \
68-
-v "${CIRCLE_WORKING_DIRECTORY}:/role" \
69-
-w "/role" \
70-
ferrarimarco/github-changelog-generator:1.15.2 \
71-
--user "${CIRCLE_PROJECT_USERNAME}" \
72-
--project "${CIRCLE_PROJECT_REPONAME}" \
73-
--token "${GH_TOKEN}" \
74-
--release-url "https://galaxy.ansible.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME#ansible-}" \
75-
--unreleased-label "**Next release**" --no-compare-link \
76-
--future-release "${GIT_TAG}"
77-
- run: git add CHANGELOG.md
78-
- run: git commit -m "[ci skip] Automatic changelog update"
79-
- run: git push "https://${GH_TOKEN}:@${GIT_URL}" || circleci-agent step halt
80-
- run: |
81-
ghr \
82-
-t ${GH_TOKEN} \
83-
-u ${CIRCLE_PROJECT_USERNAME} \
84-
-r ${CIRCLE_PROJECT_REPONAME} \
85-
-n ${GIT_TAG} \
86-
-b "$(sed -n -e '/## \[0.22.0\]/,/## \[/ p' CHANGELOG.md | sed -e '$ d')" \
87-
${GIT_TAG}
52+
PROJECT_USERNAME="${CIRCLE_PROJECT_USERNAME}" \
53+
PROJECT_REPONAME="${CIRCLE_PROJECT_REPONAME}" \
54+
create_release
55+
8856
galaxy:
8957
executor: python
9058
steps:

.github/labeler.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ area/docs:
44
- meta/*
55
- CHANGELOG.md
66
- CONTRIBUTING.md
7+
- TROUBLESHOOTING.md
78
- LICENSE
89
- README.md
910
area/tests:
1011
- molecule/*
1112
- molecule/**/*
1213
- .ansible-lint
14+
- .yamllint
1315
- test-requirements.txt
14-
- tox.ini
1516
area/automation:
16-
- .travis/*
17+
- .circleci/*
1718
- .github/*
1819
- .github/**/*
19-
- .travis.yml
2020
- .mergify.yml
2121
area/vars:
2222
- defaults/*

.mergify.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ pull_request_rules:
1010
merge:
1111
method: squash
1212
strict: true
13+
- name: delete head branch after merge
14+
conditions: []
15+
actions:
16+
delete_head_branch: {}

.yamllint

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
extends: default
33
ignore: |
4-
.travis/
5-
.travis.yml
64
.github/
75
meta/
86

CONTRIBUTING.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ Some great guidelines can be found [here](https://wiki.openstack.org/wiki/GitCom
3434
## Releases
3535

3636
We try to stick to semantic versioning and our releases are automated. Release is created by assigning a keyword (in a
37-
way similar to travis [`[ci skip]`](https://docs.travis-ci.com/user/customizing-the-build#Skipping-a-build)) to a
38-
commit with merge request. Available keywords are (square brackets are important!):
37+
way similar to circle ci keyword [`[ci skip]`](https://docs.travis-ci.com/user/customizing-the-build#Skipping-a-build))
38+
to a commit with merge request. Available keywords are (square brackets are important!):
3939

40-
* `[patch]`, `[fix]` - for PATCH version release
40+
* `[patch]`, `[fix]`, `[bugfix]` - for PATCH version release
4141
* `[minor]`, `[feature]`, `[feat]` - for MINOR version release
4242
* `[major]`, `[breaking change]` - for MAJOR version release
4343

4444
## Changelog
4545

46-
Changelog is generateg automatically on every merged Pull Request and all information is taken from github issues, PRs
47-
and labels.
46+
Changelog is generated automatically during release process and all information is taken from github issues, PRs and
47+
labels.
4848

4949
## Expectations
5050

@@ -78,8 +78,9 @@ More information about:
7878
Please follow [ansible best practices](http://docs.ansible.com/ansible/latest/playbooks_best_practices.html) and
7979
especially provide meaningful names to tasks and even comments where needed.
8080

81-
Our test framework automatically lints code with [`yamllint`](https://yamllint.readthedocs.io) and
82-
[`ansible-lint`](https://github.com/willthames/ansible-lint) programs so be sure to follow their rules.
81+
Our test framework automatically lints code with [`yamllint`](https://github.com/adrienverge/yamllint),
82+
[`ansible-lint`](https://github.com/willthames/ansible-lint), and [`flake8`](https://gitlab.com/pycqa/flake8) programs
83+
so be sure to follow their rules.
8384

8485
Remember: Code is generally read much more often than written.
8586

@@ -92,6 +93,6 @@ Wherever possible, please refrain from any other formats and stick to simple mar
9293
We are trying to create the best and most secure installation method for non-containerized prometheus stack components.
9394
To accomplish this all roles need to support:
9495

95-
- current and at least one previous ansible version (wherever possible we try to support 2 previous ansible versions)
96+
- current and at least one previous ansible version
9697
- systemd as the only available process manager
9798
- at least latest debian and CentOS distributions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Deploy prometheus [systemd exporter](https://github.com/povilasv/systemd_exporte
1313

1414
## Requirements
1515

16-
- Ansible >= 2.8 (It might work on previous versions, but we cannot guarantee it)
16+
- Ansible >= 2.7 (It might work on previous versions, but we cannot guarantee it)
1717
- gnu-tar on Mac deployer host (`brew install gnu-tar`)
1818

1919
## Role Variables

molecule/default/molecule.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ dependency:
33
name: galaxy
44
driver:
55
name: docker
6-
# lint: |
7-
# set -e
8-
# yamllint .
9-
# ansible-lint
10-
# flake8
116
platforms:
127
- name: bionic
138
pre_build_image: true

0 commit comments

Comments
 (0)