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

Commit cb89fa5

Browse files
authored
Merge pull request #9 from cloudalchemy/skeleton
[REPO SYNC] Merge pull request #9 from cloudalchemy/superq/more_updates
2 parents b56c8ab + 8a495c2 commit cb89fa5

File tree

7 files changed

+33
-82
lines changed

7 files changed

+33
-82
lines changed

Diff for: .circleci/config.yml

+14-46
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
49-
GIT_COMMIT_DESC: git log --format=%B -n 1 ${CIRCLE_SHA1}
48+
executor: publisher
5049
steps:
5150
- checkout
52-
- setup_remote_docker
53-
- run: pip install git-semver
54-
- run: git config --global user.email "${GIT_MAIL}"
55-
- run: git config --global user.name "${GIT_USER}"
5651
- run: |
57-
GIT_TAG=none
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:

Diff for: .github/labeler.yml

+3-3
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/*

Diff for: .mergify.yml

+4
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: {}

Diff for: .yamllint

-2
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

Diff for: CONTRIBUTING.md

+9-8
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

Diff for: README.md

+3-18
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,11 @@ Use it in a playbook as follows:
3636
3737
## Local Testing
3838
39-
The preferred way of locally testing the role is to use Docker and [molecule](https://github.com/metacloud/molecule) (v2.x). You will have to install Docker on your system. See "Get started" for a Docker package suitable to for your system.
40-
We are using tox to simplify process of testing on multiple ansible versions. To install tox execute:
41-
```sh
42-
pip3 install tox
43-
```
44-
To run tests on all ansible versions (WARNING: this can take some time)
45-
```sh
46-
tox
47-
```
48-
To run a custom molecule command on custom environment with only default test scenario:
49-
```sh
50-
tox -e py35-ansible28 -- molecule test -s default
51-
```
52-
For more information about molecule go to their [docs](http://molecule.readthedocs.io/en/latest/).
53-
54-
If you would like to run tests on remote docker host just specify `DOCKER_HOST` variable before running tox tests.
39+
The preferred way of locally testing the role is to use Docker and [molecule](https://github.com/ansible-community/molecule) (v3.x). You will have to install Docker on your system. See "Get started" for a Docker package suitable to for your system. Running your tests is as simple as executing `molecule test`.
5540

56-
## Travis CI
41+
## Continuous Intergation
5742

58-
Combining molecule and travis CI allows us to test how new PRs will behave when used with multiple ansible versions and multiple operating systems. This also allows use to create test scenarios for different role configurations. As a result we have a quite large test matrix which will take more time than local testing, so please be patient.
43+
Combining molecule and circle CI allows us to test how new PRs will behave when used with multiple ansible versions and multiple operating systems. This also allows use to create test scenarios for different role configurations. As a result we have a quite large test matrix which can take more time than local testing, so please be patient.
5944

6045
## Contributing
6146

Diff for: molecule/default/molecule.yml

-5
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)