This repository has been archived by the owner on Mar 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from cloudalchemy/skeleton
[REPO SYNC] Merge pull request #9 from cloudalchemy/superq/more_updates
- Loading branch information
Showing
6 changed files
with
33 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,17 @@ executors: | |
python: | ||
docker: | ||
- image: cimg/python:3.9 | ||
publisher: | ||
docker: | ||
- image: quay.io/cloudalchemy/publisher:latest | ||
|
||
jobs: | ||
lint: | ||
executor: python | ||
steps: | ||
- checkout | ||
- run: pip install ansible-lint yamllint flake8 | ||
- run: pip install ansible ansible-lint yamllint flake8 | ||
- run: mkdir -p .cache/roles && ln -s ../.. .cache/roles/${CIRCLE_PROJECT_REPONAME} | ||
- run: ansible-lint | ||
- run: yamllint . | ||
- run: flake8 | ||
|
@@ -21,70 +25,34 @@ jobs: | |
parameters: | ||
ansible: | ||
type: string | ||
environment: | ||
ANSIBLE: "<< parameters.ansible >>" | ||
steps: | ||
- checkout | ||
- setup_remote_docker | ||
- run: ln -s ~/project ~/${CIRCLE_PROJECT_REPONAME} | ||
- run: pip install "ansible~=<<parameters.ansible >>.0" | ||
- run: pip install -r test-requirements.txt | ||
- run: molecule test -s default --destroy always | ||
- run: | | ||
if [[ -d 'molecule/alternative' ]]; then | ||
molecule test -s alternative --destroy never | ||
molecule test -s alternative --destroy always | ||
else | ||
echo 'No alternative test' | ||
fi | ||
- run: | | ||
if [[ -z "${CIRCLE_PULL_REQUEST}" ]]; then | ||
molecule test -s latest --destroy never | ||
if [[ -z "${CIRCLE_PULL_REQUEST}" ]] && [[ -d 'molecule/latest' ]]; then | ||
molecule test -s latest --destroy always | ||
else | ||
echo 'Not running latest on PR' | ||
fi | ||
release: | ||
executor: python | ||
environment: | ||
GIT_MAIL: [email protected] | ||
GIT_USER: cloudalchemybot | ||
GIT_COMMIT_DESC: git log --format=%B -n 1 ${CIRCLE_SHA1} | ||
executor: publisher | ||
steps: | ||
- checkout | ||
- setup_remote_docker | ||
- run: pip install git-semver | ||
- run: git config --global user.email "${GIT_MAIL}" | ||
- run: git config --global user.name "${GIT_USER}" | ||
- run: | | ||
GIT_TAG=none | ||
echo "Last commit message: ${GIT_COMMIT_DESC}" | ||
case "${GIT_COMMIT_DESC}" in | ||
*"[patch]"*|*"[fix]"*|*"[bugfix]"* ) GIT_TAG=$(git semver --next-patch) ;; | ||
*"[minor]"*|*"[feat]"*|*"[feature]"* ) GIT_TAG=$(git semver --next-minor) ;; | ||
*"[major]"*|*"[breaking change]"* ) GIT_TAG=$(git semver --next-major) ;; | ||
*) echo "Keyword not detected. Doing nothing" && circleci-agent step halt ;; | ||
esac | ||
echo "GIT_TAG=${GIT_TAG}" >> $BASH_ENV | ||
- run: | | ||
docker run -it --rm \ | ||
-v "${CIRCLE_WORKING_DIRECTORY}:/role" \ | ||
-w "/role" \ | ||
ferrarimarco/github-changelog-generator:1.15.2 \ | ||
--user "${CIRCLE_PROJECT_USERNAME}" \ | ||
--project "${CIRCLE_PROJECT_REPONAME}" \ | ||
--token "${GH_TOKEN}" \ | ||
--release-url "https://galaxy.ansible.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME#ansible-}" \ | ||
--unreleased-label "**Next release**" --no-compare-link \ | ||
--future-release "${GIT_TAG}" | ||
- run: git add CHANGELOG.md | ||
- run: git commit -m "[ci skip] Automatic changelog update" | ||
- run: git push "https://${GH_TOKEN}:@${GIT_URL}" || circleci-agent step halt | ||
- run: | | ||
ghr \ | ||
-t ${GH_TOKEN} \ | ||
-u ${CIRCLE_PROJECT_USERNAME} \ | ||
-r ${CIRCLE_PROJECT_REPONAME} \ | ||
-n ${GIT_TAG} \ | ||
-b "$(sed -n -e '/## \[0.22.0\]/,/## \[/ p' CHANGELOG.md | sed -e '$ d')" \ | ||
${GIT_TAG} | ||
PROJECT_USERNAME="${CIRCLE_PROJECT_USERNAME}" \ | ||
PROJECT_REPONAME="${CIRCLE_PROJECT_REPONAME}" \ | ||
create_release | ||
galaxy: | ||
executor: python | ||
steps: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters