This repository has been archived by the owner on Nov 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(GITHUB): reorder, upgrade action versions
- Loading branch information
1 parent
c678219
commit 4cf0077
Showing
11 changed files
with
308 additions
and
223 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -8,8 +8,15 @@ | |
"author": "Niall Byrne", | ||
"company": "Shared Vision Solutions", | ||
"email": "[email protected]", | ||
"_BRANCH_NAME_BASE": "master", | ||
"_BRANCH_NAME_DEVELOPMENT": "dev", | ||
"_GITHUB_CI_PYTHON_VERSIONS": ["3.9"], | ||
"_GITHUB_ACTION_MARKDOWN_LINK_CHECK": "gaurav-nelson/[email protected]", | ||
"_GITHUB_GITLEAKS_ACTION": "zricethezav/[email protected]", | ||
"_GITHUB_PUSH_ACTION": "ad-m/[email protected]" | ||
"_GITHUB_ACTION_CACHE": "actions/cache@v3", | ||
"_GITHUB_ACTION_CHECKOUT": "actions/checkout@v3", | ||
"_GITHUB_ACTION_GITLEAKS": "zricethezav/[email protected]", | ||
"_GITHUB_ACTION_MARKDOWN_LINK_CHECK": "gaurav-nelson/github-action-markdown-link-check@v1", | ||
"_GITHUB_ACTION_PYTHON": "actions/setup-python@v4", | ||
"_GITHUB_ACTION_SCRIPT": "actions/github-script@v6", | ||
"_GITHUB_ACTION_TRUFFLEHOG": "trufflesecurity/[email protected]", | ||
"_GITHUB_ACTION_YAMLLINT": "ibiqlik/action-yamllint@v3" | ||
} |
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 |
---|---|---|
@@ -1,33 +1,55 @@ | ||
#!/bin/bash | ||
|
||
# hooks/post_gen_project.sh | ||
# Configures the templated profile for use. | ||
|
||
# ANSIBLE_WORKBENCH_BRANCH_NAME_BASE: Optional alternate base branch name. | ||
# ANSIBLE_WORKBENCH_BRANCH_NAME_DEVELOPMENT: Optional alternate development branch name. | ||
# ANSIBLE_WORKBENCH_SKIP_POETRY: Optionally set to 1 to skip installing dependencies. | ||
|
||
# cookiecutter only script. | ||
|
||
ANSIBLE_WORKBENCH_BRANCH_NAME_BASE="${ANSIBLE_WORKBENCH_BRANCH_NAME_BASE-"{{ cookiecutter._BRANCH_NAME_BASE }}"}" | ||
ANSIBLE_WORKBENCH_BRANCH_NAME_DEVELOPMENT="${ANSIBLE_WORKBENCH_BRANCH_NAME_DEVELOPMENT-"{{ cookiecutter._BRANCH_NAME_DEVELOPMENT }}"}" | ||
ANSIBLE_WORKBENCH_TEMPLATE_URL="https://github.com/niall-byrne/ansible-workbench.git" | ||
|
||
initialize_git() { | ||
|
||
git init | ||
git checkout -b master | ||
git checkout -b "${ANSIBLE_WORKBENCH_BRANCH_NAME_BASE}" | ||
git stage . | ||
git commit -m "build(COOKIECUTTER): initial generation" | ||
git symbolic-ref HEAD refs/heads/master | ||
git symbolic-ref HEAD "refs/heads/${ANSIBLE_WORKBENCH_BRANCH_NAME_BASE}" | ||
git tag v0.0.0 | ||
git checkout -b production | ||
git checkout master | ||
git checkout -b "${ANSIBLE_WORKBENCH_BRANCH_NAME_DEVELOPMENT}" | ||
mkdir -p files templates | ||
|
||
} | ||
|
||
initialize_poetry() { | ||
if [[ -z "$(poetry env list)" ]]; then | ||
|
||
if [[ "${ANSIBLE_WORKBENCH_SKIP_POETRY}" != "1" ]]; then | ||
poetry install | ||
fi | ||
|
||
} | ||
|
||
update_template_values() { | ||
# Compatible with Linux and BSD sed | ||
sed -i.bak 's/ansible-workbench\//https:\/\/github.com\/niall-byrne\/ansible-workbench.git/' .cookiecutter/cookiecutter.json | ||
rm .cookiecutter/cookiecutter.json.bak | ||
|
||
if ! grep "${ANSIBLE_WORKBENCH_TEMPLATE_URL}" .cookiecutter/cookiecutter.json; then | ||
# sed compatible with Linux and BSD | ||
sed -i.bak 's,"_template": ".*","_template": "'"${ANSIBLE_WORKBENCH_TEMPLATE_URL}"'",g' .cookiecutter/cookiecutter.json | ||
rm .cookiecutter/cookiecutter.json.bak | ||
fi | ||
|
||
} | ||
|
||
main() { | ||
|
||
update_template_values | ||
initialize_git | ||
initialize_poetry | ||
|
||
} | ||
|
||
main |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# scripts/test.sh | ||
# Templates and builds the example role with default values for testing. | ||
|
||
# Development only script. | ||
|
||
set -eo pipefail | ||
|
||
main() { | ||
|
||
rm -rf ../flower-generator | ||
|
||
pushd .. | ||
echo -e "\n\n\n\n\n\n\n\n\n" | cookiecutter ansible-workbench | ||
cd flower-generator | ||
echo -e "\nExit from this shell when finished testing ..." | ||
bash | ||
popd | ||
|
||
} | ||
|
||
main "$@" |
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
17 changes: 15 additions & 2 deletions
17
{{cookiecutter.project_slug}}/.github/config/markdown.link.check.json
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 |
---|---|---|
@@ -1,7 +1,20 @@ | ||
{ | ||
"httpHeaders": [ | ||
{ | ||
"urls": [ | ||
"https://github.com/", | ||
"https://guides.github.com/", | ||
"https://help.github.com/", | ||
"https://docs.github.com/" | ||
], | ||
"headers": { | ||
"Accept-Encoding": "zstd, br, gzip, deflate" | ||
} | ||
} | ||
], | ||
"ignorePatterns": [ | ||
{ | ||
"pattern": "^https://docs.github.com/" | ||
"pattern": "^https://github.com/{{cookiecutter.github_handle}}/{{cookiecutter.project_slug}}/" | ||
} | ||
] | ||
} | ||
} |
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
Oops, something went wrong.