Merge branch 'development' into 'master'
build: release v0.7.0 See merge request nofusscomputing/projects/gitlab-ci!17
This commit is contained in:
4
.cz.yaml
4
.cz.yaml
@ -2,6 +2,6 @@ commitizen:
|
||||
bump_message: "build(version): bump version $current_version \u2192 $new_version"
|
||||
changelog_incremental: false
|
||||
name: cz_conventional_commits
|
||||
tag_format: v$major.$minor.$patch$prerelease
|
||||
tag_format: $major.$minor.$patch$prerelease
|
||||
update_changelog_on_bump: true
|
||||
version: 0.6.0
|
||||
version: 0.6.1rc8
|
||||
|
150
.gitlab-ci.yml
150
.gitlab-ci.yml
@ -1,25 +1,37 @@
|
||||
variables:
|
||||
JOB_ROOT_DIR: '.'
|
||||
SECURE_LOG_LEVEL: debug
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
MY_PROJECT_ID: "28543717"
|
||||
LICENSE_FINDER_CLI_OPTS: '--recursive'
|
||||
|
||||
stages:
|
||||
- validation
|
||||
- test
|
||||
- release
|
||||
- sync
|
||||
- chores
|
||||
- validation
|
||||
- build
|
||||
- prepare
|
||||
- test
|
||||
- release
|
||||
- sync
|
||||
- deploy
|
||||
- publish
|
||||
|
||||
include:
|
||||
- local: $JOB_ROOT_DIR/yaml_lint/.gitlab-ci.yml
|
||||
- local: $JOB_ROOT_DIR/lint/yaml.gitlab-ci.yaml
|
||||
- local: $JOB_ROOT_DIR/template/automagic.gitlab-ci.yaml
|
||||
|
||||
- local: $JOB_ROOT_DIR/conventional_commits/.gitlab-ci.yml
|
||||
- local: $JOB_ROOT_DIR/git_push_mirror/.gitlab-ci.yml
|
||||
- local: $JOB_ROOT_DIR/gitlab_release/.gitlab-ci.yml
|
||||
- local: $JOB_ROOT_DIR/validation/.gitlab-ci.yml
|
||||
- local: $JOB_ROOT_DIR/lint/markdown.gitlab-ci.yaml
|
||||
- local: $JOB_ROOT_DIR/python/.gitlab-ci.yml
|
||||
- template: Security/Dependency-Scanning.gitlab-ci.yml
|
||||
- template: Security/License-Scanning.gitlab-ci.yml
|
||||
#- template: Security/License-Scanning.gitlab-ci.yml
|
||||
|
||||
|
||||
variables:
|
||||
JOB_ROOT_DIR: '.'
|
||||
SECURE_LOG_LEVEL: debug
|
||||
GIT_SUBMODULE_STRATEGY: normal
|
||||
GIT_SYNC_URL: "https://$GITHUB_USERNAME_ROBOT:$GITHUB_TOKEN_ROBOT@github.com/NoFussComputing/gitlab-ci.git"
|
||||
MY_PROJECT_ID: "28543717"
|
||||
LICENSE_FINDER_CLI_OPTS: '--recursive'
|
||||
MDLINT_PATHS: "**/*.md **/**/*.md **/**/**/*.md **/**/**/**/*.md **/**/**/**/**/**/*.md #**CHANGELOG.md #CHANGELOG.md #website-template/** #.gitlab/**"
|
||||
PAGES_ENVIRONMENT_PATH: projects/gitlab-ci/
|
||||
|
||||
# Scanner doesn't Pickup multiple pip files. Disable and specify jobs with pip file.
|
||||
gemnasium-python-dependency_scanning:
|
||||
@ -56,7 +68,8 @@ gemnasium-python-dependency_scanning:
|
||||
- if: $CI_COMMIT_BRANCH &&
|
||||
$GITLAB_FEATURES =~ /\bdependency_scanning\b/ &&
|
||||
$DS_DEFAULT_ANALYZERS =~ /gemnasium-python/ &&
|
||||
$PIP_REQUIREMENTS_FILE
|
||||
$PIP_REQUIREMENTS_FILE &&
|
||||
( $CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "pipeline")
|
||||
|
||||
Ansible Dependencies:
|
||||
extends: .gemnasium-python-dependency_scanning
|
||||
@ -91,37 +104,94 @@ python Dependencies:
|
||||
yaml_lint Dependencies:
|
||||
extends: .gemnasium-python-dependency_scanning
|
||||
variables:
|
||||
PIP_REQUIREMENTS_FILE: yaml_lint/requirements.txt
|
||||
PIP_REQUIREMENTS_FILE: lint/requirements.txt
|
||||
|
||||
|
||||
PyLint:
|
||||
extends:
|
||||
- .PyLint
|
||||
image: python:3.6-slim
|
||||
|
||||
|
||||
gilab-ci.yml Lint (python 3.6):
|
||||
variables:
|
||||
YAML_LINT_PATH: "/*/.gitlab-ci.yml"
|
||||
extends:
|
||||
- .yaml_lint_defaults
|
||||
image: python:3.6-slim
|
||||
|
||||
|
||||
Markdown Linting:
|
||||
extends:
|
||||
- .Lint_Markdown
|
||||
- .PyLint
|
||||
image: python:3.6-slim
|
||||
|
||||
|
||||
Gitlab Release:
|
||||
variables:
|
||||
MY_COMMAND: ./sub-folder_changlog.sh
|
||||
extends:
|
||||
- .gitlab_release
|
||||
gilab-ci.yml Lint (python 3.11):
|
||||
extends:
|
||||
- .Gitlab_CI.Lint.YAML
|
||||
image: python:3.11-slim
|
||||
|
||||
|
||||
Github (Push --mirror):
|
||||
variables:
|
||||
GIT_SYNC_URL: "https://$GITHUB_USERNAME_ROBOT:$GITHUB_TOKEN_ROBOT@github.com/NoFussComputing/gitlab-ci.git"
|
||||
extends:
|
||||
- .git_push_mirror
|
||||
Ansible_docker_os.Submodule.Deploy:
|
||||
extends: .submodule_update_trigger
|
||||
variables:
|
||||
SUBMODULE_UPDATE_TRIGGER_PROJECT: nofusscomputing/projects/ansible/ansible_docker_os
|
||||
|
||||
|
||||
Ansible_playbooks.Submodule.Deploy:
|
||||
extends: .submodule_update_trigger
|
||||
variables:
|
||||
SUBMODULE_UPDATE_TRIGGER_PROJECT: nofusscomputing/projects/ansible/ansible_playbooks
|
||||
|
||||
|
||||
Ansible-roles.Submodule.Deploy:
|
||||
extends: .submodule_update_trigger
|
||||
variables:
|
||||
SUBMODULE_UPDATE_TRIGGER_PROJECT: nofusscomputing/projects/ansible/ansible-roles
|
||||
|
||||
|
||||
config.Submodule.Deploy:
|
||||
extends: .submodule_update_trigger
|
||||
variables:
|
||||
SUBMODULE_UPDATE_TRIGGER_PROJECT: nofusscomputing/infrastructure/config
|
||||
|
||||
|
||||
Docker_Mail.Submodule.Deploy:
|
||||
extends: .submodule_update_trigger
|
||||
variables:
|
||||
SUBMODULE_UPDATE_TRIGGER_PROJECT: nofusscomputing/projects/docker-mail
|
||||
|
||||
|
||||
docker-buildx-qemu.Submodule.Deploy:
|
||||
extends: .submodule_update_trigger
|
||||
variables:
|
||||
SUBMODULE_UPDATE_TRIGGER_PROJECT: nofusscomputing/projects/docker-buildx-qemu
|
||||
|
||||
|
||||
docker-glpi.Submodule.Deploy:
|
||||
extends: .submodule_update_trigger
|
||||
variables:
|
||||
SUBMODULE_UPDATE_TRIGGER_PROJECT: nofusscomputing/projects/docker-glpi
|
||||
|
||||
|
||||
docker_management.Submodule.Deploy:
|
||||
extends: .submodule_update_trigger
|
||||
variables:
|
||||
SUBMODULE_UPDATE_TRIGGER_PROJECT: nofusscomputing/projects/ansible/docker_management
|
||||
|
||||
|
||||
execution_environment.Submodule.Deploy:
|
||||
extends: .submodule_update_trigger
|
||||
variables:
|
||||
SUBMODULE_UPDATE_TRIGGER_PROJECT: nofusscomputing/projects/ansible/execution_environment
|
||||
|
||||
|
||||
git_configuration.Submodule.Deploy:
|
||||
extends: .submodule_update_trigger
|
||||
variables:
|
||||
SUBMODULE_UPDATE_TRIGGER_PROJECT: nofusscomputing/projects/ansible/git_configuration
|
||||
|
||||
|
||||
nodered_ldap_self_service.Submodule.Deploy:
|
||||
extends: .submodule_update_trigger
|
||||
variables:
|
||||
SUBMODULE_UPDATE_TRIGGER_PROJECT: nofusscomputing/projects/nodered_ldap_self_service
|
||||
|
||||
|
||||
Ops.Submodule.Deploy:
|
||||
extends: .submodule_update_trigger
|
||||
variables:
|
||||
SUBMODULE_UPDATE_TRIGGER_PROJECT: nofusscomputing/ops
|
||||
|
||||
|
||||
Website.Submodule.Deploy:
|
||||
extends: .submodule_update_trigger
|
||||
variables:
|
||||
SUBMODULE_UPDATE_TRIGGER_PROJECT: nofusscomputing/infrastructure/website
|
||||
|
16
.gitlab-ci_common.yaml
Normal file
16
.gitlab-ci_common.yaml
Normal file
@ -0,0 +1,16 @@
|
||||
variables:
|
||||
JOB_ROOT_DIR: 'gitlab-ci'
|
||||
GIT_SUBMODULE_STRATEGY: normal
|
||||
#PIPELINE_RUN_TRIGGER: 'false'
|
||||
PIPELINE_RUN_SCHEDULE: 'true'
|
||||
|
||||
stages:
|
||||
- chores
|
||||
- validation
|
||||
- build
|
||||
- prepare
|
||||
- test
|
||||
- release
|
||||
- sync
|
||||
- deploy
|
||||
- publish
|
4
.gitmodules
vendored
Normal file
4
.gitmodules
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
[submodule "website-template"]
|
||||
path = website-template
|
||||
url = https://gitlab.com/nofusscomputing/infrastructure/website-template.git
|
||||
branch=development
|
@ -1,9 +0,0 @@
|
||||
{
|
||||
"line-length": false,
|
||||
"MD007": {
|
||||
"indent": 4
|
||||
},
|
||||
"MD033": {
|
||||
"allowed_elements": [ "div", "s", "span", "u" ]
|
||||
}
|
||||
}
|
@ -1,18 +1,23 @@
|
||||
# {CI Job Name}
|
||||
|
||||
Summary of job here
|
||||
|
||||
This job provides the following badge:
|
||||
|
||||
{A badge here}
|
||||
|
||||
|
||||
## Dependencies
|
||||
|
||||
- {dependent job name}
|
||||
|
||||
|
||||
## your .gitlab-ci.yml changes
|
||||
|
||||
To use this job add the following to your `.gitlab-ci.yml` file
|
||||
|
||||
``` yaml
|
||||
|
||||
variables:
|
||||
VARNAME: "a var value"
|
||||
|
||||
@ -21,8 +26,10 @@ stages:
|
||||
|
||||
include:
|
||||
- local: CI/{job name}/.gitlab-ci.yml
|
||||
|
||||
```
|
||||
|
||||
|
||||
## CI/CD Variables required
|
||||
|
||||
| var name | Description |
|
||||
@ -37,4 +44,5 @@ include:
|
||||
|
||||
|
||||
## License
|
||||
|
||||
To view the license for this folder and any sub-folders, refer [here](https://gitlab.com/nofusscomputing/projects/gitlab-ci)
|
||||
|
248
CHANGELOG.md
248
CHANGELOG.md
@ -1,3 +1,251 @@
|
||||
## 0.6.1rc8 (2023-06-08)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **lint**: [4462ec04](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/4462ec04268c5b967f0672828d1cd7b3995894d9) - all lint to immediatly start job [ [!57](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/57) ]
|
||||
- **ci**: [9b00af99](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/9b00af996ff96f58a26b83066004e5a9e94ac155) - correct dockerhub tag [ [!57](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/57) ]
|
||||
- **ci**: [6af454be](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/6af454be4d2b658e0c362392ff502b3fb3da2cbf) - remove spaces from regex exists and changes [ [!56](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/56) ]
|
||||
- **ansible_lint**: [46d85bcf](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/46d85bcf49ea73545a5af4324c28af51a17acd3c) - enable first level dir paths [ [!55](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/55) ]
|
||||
- **docker_build**: [11b62099](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/11b6209992294e45a051e26963d772d75014e516) - on success push container to docker hub [ [!53](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/53) ]
|
||||
- **docker_build**: [e90b938b](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/e90b938bba092bdaecbc1a43758218da0058427b) - init submodule submodules [ [!53](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/53) ]
|
||||
|
||||
### Documentaton / Guides
|
||||
|
||||
- [469255f4](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/469255f450e946a712d379415e45a74eb8c07995) - added notes [ [!58](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/58) ]
|
||||
|
||||
### Features
|
||||
|
||||
- **ci**: [0ec520f0](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/0ec520f02328b69642f929a19e8517c7d475a988) - add resource groups [ [!55](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/55) [#33](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/33) ]
|
||||
- **sync**: [e75464c7](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/e75464c7c409fd17864624d48c9fec8e6e3544e9) - immediatee git sync [ [!55](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/55) ]
|
||||
- **latest_artifacts**: [755fcac0](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/755fcac06e9f265789b02a88eb90df35ab1dbf07) - ensure artifats for jobs are always avail on branches [ [!54](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/54) [#34](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/34) [#331232](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/331232) ]
|
||||
- **latest_artifacts**: [22dd4985](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/22dd4985be315be95be55b2b4edff5ae4ba1eeb4) - ensure artifats for jobs are always avail on branches [ [!52](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/52) [#34](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/34) [#331232](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/331232) ]
|
||||
|
||||
## 0.6.1rc7 (2023-06-05)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **mkdocs**: [5ffc68d7](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/5ffc68d7241bb0c729a990b4a5b060bd6488ea8c) - adjust rules to match lint [ [!51](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/51) ]
|
||||
- **docker**: [097725c1](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/097725c1be5d155cebada0cf2cbb17ddbd041e6e) - detect canges in include path corrected [ [!50](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/50) ]
|
||||
- **ci**: [9e098245](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/9e098245d7a6272fd51aee0a479af3a233fdb30e) - typo in docker build [ [!49](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/49) [!20](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/20) ]
|
||||
- **ansible_playbook**: [13ee3bf5](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/13ee3bf535dadf7cada645ddec74e2e29872ac2c) - No4 enable parent pipelines [ [!47](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/47) ]
|
||||
- **ansible_playbook**: [3c0543f7](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/3c0543f7ad0673bcb6600e6ff20693be5f784f23) - No3 enable parent pipelines [ [!45](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/45) ]
|
||||
- **ansible_playbook**: [f3fa9c5a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/f3fa9c5a416295cb2a0362a31f05995336ea9155) - enable parent pipelines [ [!45](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/45) ]
|
||||
- **ansible_playbook**: [3ee48daa](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/3ee48daa10eee6dd80b79ed076c4ad4d1ff9bb57) - enable parent pipelines [ [!44](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/44) ]
|
||||
|
||||
### Features
|
||||
|
||||
- **ansible_lint**: [6a149f6e](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/6a149f6ed6d514c42d67b6b04cea114aa32067b8) - added inventory & playbooks directories [ [!50](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/50) [#22](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/22) [!27](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/27) ]
|
||||
- **ci**: [1dcb3ed5](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/1dcb3ed521538de47745ed00148bb4123708d90d) - dont git submodule recurse [ [!50](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/50) ]
|
||||
- **commit_footer_refs**: [f3256c58](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/f3256c5858e1b5b2b6444f9d8ae63f556f4acb30) - only run on changes [ [!50](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/50) ]
|
||||
- **ci**: [d8a6d5f7](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/d8a6d5f7ec1f73d5ae506301666383aac843708d) - git gubmodule update trigger moved to api call via curl [ [!48](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/48) [!62](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/62) ]
|
||||
- **ci**: [35cfa92c](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/35cfa92cd900e7ed7008695bf0b65aaf147bb0ec) - git submodule job moved to own definition [ [!48](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/48) [!62](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/62) ]
|
||||
- **ansible_playbook**: [a86d17ef](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a86d17eff267750c3713968852d5013ef00ee226) - rules set to never 'ONLY' [ [!48](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/48) [!62](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/62) ]
|
||||
|
||||
## 0.6.1rc6 (2023-06-02)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **md_lint**: [ba43bb9c](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/ba43bb9c8de87d723abcd0b4b7519c88d8c3b162) - lint on git tag [ [!43](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/43) ]
|
||||
|
||||
## 0.6.1rc5 (2023-06-02)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **gitlab_yaml_lint**: [efa62710](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/efa62710571e48872d700a8a8802a526fb86b1f6) - adjust logic to detect changes [ [!42](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/42) ]
|
||||
- **commit_footer_check**: [6accd863](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/6accd8633ca0579de084d9762f610711ae1e5715) - run on non master/dev branches only [ [!42](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/42) ]
|
||||
|
||||
### Code Refactor
|
||||
|
||||
- **ci**: [9d767282](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/9d767282ffa86c48077bd08b605cf50be76a9b07) - update ansible-role repo path [ [!40](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/40) [#74](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/74) ]
|
||||
|
||||
### Features
|
||||
|
||||
- **submodule_update_trigger**: [86b05338](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/86b05338854f94997cb5cf09fad0561c09f86461) - only update own submodule [ [!41](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/41) [#16](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/16) [!60](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/60) ]
|
||||
- **mkdocs_build**: [ff8c43c1](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/ff8c43c1ea2126cabf0ad2f400a784a9f90ec1ac) - always build on git tag [ [!41](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/41) ]
|
||||
- **ci_rules**: [04e7e928](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/04e7e928e0f4f2212078fd08fd87b2e024dd5257) - add exists and changes for rules [ [!41](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/41) [#32](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/32) ]
|
||||
- **yaml_anchors**: [862176f9](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/862176f9dca8cf8ee998456db0cc12f7084f7fc0) - initial conditional checks [ [!41](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/41) [#32](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/32) ]
|
||||
- **ci**: [6f810f80](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/6f810f8084e54f0afc9ebb47bfcc855536046a08) - add more repos to update [ [!39](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/39) ]
|
||||
|
||||
## 0.6.1rc4 (2023-05-31)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **ansible_playbook**: [73ea66e6](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/73ea66e60d9cdb235aebda839e0a734212c997bc) - always pull image [ [!37](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/37) ]
|
||||
- **mkdocs_build**: [c47be421](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/c47be42184c96855f0702c0258931da9730df517) - ensure config file exists when run on branch [ [!36](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/36) ]
|
||||
- **automagic**: [8ced1720](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/8ced1720e00f984e75c51bf8985e45d07aac8c09) - fix git submodule so it runs on schedule [ [!35](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/35) [#31](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/31) ]
|
||||
- **docs_environment**: [b68f6cb4](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/b68f6cb4b4a571dee52cb765ddb6a5a70c78b364) - don't define empty env path [ [!34](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/34) ]
|
||||
- **doc_pages**: [91ac4476](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/91ac4476fbefd2476d1c147c1681a1a53cc40201) - use updated job name [ [!34](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/34) [#30](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/30) ]
|
||||
- **ansible_lint**: [75968b14](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/75968b140ca0b2734d6af14e78e7c598b6221600) - only run if tasks/main.yaml exists [ [!34](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/34) ]
|
||||
- **mkdocs_build_website**: [0bc72554](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/0bc72554534488d147356d148d635d490b8a1007) - renamed and normalized [ [!34](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/34) [#30](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/30) ]
|
||||
- **sub_folder_changelog**: [203a9990](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/203a99903c28201f74304ca8689fae25a7a28aa0) - dont create changelog for docs [ [!34](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/34) ]
|
||||
- **jobs**: [a010f7ba](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a010f7bab19fc89f71c8bc5a81a3d1944f4bdc05) - jobs that occur on push should also run on 'trigger' [ [!33](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/33) [#26](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/26) ]
|
||||
- **docker_publish**: [79855cdb](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/79855cdb99762fd444bedddb6be59cb4ba41fe50) - job only run on dockerfile exists [ [!32](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/32) [#28](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/28) ]
|
||||
- **docker**: [502f12c2](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/502f12c21689f86675a000e51ca415019fcad184) - job only run on dockerfile exists [ [!31](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/31) [#28](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/28) ]
|
||||
|
||||
### Code Refactor
|
||||
|
||||
- [e79b5545](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/e79b554550dbabe5df429d6c57fe15cb2b144432) - rename website to documentation [ [!34](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/34) ]
|
||||
- **ci**: [681b8f1a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/681b8f1a0293986a0b67ba13c72bf8dd92ca692a) - update deploy job name [ [!34](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/34) ]
|
||||
- **docker_hub**: [7b4b01bd](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/7b4b01bdab2c4299e892071ef3c19b324bf3768c) - move needs to template [ [!31](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/31) ]
|
||||
|
||||
### Documentaton / Guides
|
||||
|
||||
- [87165450](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/871654508cd183afc1240c9c5de16e9f762c89ee) - refine [ [!34](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/34) ]
|
||||
- **automagic**: [95bc6a5b](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/95bc6a5b036d809ef4bce8af6f70568c595785eb) - added initial autmagic docs [ [!34](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/34) ]
|
||||
- **ansible_playbook**: [39881505](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/398815055e013059afc6c4d99fa97bdeeb003909) - document ci job definition [ [!34](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/34) [#26](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/26) [#27](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/27) ]
|
||||
|
||||
### Features
|
||||
|
||||
- **ci**: [7018440d](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/7018440dcbd09c2eb406817eab7df3e24e19687d) - on push to dev, update git sub modules on specified [ [!38](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/38) ]
|
||||
- **mkdocs_build_docs**: [5e491285](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/5e4912857aea43678b2ef61230df3817f193d684) - keyword needs does not belong in definition [ [!36](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/36) ]
|
||||
- **lint_markdown_docs**: [9ebd0a27](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/9ebd0a27f65b36b289b3e7c0647e839b5f7a2798) - ensure also detects website [ [!36](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/36) ]
|
||||
- **ci**: [44076553](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/440765537dcc4370d6558ec5d41fe7f87a5f7f4d) - use automagic ci template [ [!34](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/34) ]
|
||||
- **automagic**: [18bc18c2](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/18bc18c29b4ae08963d4c744e9479622b2cd921c) - add ansible template [ [!34](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/34) ]
|
||||
- **ansible_play**: [fff7d314](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/fff7d31498d486b1c39f1672df9b283ad02c21d8) - force output colour in job logs [ [!33](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/33) ]
|
||||
|
||||
## 0.6.1rc3 (2023-05-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **scheduled_pipelines**: [bade89c5](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/bade89c5333ca853844e224f46a2d3dafab7179d) - if scheduled pipeline only run schedualable jobs [ [!30](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/30) [#29](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/29) ]
|
||||
|
||||
### Code Refactor
|
||||
|
||||
- **ansible_playbook**: [f9af921e](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/f9af921e6b6ec10f9f77ec6a016c6cbb9559d1bf) - final logic adjustment for job [ [!29](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/29) [#25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/25) ]
|
||||
- **automation**: [1f6ee9ea](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/1f6ee9ea27824df1c82bf85e1e239f57f2145bdf) - final logic changes [ [!29](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/29) [#25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/25) ]
|
||||
|
||||
### Features
|
||||
|
||||
- **auto_jobs**: [c5d27e83](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/c5d27e832e100156cb99c5ca580fd5a8eb600e0f) - created initial template to auto-create jobs [ [!29](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/29) [#26](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/26) ]
|
||||
- **variables**: [158cc94d](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/158cc94d1a817f89b6603e9bac7678196b21d1d5) - added pipeline trigger and schedule [ [!29](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/29) [#26](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/26) ]
|
||||
- **automation**: [0d3eaa6a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/0d3eaa6ac2dc448505b18c6aecd4a72e28ffde83) - job to run ansible playbooks [ [!29](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/29) [!8](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/8) [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) [#5](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/5) ]
|
||||
|
||||
## 0.6.1rc2 (2023-05-24)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **sub_folder_changelog**: [0482c014](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/0482c0144ede393996449a22f1f7742c2e512ac2) - dont create in git submodules [ [!28](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/28) [#23](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/23) ]
|
||||
- **md_linting**: [e26f590e](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/e26f590ebcf284be949be4e1d337e1f587755446) - must lint on git tag [ [!27](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/27) [!3](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/3) ]
|
||||
- **mkdocs**: [7a9aca3a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/7a9aca3a54b1faacb7e286bade84aff0ff4fd2e5) - default to docs directory as root [ [!26](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/26) ]
|
||||
- **template**: [0b9e7375](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/0b9e7375c911d65e06b0d801755449ab31cb45ea) - use correct path for build artifact [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- **markdown_lint**: [18af7f83](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/18af7f831ad2399a6ae9809c51e87f19450db1a7) - use new lint path [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- **markdown_lint**: [12d3a412](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/12d3a412ac73baff16b77488db143efd7311b542) - typo in config variable [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- **mkdocs**: [f42b0ecf](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/f42b0ecf60def9d0f8d366d09ab91006b6fe32c6) - add placeholder pages [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- **docker**: [f604c6e2](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/f604c6e27d2e7704491f4c78979db40cf89764c0) - ensure qemu binfmt is loaded [ [!24](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/24) [!1861](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/1861) ]
|
||||
- **docker_hub**: [8e0f16c5](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/8e0f16c585978ded46164c80559b402c0cb2edf2) - push correct image [ [!24](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/24) ]
|
||||
- **lint**: [a754aa81](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a754aa81edf1570b4e8e2e7d4a23025c8b99f314) - use correct path for requirements.txt [ [!24](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/24) ]
|
||||
- **gitlab_release**: [18a28087](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/18a280878799fe077efa0ed5b11bceedd53eb5c8) - allow skip on dev branch [ [!17](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/17) ]
|
||||
|
||||
### Code Refactor
|
||||
|
||||
- **docs**: [7c385b75](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/7c385b7552945699eb87ec3ec43169df0cb77297) - pages dir renamed to docs [ [!26](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/26) ]
|
||||
- **template_website**: [1b59d623](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/1b59d62348465cc9cc069d5ee23e759316fa9b3c) - adjust names of jobs [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- **markdown_lint**: [bce7396d](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/bce7396d8bbf5ec6600a3a34a05198a87c4fcc70) - move md linting to lint folder [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- **docs**: [3a2a135d](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/3a2a135d0af50a9360870e0a7f362c3820543e40) - markdown linting errors fix [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- **mkdocs**: [dacb9f22](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/dacb9f22dd9aee1ff741c7ac8078912d9a2b0dbf) - use locked version from website repo [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- **docker**: [a90ccb81](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a90ccb81772e295cebe89d7a9c32ab700e19884d) - move docker jobs to their own file [ [!24](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/24) ]
|
||||
- [c34e382a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/c34e382a22cd39874abd8fb5116e831e888db8af) - use name that makes sense [ [!24](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/24) ]
|
||||
- [539e40e3](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/539e40e3008e24411f62f439d394db4b5e69a066) - move ansible and yaml lint job to linting folder [ [!24](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/24) ]
|
||||
|
||||
### Continious Integration
|
||||
|
||||
- **pages**: [bcb80358](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/bcb80358d9adb6b3a89fab1003f4434fb2949bdc) - add pages slug [ [!27](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/27) ]
|
||||
|
||||
### Documentaton / Guides
|
||||
|
||||
- [28c04fb2](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/28c04fb2e854521167367161d13b09650829d17d) - add job definitions to page [ [!26](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/26) ]
|
||||
- [657df7a5](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/657df7a5ceb59798c7bb072aed5bf7ef82aef9b6) - add job definition to page [ [!26](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/26) ]
|
||||
- [0bc3451b](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/0bc3451bc20e7705a32d89e9f601af363523d946) - added edit url [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- [4fb85408](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/4fb85408b8f4e8b87eb97a43db50c86399d8e350) - move readme to project pages index [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- [b66abc19](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/b66abc1947676a624d32b4895a9a05000105f36a) - notate under development [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- [61200e52](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/61200e526efcb71bcec9f27ac4bd7c6f02fc23a6) - update structure [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- **template**: [e40310fc](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/e40310fc21b6af684f6db7858196e8180b6e03df) - add index and website [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- [55061ad5](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/55061ad5efd303cf5a53c4672409f7d159113c62) - use project template [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- **mkdocs**: [1ec2666e](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/1ec2666e8565d5206aefaf5462f0f83f74fbbcb7) - moved to pages folder [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- **conventional_commits**: [70dfb826](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/70dfb826d100432265e3f3b08948bb808855e0aa) - added config file requirement [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
|
||||
### Features
|
||||
|
||||
- **template_website**: [bef76847](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/bef76847ec686fcff92229d7b9be0bcfc7b267da) - enable specifying the url slug [ [!27](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/27) ]
|
||||
- **docs**: [a8f675c1](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a8f675c102d0027f23b4490aa3620b504d0193cc) - temp adding of requirements [ [!26](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/26) ]
|
||||
- **mkdocs**: [71a335c2](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/71a335c2667505c199bd67446327cd8794de5f52) - install website-template requirements [ [!26](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/26) [!7](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/7) ]
|
||||
- **pages**: [480502a7](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/480502a7638f346be8334d3c03d5b00ec18f0c2f) - don't include projects in nav [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- **template**: [8e2a2338](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/8e2a233814bd76ebff3dd8ed5a79afe307a84755) - always deploy to pages on dev manual other [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- **mkdocs_build**: [a0b6d05a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a0b6d05a0f3f0fa84c825007f6ec9f28c945f3ef) - always build [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- **mkdocs_build**: [6d2e50e9](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/6d2e50e947839576f098bd7700e00b9d6ab4be1e) - add manual build [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- **template**: [4fa90d4c](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/4fa90d4c4249ed8929e7dde2e7bd0e8581d0d8a7) - use md lint config from website-template [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- **markdown_lint**: [38d46900](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/38d469007a388312c71a61916275d6a12aad8bbd) - enable specifying the lint config path [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- **pages**: [15750124](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/157501245d7c347670055352f9263917a2c3f445) - use repo name [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- **website**: [16d47d5e](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/16d47d5e350e1c78f72c97780ed1732a43927fcc) - add pages job for website [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- **template**: [91a50eb1](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/91a50eb15bd92ca65481a73c6f095681281941fe) - created website job template [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- **mkdocs**: [5556a57e](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/5556a57ea5588d4f0cd1434bfdde5cd77e3b4f5c) - only run on success [ [!25](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/25) ]
|
||||
- **conventional_commits**: [088c9fb0](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/088c9fb04c80961f4de8d2b129955ae8cd0b9529) - ensure .cz.yaml exists [ [!24](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/24) ]
|
||||
- **docker_build**: [6765894c](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/6765894cebc958df92fd3f42d93bd205101d1966) - enable spcifying the dockerfile to use [ [!24](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/24) ]
|
||||
- **template**: [67f39d96](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/67f39d9694b80ad0d2d08800d4faadf594fb6623) - added a ansible-role job template [ [!24](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/24) ]
|
||||
- **gitlab_release**: [d89941df](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/d89941df05bfed4b0ad1277e715b224d232e7949) - dont automagic run on dev [ [!4](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/4) [#21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/21) [!23](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/23) [#21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/21) [!4](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/4) ]
|
||||
|
||||
## 0.6.1rc1 (2023-05-15)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **ci**: [b0024c99](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/b0024c99b0cd06e12f95882749b3668a639cf24c) - v no longer suffix to tag [ [!22](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/22) ]
|
||||
- **docker**: [72f52898](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/72f52898869fe23174e649f0bf8327732fd52147) - setup ROOT_DIR [ [!3](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/3) [!1](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/1) [!22](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/22) [!3](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/3) [!1](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/1) ]
|
||||
- **conventional_commits**: [76db5b17](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/76db5b17578d8585ed31e0728dbfb37ea2fae153) - never run on git tag [ [!7](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/7) [!22](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/22) [!7](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/7) ]
|
||||
- **markdown_lint**: [8581981a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/8581981a43c31d6903865f067fa3f77adae949e5) - fix search paths [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- **yaml_lint**: [a04b272c](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a04b272c167dae27940211b7c77a4adcb33b2086) - remove extra var creation [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- **yaml_lint**: [3b686a46](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/3b686a461be22b682642eb1143f2bd2ea2d3ef17) - ensure config is within double quote [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- **yaml_lint**: [52c6ceda](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/52c6ceda83b04e1e18eaa9c32b1a41733dc26497) - scan all [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- **yaml_lint**: [0d59871a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/0d59871a1a73178c248b2189dfae2cd93f21c469) - enable specifying additional config [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- **markdown_lint**: [cf10e289](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/cf10e289d21a5cc529bbe7effb189aab65875510) - enable job for md in sub folders [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) [#19](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/19) [!2](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/2) ]
|
||||
- [d389d141](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/d389d14192e1e483fbd48fa9b5c5bee25db14a20) - validation jobs on all except merge [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- **gitlab_release**: [a745ceac](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a745ceac5ebce458b46593311e5285f40dcba349) - fixed rule to match nfc_bot [ [!20](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/20) [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) [!20](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/20) ]
|
||||
- **gitlab_release**: [e76378dd](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/e76378dd068e200a1198f1811efb9d3bec7878f5) - only run on master on_success [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) [#16](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/16) ]
|
||||
- **ci**: [934a401a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/934a401a9620891b09a5fe9c9b0e50a97b43fa9b) - specify the commitizen version [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- **markdown_lint**: [8391bf65](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/8391bf659bf5dd39edf31205a68c699851e78be3) - remove quotes from search path variable. [ [#18](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/issues/18) ]
|
||||
|
||||
### Code Refactor
|
||||
|
||||
- **ci**: [02e9e5f4](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/02e9e5f4f4cc0b93ae92c7ba3a2cfb38305af64c) - inconsistant tabs [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- [adc720bb](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/adc720bbfa0dd8ff66f70fe56678b5f388ce8d0c) - cleanup non-needed dir [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- **gitlab_release**: [1fa7fec3](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/1fa7fec38a54b7ddf460b1394a7024ef161fab24) - show debug before command [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- [408e4eab](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/408e4eab9e1f61004f1e38af6d1531747b7da99b) - move docs as part of restructure [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- [9a7ae710](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/9a7ae7106e80a038b31cdc9fc172bb1f974ecb94) - set correct commit details for nfc_bot [ [!20](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/20) ]
|
||||
|
||||
### Continious Integration
|
||||
|
||||
- [1233d6ad](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/1233d6ad90032f3a6c5a3a6ff0c92510d0ef298a) - disable licence scanning until fixed [ [!22](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/22) ]
|
||||
- **yaml_lint**: [ca60625b](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/ca60625bf171924e91ea6eea5aa3decc51b7f0dc) - update to python 11
|
||||
- **markdown_linting**: [47e39849](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/47e3984916bf671e6dbc39e05160a2409fc78b6b) - exclude .gitlab and changelog [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- [49282457](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/492824572b963f048af993fc36d8696f9b0fe41e) - dont lint git submodule website-template [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- **docs**: [72f8eb72](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/72f8eb720d5266b7aa83b5e2974da075a1c06875) - added mkdocs config [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
|
||||
### Documentaton / Guides
|
||||
|
||||
- **yaml_lint**: [a925db14](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a925db14641e709572b832278f43aabe48d153f7) - update docs for new variables [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
|
||||
### Features
|
||||
|
||||
- **conventional**: [93931cb9](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/93931cb9076e0db238f4e297abe3d8f37bd71b80) - job not to run when bot pushes change [ [!22](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/22) ]
|
||||
- **ci**: [7ed3f92d](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/7ed3f92dd75397ad4623ada8469633dc8b0caf5f) - exclude website-template from yaml lint [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- **ci**: [bbbf9e35](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/bbbf9e35e2ad5d0fdf1c4c697f127dfe68d5e0da) - set correct search path [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- **yaml_lint**: [0b4e85c3](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/0b4e85c3134ff9f126056113383383559cdfb227) - added var to prevent job from runnng [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- **gitlab_release**: [e06ffef6](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/e06ffef66c4a0ba1f48f109c175239560909e698) - run on merge to development [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- **gitlab_release**: [199ea1f2](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/199ea1f23c6a3df2b40ae3d9a5668719301500d9) - never run on merge or git tag [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- **git_push_mirror**: [1db2209d](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/1db2209dfb36fbdda28d68388aec9f62f85b57bc) - always sync git tag [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- **template**: [8b9a0356](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/8b9a0356dec7d99a63c4ed744b78ae707155e9f3) - added new template for ci pipeline for docker containers [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- **common**: [9670fc47](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/9670fc47401630ef6c407bd7eaccd3db64195543) - created a common ci file for inclusion [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- **commit_footer_refs**: [8d512a9a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/8d512a9a4bd7f4895645436f057c4bab3efb864e) - ability to disable job with variable [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- **gitlab_release**: [a37acbfc](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a37acbfc7d3ea20ece7cb76e15a14858b26f8508) - ability to disable job with variable [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- **git_push_mirror**: [81445c06](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/81445c06e43bce10761e3a7fbad7df97f82d6bc2) - ability to disable job with variable [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- **conventional_commits**: [9e7d357b](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/9e7d357bab2b92704d37ad5621df9fe8d1e31a26) - ability to disable job with variable [ [!21](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/21) ]
|
||||
- **markdown_lint**: [d75e9599](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/d75e95998b4a195cfcc36683ffa6f058bf7b05be) - artifact locations to be hard set [ [!19](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/19) ]
|
||||
|
||||
## v0.6.1rc0 (2022-01-25)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **lint_markdown**: [e0402ecf](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/e0402ecfb2ab662a74bb70df7937b02576d5e41b) - ensure the correct path for the job directory is used [ [!2](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/2) [!18](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/merge_requests/18) ]
|
||||
|
||||
## v0.6.0 (2022-01-24)
|
||||
|
||||
### Bug Fixes
|
||||
|
98
README.md
98
README.md
@ -43,12 +43,15 @@ links:
|
||||
|
||||
|
||||
## Using this repository for your Gitlab CI/CD Jobs.
|
||||
|
||||
This repository has been designed as a central point for your repositories CI/CD jobs. By simply linking this repository to your repository and configuring, your CI/CD jobs will run as part of the build process, whilst keeping any CI/CD commits limited within your git history.
|
||||
|
||||
Each CI/CD job is contained within its own sub-folder. Each sub-folder has a readme specific to the job, which includes the details on how to implement, use etc.
|
||||
|
||||
For further details on using these templates with your Gitlab CI/CD jobs, pleaase view the [documentation](https://nofusscomputing.com/projects/gitlab-ci).
|
||||
|
||||
### gitlab-ci layout
|
||||
|
||||
### gitlab-ci repository layout
|
||||
|
||||
We use the following branches *(these jobs assume you do as well)*:
|
||||
- `master` - Considered as the stable branch
|
||||
@ -57,99 +60,8 @@ We use the following branches *(these jobs assume you do as well)*:
|
||||
We also tag each branch to denote the version of release. We use our own repo to do the version increment automagically in line with [semantic versioning](https://semver.org/).
|
||||
|
||||
|
||||
|
||||
### CI Stages
|
||||
The CI stages for these jobs are as follows, and in the order expected by the jobs:
|
||||
|
||||
- validation
|
||||
> validation of files, commits, Merge Request titles, code quality, license checks.
|
||||
|
||||
- build
|
||||
> build any binaries or files that would be used in the later stages .
|
||||
|
||||
- prepare
|
||||
> any jobs that must run after build but before testing. for example a docker image build that includes artifacts from the build job
|
||||
|
||||
- test
|
||||
> unit, functional, integration and any other tests.
|
||||
|
||||
- release
|
||||
> git tagging and creating a gitlab release. Also includes adding build artifacts to gitlab registry.
|
||||
|
||||
- sync
|
||||
> repository synchronization, i.e. push mirror to github.
|
||||
|
||||
- publish
|
||||
> placement of build objects to external sources
|
||||
|
||||
### .gitlab-ci.yml example
|
||||
|
||||
example:
|
||||
``` yaml
|
||||
stages:
|
||||
- validation
|
||||
- build
|
||||
- prepare
|
||||
- test
|
||||
- release
|
||||
- sync
|
||||
- publish
|
||||
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
MY_PROJECT_ID: "{your_project_id}"
|
||||
|
||||
include:
|
||||
- project: nofusscomputing/projects/gitlab-ci
|
||||
ref: 68b6bc3bfacf0770e10d2e10a5c57952070d44fe
|
||||
file:
|
||||
- conventional_commits/.gitlab-ci.yml
|
||||
- gitlab_release/.gitlab-ci.yml
|
||||
- git_push_mirror/.gitlab-ci.yml
|
||||
- ansible/.gitlab-ci.yml
|
||||
|
||||
```
|
||||
| :bulb: Tip |
|
||||
|:----|
|
||||
| *Use a project import in your `.gitlab-ci.yml` file that is tied to a specific `ref`. for example a commit or tag. Also ensure that the `gitlab-ci` `git sub-module` and the `ref` as part of the includes matches.* |
|
||||
|
||||
|
||||
### Artifacts
|
||||
Any artifacts by jobs will be created in folders named after the stage.
|
||||
|
||||
preference is placed on jobs to output JUnit.xml test reports. This is because they are visible in merge requests.
|
||||
|
||||
|
||||
## Git Sub-Module setup
|
||||
|
||||
It is recommended that you set-up this repo as a git sub-module to your repo and that you configure it to a set commit/tag. This ensures that any change to `gitlab-ci` repo, does not effect your CI/CD jobs.
|
||||
|
||||
run the following commands:
|
||||
``` bash
|
||||
git submodule add -b {ref} https://gitlab.com/nofusscomputing/projects/gitlab-ci.git gitlab-ci
|
||||
git submodule update --remote
|
||||
|
||||
```
|
||||
|
||||
| :bulb: Tip |
|
||||
|:-----|
|
||||
| NOTE: `{ref}` should be replaced with the branch name, `master` is the stable branch and recommended. by default the sub-module will be created in folder `gitlab-ci`, it is recommended that you **don't** change this folder name.
|
||||
You can also substitute the gitlab url with the github url `https://github.com/NoFussComputing/gitlab-ci.git` for the submodule if you desire. this repo is auto-synced with github on each change to the repo. |
|
||||
|
||||
After each `git submodule update --remote` you will have to commit the sub-module update to your repo. Suggested commands as follows:
|
||||
``` bash
|
||||
git add .gitmodules
|
||||
|
||||
git add gitlab-ci
|
||||
|
||||
git commit -m "ci(gitlab-ci): updated to use version x
|
||||
|
||||
{your reason here or explain what is provided/changed}"
|
||||
```
|
||||
Then push the changes to your source.
|
||||
|
||||
|
||||
## Contributing
|
||||
|
||||
All contributions for this project must conducted from [Gitlab](https://gitlab.com/nofusscomputing/projects/gitlab-ci).
|
||||
|
||||
For further details on contributing please refer to the [contribution guide](CONTRIBUTING.md).
|
||||
|
70
anchors/conditions.yaml
Normal file
70
anchors/conditions.yaml
Normal file
@ -0,0 +1,70 @@
|
||||
---
|
||||
|
||||
.condition_dev_branch_push: &condition_dev_branch_push # condition_dev_branch_push
|
||||
$CI_COMMIT_BRANCH == "development" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
|
||||
.condition_master_branch_push: &condition_master_branch_push # condition_master_branch_push
|
||||
$CI_COMMIT_BRANCH == "master" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
|
||||
.condition_not_master_or_dev_push: &condition_not_master_and_dev_push # condition_not_master_or_dev_push
|
||||
$CI_COMMIT_BRANCH != "master" &&
|
||||
$CI_COMMIT_BRANCH != "development" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
|
||||
.condition_master_or_dev_push: &condition_master_or_dev_push # condition_master_or_dev_push
|
||||
(
|
||||
$CI_COMMIT_BRANCH == "master" ||
|
||||
$CI_COMMIT_BRANCH == "development"
|
||||
)&&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
|
||||
.condition_git_tag: &condition_git_tag # condition_git_tag
|
||||
$CI_COMMIT_TAG != null &&
|
||||
$CI_COMMIT_BRANCH == null
|
||||
|
||||
.condition_any_branch_push: &condition_any_branch_push # condition_any_branch_push
|
||||
$CI_COMMIT_BRANCH != null &&
|
||||
$CI_COMMIT_TAG == null &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.rules_commit_develop_branch: &when_commit_develop_branch
|
||||
- if: # on dev branch
|
||||
$CI_COMMIT_BRANCH == "development" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
changes:
|
||||
paths:
|
||||
<<: *repository_change_files
|
||||
compare_to: 'master'
|
||||
exists:
|
||||
<<: *repository_exists_files
|
||||
when: always
|
||||
|
||||
- if: # not on master or dev
|
||||
$CI_COMMIT_BRANCH != "master" &&
|
||||
$CI_COMMIT_BRANCH != "development" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
changes:
|
||||
paths:
|
||||
<<: *repository_change_files
|
||||
compare_to: 'development'
|
||||
exists:
|
||||
- dockerfile
|
||||
- dockerfile.j2
|
||||
when: always
|
||||
|
||||
- if: # tagged pipeline
|
||||
$CI_COMMIT_TAG != null &&
|
||||
$CI_COMMIT_BRANCH == null
|
||||
exists:
|
||||
- dockerfile
|
||||
- dockerfile.j2
|
||||
when: on_success
|
@ -1,38 +0,0 @@
|
||||
|
||||
.ansible_linter_defaults:
|
||||
stage: validation
|
||||
before_script:
|
||||
- if [ "0$JOB_ROOT_DIR" == "0" ]; then ROOT_DIR=gitlab-ci; else ROOT_DIR=$JOB_ROOT_DIR ; fi
|
||||
- echo "[DEBUG] ROOT_DIR[$ROOT_DIR]"
|
||||
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME"
|
||||
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests"
|
||||
- export PYTHON_VERSION=`python -c 'import sys; version=sys.version_info[:3]; print("{0}.{1}.{2}".format(*version))'`
|
||||
- apt update
|
||||
- apt install --no-install-recommends -y git
|
||||
- python3 -m venv env
|
||||
- . env/bin/activate
|
||||
- pip install --upgrade pip
|
||||
- pip install -r $ROOT_DIR/ansible/requirements.txt
|
||||
- mkdir $PYTHON_VERSION
|
||||
script:
|
||||
- ansible-lint -p --nocolor --parseable-severity "$ANSIBLE_LINT_PATH" > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/$PYTHON_VERSION-ansible-lint.log" 1>&1 || ANSIBLE_LINT=$?
|
||||
- cat "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/$PYTHON_VERSION-ansible-lint.log" | ansible-lint-to-junit-xml > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/$PYTHON_VERSION-ansible-lint.junit.xml"
|
||||
- ls -la $PYTHON_VERSION
|
||||
- if [ $ANSIBLE_LINT > 0 ]; then echo "ansible lint failed with $ANSIBLE_LINT"; exit $ANSIBLE_LINT; fi
|
||||
after_script:
|
||||
- echo deactivate
|
||||
artifacts:
|
||||
expire_in: 3 days
|
||||
when: always
|
||||
paths:
|
||||
- "artifacts/*"
|
||||
reports:
|
||||
junit:
|
||||
- "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/*.junit.xml"
|
||||
rules:
|
||||
- if: '$CI_COMMIT_BRANCH == "master"'
|
||||
when: never
|
||||
- if: '$CI_COMMIT_BRANCH'
|
||||
when: always
|
||||
- when: never
|
||||
|
@ -1,19 +0,0 @@
|
||||
# Changelog
|
||||
|
||||
2022-01-24 13:37:23 +0930 [4e1da5e](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/4e1da5e87281284e021791a4b600a1bff53b8431) - ci(dependency_scanning): python 3.7 not available for dependecy scanning.
|
||||
2022-01-23 07:14:32 +0000 [6668c2f](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/6668c2fb8d7545b4f9052ad3065e58f00d11be62) - refactor: test specifying must equal.
|
||||
2022-01-23 06:12:35 +0000 [0df60b1](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/0df60b12dbfff983ca3a671b90ab1be126597e52) - fix(ansible): remove duplicate lines that last code review didn't remove.
|
||||
2022-01-23 05:57:43 +0000 [484d987](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/484d98792a27c9d967331e9d3cd1afdca435bdd6) - fix(ansible): fix typo in job pip file
|
||||
2022-01-23 05:46:31 +0000 [e1894ec](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/e1894ec0c4fe7504901682f008c2ff0db7e351fe) - fix(dependency_scanning): upgraded versions from vulnerability scan.
|
||||
2022-01-16 00:09:42 +0000 [1ef6c41](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/1ef6c41818c40183f8019ea5cde48b4278e4d694) - build(version): bump version 0.4.0 → 0.5.0
|
||||
2022-01-15 03:53:53 +0000 [5c9000a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/5c9000a74859504ed64bbefa1fd193f80a2b69c2) - build(version): bump version 0.3.1 → 0.4.0
|
||||
2022-01-11 07:03:09 +0000 [7751fd9](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/7751fd9494f610fff0ea16bd303bfe62d0034eec) - build(version): bump version 0.3.0 → 0.3.1
|
||||
2021-08-12 03:32:36 +0000 [389bc08](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/389bc08d7686153fb374aa83d440c35c9b4eac90) - build(version): bump version 0.3.0rc1 → 0.3.0
|
||||
2021-08-11 13:47:34 +0930 [def31ef](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/def31ef562c0002713401652657d59320548ee85) - style(yaml_lint): fixed yaml lint errors
|
||||
2021-08-04 03:23:08 +0000 [eb5cc8a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/eb5cc8a0e2885a9ed16a8d1a81611aec4d5a4d31) - build(version): bump version 0.3.0rc0 → 0.3.0rc1
|
||||
2021-08-04 03:13:54 +0000 [09dcb65](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/09dcb65b090f59e9f8a6bea5eba4bb98bddbad3d) - build(version): bump version 0.2.1 → 0.3.0rc0
|
||||
2021-08-04 02:49:45 +0000 [4453b43](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/4453b433c8966a334f02af592a6ce8092f2ac9de) - build(version): bump version 0.2.0 → 0.2.1
|
||||
2021-08-04 02:24:12 +0000 [856f2e1](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/856f2e1770d0bda823996122ee70916dc0fe455b) - build(version): bump version 0.1.0 → 0.2.0
|
||||
2021-08-04 01:33:47 +0000 [6d34977](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/6d349774269bcd7c6e406cfe72c78b99f246df7b) - build(version): bump version 0.0.1 → 0.1.0
|
||||
2021-08-03 15:23:19 +0930 [2a3266f](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/2a3266fb537e22dddf47708d0af101945027128f) - fix(ansible): Ensure the default ci directory is populated
|
||||
2021-08-03 15:08:37 +0930 [2413dae](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/2413daefb1e7e5a9e7a3cbb2d8cff2214f4a98ae) - feat(ansible): Added ansible validation job for linting
|
@ -1,17 +0,0 @@
|
||||
# Dependency scanning only has Python 3.6 available.
|
||||
|
||||
# Python 3.7
|
||||
# Pillow==9.0.0
|
||||
# numpy==1.22.0
|
||||
|
||||
# Python 3.6
|
||||
pipenv==2022.1.8
|
||||
wheel
|
||||
ansible
|
||||
setuptools_rust
|
||||
Rust
|
||||
ansible-lint
|
||||
yamllint
|
||||
lxml
|
||||
ansible-lint-junit
|
||||
ansible-lint-to-junit-xml
|
174
automation/.gitlab-ci-ansible.yaml
Normal file
174
automation/.gitlab-ci-ansible.yaml
Normal file
@ -0,0 +1,174 @@
|
||||
---
|
||||
# This yaml is intended to run ansible jobs using nfc's ansible-ee image
|
||||
|
||||
include:
|
||||
- local: $JOB_ROOT_DIR/.gitlab-ci_common.yaml
|
||||
|
||||
|
||||
.ansible_playbook:
|
||||
image:
|
||||
name: nofusscomputing/ansible-ee:dev
|
||||
pull_policy: always
|
||||
stage: chores
|
||||
variables:
|
||||
ansible_inventory: ''
|
||||
ansible_playbook: ''
|
||||
ansible_tags: ''
|
||||
ANSIBLE_FORCE_COLOR: 'true'
|
||||
script:
|
||||
- if [ "0$ansible_inventory" != '0' ]; then ansible_inventory=-i $ansible_inventory; fi
|
||||
- if [ "0$ansible_tags" != '0' ]; then ansible_tags=$(echo -n "--tags $ansible_tags"); fi
|
||||
- echo "[DEBUG] ansible_inventory=$ansible_inventory"
|
||||
- echo "[DEBUG] ansible_playbook=$ansible_playbook"
|
||||
- echo "[DEBUG] ansible_tags=$ansible_tags"
|
||||
- ansible-playbook $ansible_inventory $ANSIBLE_PLAYBOOK_DIR/$ansible_playbook $ansible_tags -vvv
|
||||
rules:
|
||||
# ToDo: at some stage redefine these rules so that the job can run if specified.
|
||||
# - if: '$NFC_AUTO_JOBS == "false"'
|
||||
# when: never
|
||||
|
||||
# - if: '$CI_PIPELINE_SOURCE == "schedule" && $PIPELINE_RUN_SCHEDULE == "true"'
|
||||
# exists:
|
||||
# - ".nfc_automation.yaml"
|
||||
# when: always
|
||||
|
||||
# - if:
|
||||
# (
|
||||
# $CI_PIPELINE_SOURCE == "api"
|
||||
# ||
|
||||
# $CI_PIPELINE_SOURCE == "pipeline"
|
||||
# ||
|
||||
# $CI_PIPELINE_SOURCE == "trigger"
|
||||
# ||
|
||||
# $CI_PIPELINE_SOURCE == "parent_pipeline"
|
||||
# ) &&
|
||||
# $PIPELINE_RUN_TRIGGER == "true"
|
||||
# exists:
|
||||
# - ".nfc_automation.yaml"
|
||||
# when: always
|
||||
|
||||
|
||||
# - if: # condition_dev_branch_push
|
||||
# $CI_COMMIT_BRANCH == "development" &&
|
||||
# $CI_PIPELINE_SOURCE == "push"
|
||||
# exists:
|
||||
# - ".nfc_automation.yaml"
|
||||
# when: always
|
||||
|
||||
# # this if for testing only
|
||||
# # - if: '$CI_PIPELINE_SOURCE == "push"'
|
||||
# # when: always
|
||||
# # exists:
|
||||
# # - ".nfc_automation.yaml"
|
||||
- when: never
|
||||
|
||||
|
||||
.ansible_playbook_git_submodule:
|
||||
extends: .ansible_playbook
|
||||
variables:
|
||||
ansible_playbook: 'git_configuration.yaml'
|
||||
ansible_tags: 'submodule'
|
||||
rules:
|
||||
- if: '$NFC_AUTO_JOBS == "false"'
|
||||
when: never
|
||||
|
||||
- if: '$CI_PIPELINE_SOURCE == "schedule" && $PIPELINE_RUN_SCHEDULE == "true"'
|
||||
exists:
|
||||
- ".nfc_automation.yaml"
|
||||
when: always
|
||||
|
||||
- if:
|
||||
(
|
||||
$CI_PIPELINE_SOURCE == "api"
|
||||
||
|
||||
$CI_PIPELINE_SOURCE == "pipeline"
|
||||
||
|
||||
$CI_PIPELINE_SOURCE == "trigger"
|
||||
||
|
||||
$CI_PIPELINE_SOURCE == "parent_pipeline"
|
||||
) &&
|
||||
$PIPELINE_RUN_TRIGGER == "true"
|
||||
exists:
|
||||
- ".nfc_automation.yaml"
|
||||
when: always
|
||||
|
||||
- if: # condition_dev_branch_push
|
||||
$CI_COMMIT_TAG == null &&
|
||||
$CI_COMMIT_BRANCH == "development" &&
|
||||
$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "development" &&
|
||||
$CI_PIPELINE_SOURCE != "push"
|
||||
exists:
|
||||
- ".nfc_automation.yaml"
|
||||
when: always
|
||||
|
||||
# this if for testing only
|
||||
# - if: '$CI_PIPELINE_SOURCE == "push"'
|
||||
# when: always
|
||||
# exists:
|
||||
# - ".nfc_automation.yaml"
|
||||
- when: never
|
||||
|
||||
|
||||
.submodule_update_trigger:
|
||||
stage: publish
|
||||
# trigger:
|
||||
# project: $SUBMODULE_UPDATE_TRIGGER_PROJECT
|
||||
# branch: development
|
||||
# inherit:
|
||||
# variables: false
|
||||
script:
|
||||
# use script to trigger pipeline instead of trigger keyword.
|
||||
# this is due to trigger keyword not allowing environment keyword.
|
||||
- export TRIGGER_PROJECT_PATH=$(python3 -c "import urllib.parse, sys; print('$SUBMODULE_UPDATE_TRIGGER_PROJECT'.replace('/', '%2F'))")
|
||||
- echo "[DEBUG] TRIGGER_PROJECT_PATH=$TRIGGER_PROJECT_PATH"
|
||||
- |
|
||||
curl \
|
||||
--request POST \
|
||||
--form "token=$CI_JOB_TOKEN" \
|
||||
--form ref=development \
|
||||
--form "variables[GIT_CONFIG_SUBMODULE_NAME]=$GIT_CONFIG_SUBMODULE_NAME" \
|
||||
--form "variables[PIPELINE_RUN_TRIGGER]=$PIPELINE_RUN_TRIGGER" \
|
||||
--form "variables[GIT_COMMIT_TYPE]=$GIT_COMMIT_TYPE" \
|
||||
--form "variables[GIT_COMMIT_TYPE_CATEGORY]=$GIT_COMMIT_TYPE_CATEGORY" \
|
||||
"https://gitlab.com/api/v4/projects/$TRIGGER_PROJECT_PATH/trigger/pipeline"
|
||||
environment:
|
||||
name: $SUBMODULE_UPDATE_TRIGGER_PROJECT
|
||||
url: https://gitlab.com/$SUBMODULE_UPDATE_TRIGGER_PROJECT
|
||||
variables:
|
||||
PIPELINE_RUN_TRIGGER: 'true'
|
||||
GIT_CONFIG_SUBMODULE_NAME: $CI_PROJECT_NAME
|
||||
rules:
|
||||
- if: # condition_master_or_dev_push
|
||||
(
|
||||
$CI_COMMIT_BRANCH == "master" ||
|
||||
$CI_COMMIT_BRANCH == "development"
|
||||
) &&
|
||||
$CI_PIPELINE_SOURCE == "push" &&
|
||||
$CI_COMMIT_TAG == null
|
||||
when: on_success
|
||||
|
||||
- when: never
|
||||
|
||||
|
||||
.ansible_playbook_mr_from_issue_comment_patch:
|
||||
extends: .ansible_playbook
|
||||
variables:
|
||||
ansible_playbook: 'git_configuration.yaml'
|
||||
ansible_tags: 'gitlab_issue_patches'
|
||||
PIPELINE_RUN_TRIGGER: 'false'
|
||||
PIPELINE_RUN_SCHEDULE: 'false'
|
||||
needs: []
|
||||
rules:
|
||||
- if: '$NFC_AUTO_JOBS == "false"'
|
||||
when: never
|
||||
- if:
|
||||
$CI_COMMIT_TAG == null &&
|
||||
$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "development" &&
|
||||
$CI_PIPELINE_SOURCE != "push" &&
|
||||
$CI_COMMIT_BRANCH != 'master' &&
|
||||
$CI_COMMIT_BRANCH != 'automated-tasks' &&
|
||||
$CI_COMMIT_BRANCH == 'development'
|
||||
exists:
|
||||
- ".nfc_automation.yaml"
|
||||
when: always
|
||||
- when: never
|
5
automation/CHANGELOG.md
Normal file
5
automation/CHANGELOG.md
Normal file
@ -0,0 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
2023-05-27 15:20:40 +0930 [f9af921](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/f9af921e6b6ec10f9f77ec6a016c6cbb9559d1bf) - refactor(ansible_playbook): final logic adjustment for job
|
||||
2023-05-27 14:04:10 +0930 [1f6ee9e](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/1f6ee9ea27824df1c82bf85e1e239f57f2145bdf) - refactor(automation): final logic changes
|
||||
2023-05-26 16:29:23 +0930 [0d3eaa6](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/0d3eaa6ac2dc448505b18c6aecd4a72e28ffde83) - feat(automation): job to run ansible playbooks
|
@ -1,70 +1,78 @@
|
||||
|
||||
.conventional_commit:
|
||||
variables:
|
||||
DEFAULT_ROOT_DIR: './gitlab-ci'
|
||||
image: python:3.6-slim
|
||||
stage: validation
|
||||
before_script:
|
||||
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME"
|
||||
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests"
|
||||
- if [ "0$MR_ACCESS_TOKEN" == "0" ]; then MR_ACCESS_TOKEN=$CI_JOB_TOKEN; fi
|
||||
- echo "[DEBUG] MR_ACCESS_TOKEN[$MR_ACCESS_TOKEN]"
|
||||
- if [ "0$JOB_ROOT_DIR" == "0" ]; then ROOT_DIR=$DEFAULT_ROOT_DIR; else ROOT_DIR=$JOB_ROOT_DIR ; fi
|
||||
- echo "[DEBUG] ROOT_DIR[$ROOT_DIR]"
|
||||
- if [ "0$MY_PROJECT_ID" == "0" ]; then PROJECT_ID=$CI_PROJECT_ID; else PROJECT_ID=$MY_PROJECT_ID ; fi
|
||||
- echo "[DEBUG] PROJECT_ID[$PROJECT_ID]"
|
||||
- export PYTHON_VERSION=`python -c 'import sys; version=sys.version_info[:3]; print("{0}.{1}.{2}".format(*version))'`
|
||||
- apt update
|
||||
- apt install --no-install-recommends -y git
|
||||
- python3 -m venv env
|
||||
- . env/bin/activate
|
||||
- pip install --upgrade pip
|
||||
- pip install -r $ROOT_DIR/conventional_commits/requirements.txt
|
||||
- echo "[DEBUG] CI_PROJECT_ID[$CI_PROJECT_ID]"
|
||||
- echo "[DEBUG] CI_COMMIT_BRANCH[$CI_COMMIT_BRANCH]"
|
||||
- git fetch --all
|
||||
- git checkout --track origin/$CI_COMMIT_BRANCH
|
||||
- git show-branch -a
|
||||
- target_branch=$(git show-branch -a | awk 'BEGIN { FS="\n\s+*" } { print $1 }' | awk '{print $2}' | grep '\[' | sed 's/.*\[origin\/\(.*\)\].*/\1/' | grep -v '\[' | grep -v $(git rev-parse --abbrev-ref HEAD) | grep -vi 'HEAD' | awk 'BEGIN{ RS = "" ; FS = "\n" }{print $1}')
|
||||
- echo "[DEBUG] Target Branch[$target_branch]"
|
||||
- if [ -d "gitlab-ci" ]; then ls -la gitlab-ci; fi
|
||||
- first_sha1=$(git log origin/$target_branch..$CI_COMMIT_BRANCH --format=format:%H | tail -1)
|
||||
- echo "[DEBUG] First Commit SHA[$first_sha1]"
|
||||
- echo "[DEBUG] artifacts directory [$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME]"
|
||||
after_script:
|
||||
- ls -lR "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE"
|
||||
- cd ..
|
||||
- rm -Rf check
|
||||
artifacts:
|
||||
expire_in: 3 days
|
||||
when: always
|
||||
paths:
|
||||
- "$CI_PROJECT_DIR/artifacts/*"
|
||||
reports:
|
||||
junit:
|
||||
- "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/*.junit.xml"
|
||||
rules:
|
||||
- if: '$CI_COMMIT_BRANCH == "master"'
|
||||
when: never
|
||||
- if: '$CI_COMMIT_BRANCH'
|
||||
when: always
|
||||
- when: never
|
||||
variables:
|
||||
DEFAULT_ROOT_DIR: './gitlab-ci'
|
||||
image: python:3.6-slim
|
||||
stage: validation
|
||||
before_script:
|
||||
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME"
|
||||
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests"
|
||||
- if [ "0$MR_ACCESS_TOKEN" == "0" ]; then MR_ACCESS_TOKEN=$CI_JOB_TOKEN; fi
|
||||
- echo "[DEBUG] MR_ACCESS_TOKEN[$MR_ACCESS_TOKEN]"
|
||||
- if [ "0$JOB_ROOT_DIR" == "0" ]; then ROOT_DIR=$DEFAULT_ROOT_DIR; else ROOT_DIR=$JOB_ROOT_DIR ; fi
|
||||
- echo "[DEBUG] ROOT_DIR[$ROOT_DIR]"
|
||||
- if [ "0$MY_PROJECT_ID" == "0" ]; then PROJECT_ID=$CI_PROJECT_ID; else PROJECT_ID=$MY_PROJECT_ID ; fi
|
||||
- echo "[DEBUG] PROJECT_ID[$PROJECT_ID]"
|
||||
- export PYTHON_VERSION=`python -c 'import sys; version=sys.version_info[:3]; print("{0}.{1}.{2}".format(*version))'`
|
||||
- apt update
|
||||
- apt install --no-install-recommends -y git
|
||||
- python3 -m venv env
|
||||
- . env/bin/activate
|
||||
- pip install --upgrade pip
|
||||
- pip install -r $ROOT_DIR/conventional_commits/requirements.txt
|
||||
- echo "[DEBUG] CI_PROJECT_ID[$CI_PROJECT_ID]"
|
||||
- echo "[DEBUG] CI_COMMIT_BRANCH[$CI_COMMIT_BRANCH]"
|
||||
- git fetch --all
|
||||
- git checkout --track origin/$CI_COMMIT_BRANCH
|
||||
- git show-branch -a
|
||||
- target_branch=$(git show-branch -a | awk 'BEGIN { FS="\n\s+*" } { print $1 }' | awk '{print $2}' | grep '\[' | sed 's/.*\[origin\/\(.*\)\].*/\1/' | grep -v '\[' | grep -v $(git rev-parse --abbrev-ref HEAD) | grep -vi 'HEAD' | awk 'BEGIN{ RS = "" ; FS = "\n" }{print $1}')
|
||||
- echo "[DEBUG] Target Branch[$target_branch]"
|
||||
- if [ -d "gitlab-ci" ]; then ls -la gitlab-ci; fi
|
||||
- first_sha1=$(git log origin/$target_branch..$CI_COMMIT_BRANCH --format=format:%H | tail -1)
|
||||
- echo "[DEBUG] First Commit SHA[$first_sha1]"
|
||||
- echo "[DEBUG] artifacts directory [$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME]"
|
||||
after_script:
|
||||
- ls -lR "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE"
|
||||
- cd ..
|
||||
- rm -Rf check
|
||||
artifacts:
|
||||
expire_in: 3 days
|
||||
when: always
|
||||
paths:
|
||||
- "$CI_PROJECT_DIR/artifacts/*"
|
||||
reports:
|
||||
junit:
|
||||
- "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/*.junit.xml"
|
||||
rules:
|
||||
- if: '$JOB_STOP_CONVENTIONAL_COMMITS'
|
||||
when: never
|
||||
|
||||
- if: # condition_any_branch_push
|
||||
$CI_COMMIT_BRANCH != null &&
|
||||
$CI_COMMIT_TAG == null &&
|
||||
$CI_PIPELINE_SOURCE == "push" &&
|
||||
$CI_COMMIT_BRANCH != 'master'
|
||||
exists:
|
||||
- .cz.yaml
|
||||
when: always
|
||||
|
||||
- when: never
|
||||
|
||||
|
||||
MR Title:
|
||||
extends:
|
||||
- .conventional_commit
|
||||
script:
|
||||
- MR_TITLE=$($ROOT_DIR/conventional_commits/scripts/commit.py --token "$MR_ACCESS_TOKEN" --project $PROJECT_ID --title --branch $CI_COMMIT_BRANCH)
|
||||
- echo "[DEBUG] MR_TITLE[$MR_TITLE]"
|
||||
- cz_exit=0 && cz check --message "$MR_TITLE" > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/cz_output.log" 2>&1 || cz_exit=$?
|
||||
- . $ROOT_DIR/conventional_commits/scripts/cz_junit.sh > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/$CI_JOB_NAME-cz.junit.xml"
|
||||
extends:
|
||||
- .conventional_commit
|
||||
script:
|
||||
- MR_TITLE=$($ROOT_DIR/conventional_commits/scripts/commit.py --token "$MR_ACCESS_TOKEN" --project $PROJECT_ID --title --branch $CI_COMMIT_BRANCH)
|
||||
- echo "[DEBUG] MR_TITLE[$MR_TITLE]"
|
||||
- cz_exit=0 && cz check --message "$MR_TITLE" > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/cz_output.log" 2>&1 || cz_exit=$?
|
||||
- . $ROOT_DIR/conventional_commits/scripts/cz_junit.sh > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/$CI_JOB_NAME-cz.junit.xml"
|
||||
|
||||
|
||||
Commit Messages:
|
||||
extends:
|
||||
- .conventional_commit
|
||||
script:
|
||||
- if [ "$(git log $first_sha1..HEAD --format=format:%H | wc -l)" -eq 0 ]; then echo "[DEBUG] Single Commit"; cz_exit=0 && cz check -m "$(git log HEAD --format=format:%B -1)" > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/cz_output.log" 2>&1 || cz_exit=$?; fi
|
||||
- if [ "$(git log $first_sha1..HEAD --format=format:%H | wc -l)" -gt 0 ]; then echo "[DEBUG] Commit range"; cz_exit=0 && cz check --rev-range $first_sha1..HEAD > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/cz_output.log" 2>&1 || cz_exit=$?; fi
|
||||
- . $ROOT_DIR/conventional_commits/scripts/cz_junit.sh > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/$CI_JOB_NAME-cz.junit.xml"
|
||||
extends:
|
||||
- .conventional_commit
|
||||
script:
|
||||
- if [ "$(git log $first_sha1..HEAD --format=format:%H | wc -l)" -eq 0 ]; then echo "[DEBUG] Single Commit"; cz_exit=0 && cz check -m "$(git log HEAD --format=format:%B -1)" > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/cz_output.log" 2>&1 || cz_exit=$?; fi
|
||||
- if [ "$(git log $first_sha1..HEAD --format=format:%H | wc -l)" -gt 0 ]; then echo "[DEBUG] Commit range"; cz_exit=0 && cz check --rev-range $first_sha1..HEAD > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/cz_output.log" 2>&1 || cz_exit=$?; fi
|
||||
- . $ROOT_DIR/conventional_commits/scripts/cz_junit.sh > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/$CI_JOB_NAME-cz.junit.xml"
|
||||
|
@ -1,5 +1,18 @@
|
||||
# Changelog
|
||||
|
||||
2023-05-28 10:31:26 +0930 [bade89c](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/bade89c5333ca853844e224f46a2d3dafab7179d) - fix(scheduled_pipelines): if scheduled pipeline only run schedualable jobs
|
||||
2023-05-24 04:40:52 +0000 [0a17fe1](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/0a17fe1aa320c658c05d7a693ff76af4a54e6130) - build(version): bump version 0.6.1rc1 → 0.6.1rc2
|
||||
2023-05-21 01:48:53 +0930 [088c9fb](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/088c9fb04c80961f4de8d2b129955ae8cd0b9529) - feat(conventional_commits): ensure .cz.yaml exists
|
||||
2023-05-15 00:18:38 +0000 [a3fdca8](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a3fdca83bf7acb58d47792a66d1cd0728747361c) - build(version): bump version 0.6.1rc0 → 0.6.1rc1
|
||||
2023-05-15 09:32:15 +0930 [93931cb](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/93931cb9076e0db238f4e297abe3d8f37bd71b80) - feat(conventional): job not to run when bot pushes change
|
||||
2023-05-15 09:23:02 +0930 [76db5b1](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/76db5b17578d8585ed31e0728dbfb37ea2fae153) - fix(conventional_commits): never run on git tag
|
||||
2023-05-14 14:10:06 +0930 [02e9e5f](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/02e9e5f4f4cc0b93ae92c7ba3a2cfb38305af64c) - refactor(ci): inconsistant tabs
|
||||
2023-05-14 12:11:42 +0930 [d389d14](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/d389d14192e1e483fbd48fa9b5c5bee25db14a20) - fix: validation jobs on all except merge
|
||||
2023-05-14 09:56:35 +0930 [934a401](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/934a401a9620891b09a5fe9c9b0e50a97b43fa9b) - fix(ci): specify the commitizen version
|
||||
2023-05-13 15:35:28 +0930 [408e4ea](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/408e4eab9e1f61004f1e38af6d1531747b7da99b) - refactor: move docs as part of restructure
|
||||
2023-05-13 11:47:21 +0930 [9e7d357](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/9e7d357bab2b92704d37ad5621df9fe8d1e31a26) - feat(conventional_commits): ability to disable job with variable
|
||||
2022-01-25 00:08:05 +0000 [ce1cc01](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/ce1cc017e26ff7f6cee586cc7d98e4d292275672) - build(version): bump version 0.6.0 → 0.6.1rc0
|
||||
2022-01-24 06:33:24 +0000 [46cc1fb](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/46cc1fbb6a878e485af39e679b5184a9912c2e7f) - build(version): bump version 0.5.0 → 0.6.0
|
||||
2022-01-16 00:09:42 +0000 [1ef6c41](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/1ef6c41818c40183f8019ea5cde48b4278e4d694) - build(version): bump version 0.4.0 → 0.5.0
|
||||
2022-01-16 09:02:02 +0930 [31517b4](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/31517b4bf00c1f177ef925d09b1a6714577f62c5) - ci(MR_Title): save the merge request title as a variable and debug output in job log.
|
||||
2022-01-16 08:48:24 +0930 [73918f2](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/73918f2f5e19440d0e300da3a20712739c316d88) - fix(commit.py): filter merge request search to 'opened' and on current branch.
|
||||
|
@ -1,94 +0,0 @@
|
||||
# Conventional Commits User Manual
|
||||
Commitizen is used to validate the format of commit messages. we use [Conventional Commit Messages](https://www.conventionalcommits.org/en/v1.0.0/) format for our validation jobs.
|
||||
|
||||
This repository may have two CI jobs to do with commitizen:
|
||||
- **MR Title** *Checks the Merge Request Title*
|
||||
- **Commit Messages** *Checks all commit messages*
|
||||
|
||||
These CI Jobs output a test report that can be viewed inside of the merge request and contain the error(s), if any.
|
||||
|
||||
To fix an error please refer to the titled sections below.
|
||||
|
||||
## MR Title
|
||||
Ensure that the merge request title is in the [conventional message](https://www.conventionalcommits.org/en/v1.0.0/) format. NOTE: the title is case sensitive.
|
||||
|
||||
|
||||
## Commit Messages
|
||||
All commit messages that form part of your merge request must be in [conventional message](https://www.conventionalcommits.org/en/v1.0.0/) format.
|
||||
|
||||
To fix them go back and edit your commit messages.
|
||||
|
||||
|
||||
### fixing commit messages (suggestion)
|
||||
|
||||
If only the last commit is the commit with an error just use `git commit --amend` and edit your commit message to be in the correct format and save. now push your changes.
|
||||
|
||||
|
||||
You will require the following information if the commit message with the error is further down the commit tree:
|
||||
- Commit message SHA1 of your first commit message to the branch `{original_commit}`
|
||||
- Commit message SHA1 prior to your first commit `{source_commit}`
|
||||
|
||||
Run these commands once you have the information above.
|
||||
``` bash
|
||||
git format-patch {original_commit}..HEAD -o diff-patches
|
||||
|
||||
git reset {source_commit} --hard
|
||||
```
|
||||
|
||||
Now, navigate to the `diff-patches` folder, open up the offending patch (commit) and edit the `subject` or message body as appropriate and save. Once all the edits have been done, re-apply the patches to your tree with:
|
||||
|
||||
``` bash
|
||||
git am diff-patches/*.patch
|
||||
```
|
||||
Now push your changes upstream.
|
||||
|
||||
| :notebook_with_decorative_cover: Note |
|
||||
|:-----:|
|
||||
| *As you have changed the commit SHA1(s), when you next push your changes upstream, you must force push. `git push --force`* |
|
||||
|
||||
| :octagonal_sign: **WARNING** |
|
||||
|:-----:|
|
||||
| *Ensure that all of your commits were exported prior to reseting the branch and when re-applying, that all of your commits were applied correctly* |
|
||||
|
||||
|
||||
# Conventional Commits Admin Manual Manual
|
||||
This job checks commit messages on a branch and the merge request title for validity against the [conventional commit format](https://www.conventionalcommits.org/en/v1.0.0/)
|
||||
|
||||
This job provides the following badge:
|
||||
|
||||
- None
|
||||
|
||||
## Dependencies
|
||||
|
||||
- None
|
||||
|
||||
## your .gitlab-ci.yml changes
|
||||
To use this job add the following to your `.gitlab-ci.yml` file
|
||||
|
||||
``` yaml
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
MY_PROJECT_ID: "{yourproject id number}"
|
||||
|
||||
stages:
|
||||
- validation
|
||||
|
||||
include:
|
||||
- remote: https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/raw/development/conventional_commits/.gitlab-ci.yml
|
||||
```
|
||||
|
||||
## CI/CD Variables required
|
||||
|
||||
| var name | Description |
|
||||
|:----:|:----|
|
||||
| MR_ACCESS_TOKEN | *only required if you are accessing a private repository.* <br>This token is a user access token that as a minimum requires read-only access to the api to fetch the projects merg requests. |
|
||||
|
||||
|
||||
## Job Workflow
|
||||
|
||||
|
||||
## Artifacts
|
||||
|
||||
|
||||
## License
|
||||
To view the license for this folder and any sub-folders, refer [here](https://gitlab.com/nofusscomputing/projects/gitlab-ci)
|
@ -1,3 +1,3 @@
|
||||
python-gitlab
|
||||
requests
|
||||
commitizen
|
||||
commitizen==2.21.0
|
||||
|
6
docker/CHANGELOG.md
Normal file
6
docker/CHANGELOG.md
Normal file
@ -0,0 +1,6 @@
|
||||
# Changelog
|
||||
|
||||
2023-05-28 10:31:26 +0930 [bade89c](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/bade89c5333ca853844e224f46a2d3dafab7179d) - fix(scheduled_pipelines): if scheduled pipeline only run schedualable jobs
|
||||
2023-05-24 04:40:52 +0000 [0a17fe1](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/0a17fe1aa320c658c05d7a693ff76af4a54e6130) - build(version): bump version 0.6.1rc1 → 0.6.1rc2
|
||||
2023-05-21 01:47:15 +0930 [f604c6e](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/f604c6e27d2e7704491f4c78979db40cf89764c0) - fix(docker): ensure qemu binfmt is loaded
|
||||
2023-05-17 15:41:09 +0930 [a90ccb8](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a90ccb81772e295cebe89d7a9c32ab700e19884d) - refactor(docker): move docker jobs to their own file
|
133
docker/build.gitlab-ci.yaml
Normal file
133
docker/build.gitlab-ci.yaml
Normal file
@ -0,0 +1,133 @@
|
||||
---
|
||||
|
||||
variables:
|
||||
# Available platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
|
||||
# DOCKER_IMAGE_BUILD_TARGET_PLATFORMS: "linux/amd64,linux/arm64,linux/arm/v7"
|
||||
DOCKER_IMAGE_BUILD_NAME: $CI_PROJECT_NAME
|
||||
DOCKER_IMAGE_BUILD_REGISTRY: $CI_REGISTRY_IMAGE
|
||||
DOCKER_IMAGE_BUILD_TAG: $CI_COMMIT_SHA
|
||||
|
||||
# DOCKER_IMAGE_PUBLISH_NAME: $CI_PROJECT_NAME
|
||||
# DOCKER_IMAGE_PUBLISH_REGISTRY: docker.io/nofusscomputing
|
||||
# DOCKER_IMAGE_PUBLISH_URL: https://hub.docker.com/r/nofusscomputing/$DOCKER_IMAGE_PUBLISH_NAME
|
||||
# JOB_STOP_CONVENTIONAL_COMMITS: 'any_value'
|
||||
# JOB_STOP_GIT_PUSH_MIRROR: 'any_value'
|
||||
# GIT_SYNC_URL: "https://$GITHUB_USERNAME_ROBOT:$GITHUB_TOKEN_ROBOT@github.com/NoFussComputing/config.git" # Must be defined for job to run
|
||||
# JOB_STOP_GITLAB_RELEASE: 'any value'
|
||||
|
||||
|
||||
.build_docker_container:
|
||||
stage: build
|
||||
image:
|
||||
name: nofusscomputing/docker-buildx-qemu:dev
|
||||
pull_policy: always
|
||||
services:
|
||||
- name: docker:23-dind
|
||||
entrypoint: ["env", "-u", "DOCKER_HOST"]
|
||||
command: ["dockerd-entrypoint.sh"]
|
||||
variables:
|
||||
DOCKER_HOST: tcp://docker:2375/
|
||||
DOCKER_DRIVER: overlay2
|
||||
DOCKER_DOCKERFILE: dockerfile
|
||||
# See https://github.com/docker-library/docker/pull/166
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
before_script:
|
||||
- git submodule foreach git submodule update --init
|
||||
- if [ "0$JOB_ROOT_DIR" == "0" ]; then ROOT_DIR=gitlab-ci; else ROOT_DIR=$JOB_ROOT_DIR ; fi
|
||||
- echo "[DEBUG] ROOT_DIR[$ROOT_DIR]"
|
||||
- docker info
|
||||
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||
#- pip3 install -r gitlab-ci/gitlab_release/requirements.txt
|
||||
- pip3 install setuptools wheel
|
||||
- pip install -r $ROOT_DIR/conventional_commits/requirements.txt
|
||||
- pip3 install gitlab-ci/gitlab_release/python-module/cz_nfc/.
|
||||
# see: https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/1861
|
||||
# on why this `docker run` is required. without it multiarch support doesnt work.
|
||||
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||
- update-binfmts --display
|
||||
- update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel
|
||||
- docker buildx create --driver=docker-container --driver-opt image=moby/buildkit:v0.11.6 --use
|
||||
- docker buildx inspect --bootstrap
|
||||
|
||||
|
||||
# --label org.opencontainers.image.url="$CI_PROJECT_URL/-/releases/$(cz -n cz_nfc version --project)" \
|
||||
# --label org.opencontainers.image.version="$(cz -n cz_nfc version --project)" \
|
||||
script:
|
||||
- update-binfmts --display
|
||||
- |
|
||||
|
||||
if [ "0$DOCKER_IMAGE_BUILD_TARGET_PLATFORMS" != "0" ]; then
|
||||
|
||||
echo "[DEBUG] building multiarch/specified arch image";
|
||||
|
||||
docker buildx build --platform=$DOCKER_IMAGE_BUILD_TARGET_PLATFORMS . \
|
||||
--label org.opencontainers.image.created="$(date '+%Y-%m-%d %H:%M:%S%:z')" \
|
||||
--label org.opencontainers.image.documentation="$CI_PROJECT_URL" \
|
||||
--label org.opencontainers.image.source="$CI_PROJECT_URL" \
|
||||
--label org.opencontainers.image.revision="$CI_COMMIT_SHA" \
|
||||
--push \
|
||||
--build-arg CI_JOB_TOKEN=$CI_JOB_TOKEN --build-arg CI_PROJECT_ID=$CI_PROJECT_ID --build-arg CI_API_V4_URL=$CI_API_V4_URL \
|
||||
--file $DOCKER_DOCKERFILE \
|
||||
--tag $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG;
|
||||
|
||||
docker buildx imagetools inspect $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG;
|
||||
|
||||
# during docker multi platform build there are >=3 additional unknown images added to gitlab container registry. cleanup
|
||||
|
||||
DOCKER_MULTI_ARCH_IMAGES=$(docker buildx imagetools inspect "$DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG" --format "{{ range .Manifest.Manifests }}{{ if ne (print .Platform) \"&{unknown unknown [] }\" }}$DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG@{{ println .Digest }}{{end}} {{end}}");
|
||||
|
||||
docker buildx imagetools create $DOCKER_MULTI_ARCH_IMAGES --tag $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG;
|
||||
|
||||
docker buildx imagetools inspect $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG;
|
||||
|
||||
else
|
||||
|
||||
echo "[DEBUG] building image";
|
||||
|
||||
docker build . \
|
||||
--label org.opencontainers.image.created="$(date '+%Y-%m-%d %H:%M:%S%:z')" \
|
||||
--label org.opencontainers.image.documentation="$CI_PROJECT_URL" \
|
||||
--label org.opencontainers.image.source="$CI_PROJECT_URL" \
|
||||
--label org.opencontainers.image.url="$CI_PROJECT_URL/-/releases/$(cz -n cz_nfc version --project)" \
|
||||
--label org.opencontainers.image.version="$(cz -n cz_nfc version --project)" \
|
||||
--label org.opencontainers.image.revision="$CI_COMMIT_SHA" \
|
||||
--build-arg CI_JOB_TOKEN=$CI_JOB_TOKEN --build-arg CI_PROJECT_ID=$CI_PROJECT_ID --build-arg CI_API_V4_URL=$CI_API_V4_URL \
|
||||
--file $DOCKER_DOCKERFILE \
|
||||
--tag $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG;
|
||||
|
||||
docker push $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG;
|
||||
|
||||
fi
|
||||
rules:
|
||||
|
||||
- if: # condition_git_tag
|
||||
$CI_COMMIT_TAG != null &&
|
||||
$CI_COMMIT_BRANCH == null
|
||||
exists:
|
||||
- '{dockerfile,dockerfile.j2}'
|
||||
when: on_success
|
||||
|
||||
- if: # condition_dev_branch_push
|
||||
$CI_COMMIT_BRANCH == "development" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
exists:
|
||||
- '{dockerfile,dockerfile.j2}'
|
||||
changes:
|
||||
paths:
|
||||
- '{dockerfile,dockerfile.j2,includes/**/*}'
|
||||
compare_to: 'master'
|
||||
when: always
|
||||
|
||||
- if: # condition_not_master_or_dev_push
|
||||
$CI_COMMIT_BRANCH != "master" &&
|
||||
$CI_COMMIT_BRANCH != "development" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
exists:
|
||||
- '{dockerfile,dockerfile.j2}'
|
||||
changes:
|
||||
paths:
|
||||
- '{dockerfile,dockerfile.j2,includes/**/*}'
|
||||
compare_to: 'development'
|
||||
when: always
|
||||
|
||||
- when: never
|
130
docker/publish.gitlab-ci.yaml
Normal file
130
docker/publish.gitlab-ci.yaml
Normal file
@ -0,0 +1,130 @@
|
||||
---
|
||||
# variables:
|
||||
# # Available platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
|
||||
# # DOCKER_IMAGE_BUILD_TARGET_PLATFORMS: "linux/amd64,linux/arm64,linux/arm/v7"
|
||||
# DOCKER_IMAGE_BUILD_NAME: $CI_PROJECT_NAME
|
||||
# DOCKER_IMAGE_BUILD_REGISTRY: $CI_REGISTRY_IMAGE
|
||||
# DOCKER_IMAGE_BUILD_TAG: $CI_COMMIT_SHA
|
||||
|
||||
|
||||
.publish-docker-hub:
|
||||
stage: publish
|
||||
image: docker:23-dind
|
||||
services:
|
||||
- docker:23-dind
|
||||
before_script:
|
||||
- |
|
||||
|
||||
docker login $CI_REGISTRY -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD;
|
||||
|
||||
if [ "0$DOCKER_IMAGE_BUILD_TARGET_PLATFORMS" != "0" ]; then
|
||||
|
||||
for i in ${DOCKER_IMAGE_BUILD_TARGET_PLATFORMS//,/ }
|
||||
do
|
||||
|
||||
docker buildx imagetools inspect $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG;
|
||||
|
||||
#DOCKER_MULTI_ARCH_IMAGES=$(docker buildx imagetools inspect "$DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG" --format "{{ range .Manifest.Manifests }}{{ if ne (print .Platform) \"&{unknown unknown [] }\" }}$DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG@{{ println .Digest }}{{end}} {{end}}")
|
||||
DOCKER_MULTI_ARCH_IMAGES=$(docker buildx imagetools inspect "$DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG" --format "{{ range .Manifest.Manifests }}$DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG@{{ println .Digest }} {{end}}")
|
||||
|
||||
|
||||
echo "[DEBUG] DOCKER_MULTI_ARCH_IMAGES=$DOCKER_MULTI_ARCH_IMAGES";
|
||||
|
||||
done;
|
||||
|
||||
else
|
||||
|
||||
docker pull $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG;
|
||||
|
||||
fi
|
||||
|
||||
#docker logout $CI_REGISTRY; # commented out to test if for private repo remaining logged in works to allow pulling image
|
||||
|
||||
script:
|
||||
- docker login docker.io -u $NFC_DOCKERHUB_USERNAME -p $NFC_DOCKERHUB_TOKEN
|
||||
- docker image ls
|
||||
- |
|
||||
DOCKER_HUB_TAG=dev
|
||||
|
||||
echo "[DEBUG] default: DOCKER_HUB_TAG=$DOCKER_HUB_TAG";
|
||||
|
||||
if [ "0$CI_COMMIT_TAG" != "0" ]; then
|
||||
|
||||
DOCKER_HUB_TAG=latest
|
||||
|
||||
echo "[DEBUG] stable: DOCKER_HUB_TAG=$DOCKER_HUB_TAG";
|
||||
|
||||
if [[ "0$CI_COMMIT_TAG" == *"rc"* ]]; then
|
||||
|
||||
DOCKER_HUB_TAG=dev
|
||||
|
||||
echo "[DEBUG] dev: DOCKER_HUB_TAG=$DOCKER_HUB_TAG";
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
echo "[DEBUG] DOCKER_IMAGE_PUBLISH_NAME=$DOCKER_IMAGE_PUBLISH_NAME";
|
||||
echo "[DEBUG] final: DOCKER_HUB_TAG=$DOCKER_HUB_TAG";
|
||||
|
||||
if [ "0$DOCKER_IMAGE_BUILD_TARGET_PLATFORMS" != "0" ]; then
|
||||
|
||||
echo "[DEBUG] DOCKER_MULTI_ARCH_IMAGES=$DOCKER_MULTI_ARCH_IMAGES";
|
||||
|
||||
docker buildx imagetools create $DOCKER_MULTI_ARCH_IMAGES --tag $DOCKER_IMAGE_PUBLISH_REGISTRY/$DOCKER_IMAGE_PUBLISH_NAME:$DOCKER_HUB_TAG;
|
||||
|
||||
if [ "0$CI_COMMIT_TAG" != "0" ]; then
|
||||
|
||||
docker buildx imagetools create $DOCKER_MULTI_ARCH_IMAGES --tag $DOCKER_IMAGE_PUBLISH_REGISTRY/$DOCKER_IMAGE_PUBLISH_NAME:$CI_COMMIT_TAG;
|
||||
|
||||
fi
|
||||
|
||||
else
|
||||
|
||||
docker image tag $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG $DOCKER_IMAGE_PUBLISH_REGISTRY/$DOCKER_IMAGE_PUBLISH_NAME:$DOCKER_HUB_TAG;
|
||||
|
||||
docker push $DOCKER_IMAGE_PUBLISH_REGISTRY/$DOCKER_IMAGE_PUBLISH_NAME:$DOCKER_HUB_TAG;
|
||||
|
||||
if [ "0$CI_COMMIT_TAG" != "0" ]; then
|
||||
|
||||
docker image tag $DOCKER_IMAGE_BUILD_NAME/$DOCKER_IMAGE_BUILD_REGISTRY:$DOCKER_IMAGE_BUILD_TAG $DOCKER_IMAGE_PUBLISH_REGISTRY/$DOCKER_IMAGE_PUBLISH_NAME:$CI_COMMIT_TAG;
|
||||
|
||||
docker push $DOCKER_IMAGE_PUBLISH_REGISTRY/$DOCKER_IMAGE_PUBLISH_NAME:$CI_COMMIT_TAG;
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
- docker logout docker.io
|
||||
environment:
|
||||
name: DockerHub
|
||||
url: $DOCKER_IMAGE_PUBLISH_URL
|
||||
rules:
|
||||
|
||||
- if: # condition_git_tag
|
||||
$CI_COMMIT_TAG != null &&
|
||||
$CI_COMMIT_BRANCH == null
|
||||
exists:
|
||||
- '{dockerfile,dockerfile.j2}'
|
||||
when: on_success
|
||||
|
||||
# - if: # condition_master_branch_push
|
||||
# $CI_COMMIT_BRANCH == "master" &&
|
||||
# $CI_PIPELINE_SOURCE == "push"
|
||||
# exists:
|
||||
# - '{dockerfile,dockerfile.j2}'
|
||||
# when: on_success
|
||||
|
||||
- if: # condition_dev_branch_push
|
||||
$CI_COMMIT_BRANCH == "development" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
exists:
|
||||
- '{dockerfile,dockerfile.j2}'
|
||||
changes:
|
||||
paths:
|
||||
- '{dockerfile,dockerfile.j2,includes/**/*}'
|
||||
compare_to: 'master'
|
||||
allow_failure: true
|
||||
when: on_success
|
||||
|
||||
- when: never
|
0
docs/articles/index.md
Normal file
0
docs/articles/index.md
Normal file
0
docs/contact.md
Normal file
0
docs/contact.md
Normal file
0
docs/index.md
Normal file
0
docs/index.md
Normal file
0
docs/operations/index.md
Normal file
0
docs/operations/index.md
Normal file
171
docs/projects/gitlab-ci/ansible_playbook.md
Normal file
171
docs/projects/gitlab-ci/ansible_playbook.md
Normal file
@ -0,0 +1,171 @@
|
||||
---
|
||||
title: Ansible Playbook
|
||||
description: How to use No Fuss Computings gitlab-ci job for running Ansible Playbooks
|
||||
date: 2023-05-29
|
||||
template: project.html
|
||||
about: https://gitlab.com/nofusscomputing/projects/gitlab-ci
|
||||
---
|
||||
|
||||
This job enables you to run an Ansible playbook within the Gitlab CI/CD environment.
|
||||
|
||||
|
||||
There is also an additional job defined that enables you to specify a project to run an automated update of it's git submodules. This is useful if the project you create the job in, is used as a git submodule in another project. On pushing to the development branch, this job triggers the `Git.Submodules.Update.Chores` job that updates the specified projects git submodules.
|
||||
|
||||
|
||||
|
||||
## your .gitlab-ci.yml changes
|
||||
|
||||
- **Mandatory** In addition to the previous dependency, this requirement is for the project specified in the trigger job. The following must be added to the `.gitlab-ci.yml` file in that project.
|
||||
|
||||
``` yaml
|
||||
include:
|
||||
- project: nofusscomputing/projects/gitlab-ci
|
||||
ref: master
|
||||
file:
|
||||
- .gitlab-ci_common.yaml
|
||||
- automation/template/automagic.gitlab-ci.yaml
|
||||
```
|
||||
|
||||
To use the ansible playbook job add the following to your `.gitlab-ci.yml` file.
|
||||
|
||||
``` yaml
|
||||
|
||||
stages:
|
||||
- chores
|
||||
|
||||
include:
|
||||
- project: nofusscomputing/projects/gitlab-ci
|
||||
ref: master
|
||||
file:
|
||||
- automation/.gitlab-ci-ansible.yaml
|
||||
|
||||
Ansible Job:
|
||||
extends: .ansible_playbook
|
||||
variables:
|
||||
ansible_playbook: 'git_configuration.yaml'
|
||||
ansible_tags: 'submodule'
|
||||
PIPELINE_RUN_TRIGGER: 'false'
|
||||
PIPELINE_RUN_SCHEDULE: 'false'
|
||||
|
||||
```
|
||||
|
||||
To run the trigger job to update another projects git submodules. add the following to your `.gitlab-ci.yml` file
|
||||
|
||||
``` yaml
|
||||
|
||||
stages:
|
||||
- publish
|
||||
|
||||
include:
|
||||
- project: nofusscomputing/projects/gitlab-ci
|
||||
ref: master
|
||||
file:
|
||||
- automation/.gitlab-ci-ansible.yaml
|
||||
|
||||
Docker_Mail.Submodule.Deploy:
|
||||
extends: .submodule_update_trigger
|
||||
variables:
|
||||
SUBMODULE_UPDATE_TRIGGER_PROJECT: nofusscomputing/projects/docker-mail
|
||||
|
||||
```
|
||||
|
||||
!!! Tip
|
||||
In addition to the variables below, you can also specify any additional Environment variables for use by Ansible within the container. Refer to the [Ansible configuration documentation](https://docs.ansible.com/ansible/latest/reference_appendices/config.html#common-options) for further details
|
||||
|
||||
|
||||
## Job: `.ansible_playbook`
|
||||
|
||||
This job runs an Ansible playbook using the `nofusscomputing/ansible-ee:dev` Docker image.
|
||||
|
||||
|
||||
### Stage: Chores
|
||||
|
||||
This job is responsible for executing an Ansible playbook. It can be customized by setting the following variables:
|
||||
|
||||
|
||||
#### Variables
|
||||
|
||||
- `ansible_inventory`: The Ansible inventory file.
|
||||
|
||||
- `ansible_playbook`: The name of the Ansible playbook file.
|
||||
|
||||
- `ansible_tags`: The tags to be applied during playbook execution.
|
||||
|
||||
|
||||
### Rules
|
||||
|
||||
- Rule 1: If the `NFC_AUTO_JOBS` variable is set to `"false"`, the job will never run.
|
||||
|
||||
- Rule 2: If the pipeline is triggered by a schedule and `PIPELINE_RUN_SCHEDULE` is set to `"true"`, the job will run only if the `.nfc_automation.yaml` file exists.
|
||||
|
||||
- Rule 3: If the pipeline is triggered by an API call, another pipeline, a trigger, or a parent pipeline, and `PIPELINE_RUN_TRIGGER` is set to `"true"`, the job will run only if the `.nfc_automation.yaml` file exists.
|
||||
|
||||
- Rule 4: If the pipeline is triggered by a push to the `development` branch, the job will run only if the `.nfc_automation.yaml` file exists. see [Documentation](../git_configuration/submodule/) for file details.
|
||||
|
||||
- Rule 5: This rule prevents the job from running under any circumstances.
|
||||
|
||||
|
||||
## Job: `.ansible_playbook_git_submodule`
|
||||
|
||||
This job extends the `.ansible_playbook` job and is specifically used for running the `git_configuration.yaml` playbook with the `submodule` tags.
|
||||
|
||||
|
||||
### Stage: Chores
|
||||
|
||||
This job is responsible for executing the `git_configuration.yaml` playbook with the `submodule` tags.
|
||||
|
||||
|
||||
#### Variables
|
||||
|
||||
- `ansible_playbook`: The name of the Ansible playbook file (`git_configuration.yaml`).
|
||||
|
||||
- `ansible_tags`: The tags to be applied during playbook execution (`submodule`).
|
||||
|
||||
|
||||
### Rules
|
||||
|
||||
- Rule 1: If the `NFC_AUTO_JOBS` variable is set to `"false"`, the job will never run.
|
||||
|
||||
- Rule 2: If the pipeline is triggered by a schedule and `PIPELINE_RUN_SCHEDULE` is set to `"true"`, the job will run only if the `.nfc_automation.yaml` file exists.
|
||||
|
||||
- Rule 3: If the pipeline is triggered by an API call, another pipeline, a trigger, or a parent pipeline, and `PIPELINE_RUN_TRIGGER` is set to `"true"`, the job will run only if the `.nfc_automation.yaml` file exists. see [Documentation](../git_configuration/submodule/) for file details.
|
||||
|
||||
- Rule 4: If the pipeline is triggered by a push to the `development` branch, the job will run only if the `.nfc_automation.yaml` file exists.
|
||||
|
||||
- Rule 5: This rule prevents the job from running under any circumstances.
|
||||
|
||||
|
||||
## Job: `.submodule_update_trigger`
|
||||
|
||||
This job triggers a pipeline in another project.
|
||||
|
||||
|
||||
### Stage: Publish
|
||||
|
||||
This job is responsible for triggering a pipeline in another project.
|
||||
|
||||
|
||||
#### Variables
|
||||
|
||||
- `PIPELINE_RUN_TRIGGER`: The flag to indicate if the triggered pipeline should run (`true`).
|
||||
|
||||
|
||||
### Rules
|
||||
|
||||
- Rule 1: If the pipeline is triggered by a push to the `master` or `development` branch, and there is no associated tag, the job will run on successful completion.
|
||||
|
||||
- Rule 2: This rule prevents the job from running under any other circumstances.
|
||||
|
||||
|
||||
## Artifacts
|
||||
|
||||
- None
|
||||
|
||||
|
||||
## gitlab-ci.yml definition
|
||||
|
||||
``` yaml title=".gitlab-ci.yml" linenums="1"
|
||||
|
||||
--8<-- "automation/.gitlab-ci-ansible.yaml"
|
||||
|
||||
```
|
157
docs/projects/gitlab-ci/conventional_commits.md
Normal file
157
docs/projects/gitlab-ci/conventional_commits.md
Normal file
@ -0,0 +1,157 @@
|
||||
---
|
||||
title: Conventional Commits
|
||||
description: How to use No Fuss Computings gitlab-ci job for Conventional Commits
|
||||
date: 2021-08-03
|
||||
template: project.html
|
||||
about: https://gitlab.com/nofusscomputing/projects/gitlab-ci
|
||||
---
|
||||
|
||||
## User Manual
|
||||
|
||||
Commitizen is used to validate the format of commit messages. we use [Conventional Commit Messages](https://www.conventionalcommits.org/en/v1.0.0/) format for our validation jobs.
|
||||
|
||||
This repository may have two CI jobs to do with commitizen:
|
||||
|
||||
- **MR Title** *Checks the Merge Request Title*
|
||||
|
||||
- **Commit Messages** *Checks all commit messages*
|
||||
|
||||
These CI Jobs output a test report that can be viewed inside of the merge request and contain the error(s), if any.
|
||||
|
||||
To fix an error please refer to the titled sections below.
|
||||
|
||||
|
||||
### MR Title
|
||||
|
||||
Ensure that the merge request title is in the [conventional message](https://www.conventionalcommits.org/en/v1.0.0/) format. NOTE: the title is case sensitive.
|
||||
|
||||
|
||||
### Commit Messages
|
||||
|
||||
All commit messages that form part of your merge request must be in [conventional message](https://www.conventionalcommits.org/en/v1.0.0/) format.
|
||||
|
||||
To fix them go back and edit your commit messages.
|
||||
|
||||
|
||||
#### fixing commit messages (suggestion)
|
||||
|
||||
If only the last commit is the commit with an error just use `git commit --amend` and edit your commit message to be in the correct format and save. now push your changes.
|
||||
|
||||
You will require the following information if the commit message with the error is further down the commit tree:
|
||||
|
||||
- Commit message SHA1 of your first commit message to the branch `{original_commit}`
|
||||
|
||||
- Commit message SHA1 prior to your first commit `{source_commit}`
|
||||
|
||||
Run these commands once you have the information above.
|
||||
|
||||
``` bash
|
||||
|
||||
git format-patch {original_commit}..HEAD -o ../diff-patches
|
||||
|
||||
git reset {source_commit} --hard
|
||||
|
||||
```
|
||||
|
||||
Now, navigate to the `diff-patches` folder, open up the offending patch (commit) and edit the `subject` or message body as appropriate and save. Once all the edits have been done, re-apply the patches to your tree with:
|
||||
|
||||
``` bash
|
||||
|
||||
git am ../diff-patches/*.patch
|
||||
|
||||
```
|
||||
|
||||
Now push your changes upstream.
|
||||
|
||||
| :notebook_with_decorative_cover: Note |
|
||||
|:-----:|
|
||||
| *As you have changed the commit SHA1(s), when you next push your changes upstream, you must force push. `git push --force`* |
|
||||
|
||||
| :octagonal_sign: **WARNING** |
|
||||
|:-----:|
|
||||
| *Ensure that all of your commits were exported prior to reseting the branch and when re-applying, that all of your commits were applied correctly* |
|
||||
|
||||
|
||||
## GitLab CI Template - `.conventional_commit`
|
||||
|
||||
This GitLab CI template, named `.conventional_commit`, is designed to validate conventional commits within a GitLab CI/CD pipeline. It follows predefined rules to ensure that commit message conventions are met.
|
||||
|
||||
|
||||
### your .gitlab-ci.yml changes
|
||||
|
||||
To use this job add the following to your `.gitlab-ci.yml` file
|
||||
|
||||
``` yaml
|
||||
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
MY_PROJECT_ID: "{yourproject id number}"
|
||||
|
||||
stages:
|
||||
- validation
|
||||
|
||||
include:
|
||||
- remote: https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/raw/development/conventional_commits/.gitlab-ci.yml
|
||||
|
||||
```
|
||||
|
||||
|
||||
### Job Description
|
||||
|
||||
The `.conventional_commit` job performs various tasks related to validating conventional commits. It runs in the `validation` stage of the pipeline and uses the `python:3.6-slim` Docker image.
|
||||
|
||||
|
||||
### Variables
|
||||
|
||||
- `DEFAULT_ROOT_DIR`: The default root directory is set as `./gitlab-ci`.
|
||||
|
||||
- `MR_ACCESS_TOKEN`: The access token for the merge request. If not defined, it falls back to `CI_JOB_TOKEN`.
|
||||
|
||||
- `JOB_ROOT_DIR`: The root directory for the job. If not defined, it falls back to `DEFAULT_ROOT_DIR`.
|
||||
|
||||
- `MY_PROJECT_ID`: The custom project ID. If not defined, it falls back to `CI_PROJECT_ID`.
|
||||
|
||||
|
||||
### Stages
|
||||
|
||||
- `validation`: The job is assigned to the `validation` stage.
|
||||
|
||||
|
||||
### Script
|
||||
|
||||
The script section contains the actions performed during the job execution. These actions include creating directories, setting up variables, preparing the Python environment, and executing commands related to validating conventional commits.
|
||||
|
||||
The complete script can be found in the GitLab CI template file.
|
||||
|
||||
|
||||
### Artifacts
|
||||
|
||||
The job generates artifacts that are stored for a period of 3 days. The artifacts include the following paths:
|
||||
|
||||
- `$CI_PROJECT_DIR/artifacts/*`
|
||||
|
||||
- `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/*.junit.xml`
|
||||
|
||||
|
||||
### Rules
|
||||
|
||||
The job follows certain rules to determine when it should be executed:
|
||||
|
||||
- If the variable `$JOB_STOP_CONVENTIONAL_COMMITS` is true, the job will not run.
|
||||
|
||||
- If the branch is pushed and a commit is made, and there is no tag associated with the commit, and the pipeline source is "push", the job will run if `.cz.yaml` file exists.
|
||||
|
||||
- In all other cases, the job will not run.
|
||||
|
||||
This GitLab CI template provides a convenient way to validate conventional commits and enforce commit message conventions within your CI/CD pipelines.
|
||||
|
||||
|
||||
## Gitlab job Definition
|
||||
|
||||
When you include this definition the following makes up the job definition
|
||||
|
||||
``` yaml title=".gitlab-ci.yml" linenums="1"
|
||||
|
||||
--8<-- "conventional_commits/.gitlab-ci.yml"
|
||||
|
||||
```
|
56
docs/projects/gitlab-ci/docker_build.md
Normal file
56
docs/projects/gitlab-ci/docker_build.md
Normal file
@ -0,0 +1,56 @@
|
||||
---
|
||||
title: docker build Gitlab CI/CD jobs Template
|
||||
description: How to use No Fuss Computings gitlab-ci template for auto creation of CI/CD joobs.
|
||||
date: 2023-06-10
|
||||
template: project.html
|
||||
about: https://gitlab.com/nofusscomputing/projects/gitlab-ci
|
||||
---
|
||||
|
||||
This documentation provides an overview and explanation of the GitLab CI/CD YAML template. The template defines a job named `.build_docker_container` that builds a Docker container using the specified configuration.
|
||||
|
||||
|
||||
### Stage: build
|
||||
|
||||
This job builds a Docker container using the `nofusscomputing/docker-buildx-qemu:dev` image and the `docker:23-dind` service.
|
||||
|
||||
|
||||
#### Variables
|
||||
|
||||
- `DOCKER_IMAGE_BUILD_NAME`: The name of the Docker image to be built (`$CI_PROJECT_NAME`).
|
||||
|
||||
- `DOCKER_IMAGE_BUILD_REGISTRY`: The registry where the Docker image will be pushed (`$CI_REGISTRY_IMAGE`).
|
||||
|
||||
- `DOCKER_IMAGE_BUILD_TAG`: The tag to be applied to the Docker image (`$CI_COMMIT_SHA`).
|
||||
|
||||
|
||||
#### Rules
|
||||
|
||||
- Rule 1: The job runs if the pipeline is triggered by a git tag and a `dockerfile` or `dockerfile.j2` file exists.
|
||||
|
||||
- Rule 2: The job runs if the pipeline is triggered by a push to the `development` branch and a `dockerfile` or `dockerfile.j2` file exists. It also checks for changes in the `dockerfile`, `dockerfile.j2`, or `includes/` directory compared to the `master` branch.
|
||||
|
||||
- Rule 3: The job runs if the pipeline is triggered by a push to a branch other than `master` or `development` and a `dockerfile` or `dockerfile.j2` file exists. It also checks for changes in the `dockerfile`, `dockerfile.j2`, or `includes/` directory compared to the `development` branch.
|
||||
|
||||
- Rule 4: The job never runs.
|
||||
|
||||
|
||||
#### Script
|
||||
|
||||
The script performs the following steps:
|
||||
|
||||
1. Updates the binary formats and enables execution of other binary formats in the kernel.
|
||||
|
||||
2. Creates a Docker buildx builder and sets it as the active builder.
|
||||
|
||||
3. Builds a multi-arch Docker image if the `DOCKER_IMAGE_BUILD_TARGET_PLATFORMS` variable is specified. It applies labels to the image and pushes it to the specified registry. It also inspects the image and performs cleanup by removing additional unknown images from the container registry.
|
||||
|
||||
4. Builds a Docker image if the `DOCKER_IMAGE_BUILD_TARGET_PLATFORMS` variable is not specified. It applies labels to the image and pushes it to the specified registry.
|
||||
|
||||
|
||||
## gitlab-ci.yml definition
|
||||
|
||||
``` yaml title=".gitlab-ci.yml" linenums="1"
|
||||
|
||||
--8<-- "docker/build.gitlab-ci.yaml"
|
||||
|
||||
```
|
102
docs/projects/gitlab-ci/docker_publish.md
Normal file
102
docs/projects/gitlab-ci/docker_publish.md
Normal file
@ -0,0 +1,102 @@
|
||||
---
|
||||
title: docker publish Gitlab CI/CD jobs Template
|
||||
description: How to use No Fuss Computings gitlab-ci job template to publish a docker image to docker hub.
|
||||
date: 2023-06-10
|
||||
template: project.html
|
||||
about: https://gitlab.com/nofusscomputing/projects/gitlab-ci
|
||||
---
|
||||
|
||||
This GitLab CI template is designed to publish Docker images to Docker Hub. It contains a job called "Publish Docker Image to Docker Hub" that handles the image publishing process.
|
||||
|
||||
|
||||
## Stage
|
||||
|
||||
- `publish`
|
||||
|
||||
|
||||
## Variables
|
||||
|
||||
The following variables are used in the job:
|
||||
|
||||
- `DOCKER_IMAGE_BUILD_NAME`: The name of the Docker image to build. By default, it uses the GitLab CI project name.
|
||||
|
||||
- `DOCKER_IMAGE_BUILD_REGISTRY`: The registry for the Docker image build. By default, it uses the GitLab CI registry image.
|
||||
|
||||
- `DOCKER_IMAGE_BUILD_TAG`: The tag for the Docker image build. By default, it uses the GitLab CI commit SHA.
|
||||
|
||||
- `DOCKER_IMAGE_BUILD_TARGET_PLATFORMS`: A comma-separated list of available platforms for the Docker image build. Supported platforms include: `linux/amd64`, `linux/amd64/v2`, `linux/amd64/v3`, `linux/arm64`, `linux/riscv64`, `linux/ppc64`, `linux/ppc64le`, `linux/s390x`, `linux/386`, `linux/mips64le`, `linux/mips64`, `linux/arm/v7`, `linux/arm/v6`.
|
||||
|
||||
- `CI_REGISTRY_USER`: The username for logging in to the GitLab CI registry.
|
||||
|
||||
- `CI_REGISTRY_PASSWORD`: The password for logging in to the GitLab CI registry.
|
||||
|
||||
- `NFC_DOCKERHUB_USERNAME`: The username for logging in to Docker Hub.
|
||||
|
||||
- `NFC_DOCKERHUB_TOKEN`: The access token or password for logging in to Docker Hub.
|
||||
|
||||
- `DOCKER_IMAGE_PUBLISH_REGISTRY`: The registry for publishing the Docker image to Docker Hub.
|
||||
|
||||
- `DOCKER_IMAGE_PUBLISH_NAME`: The name of the Docker image for publishing to Docker Hub.
|
||||
|
||||
- `DOCKER_IMAGE_PUBLISH_URL`: The URL to access the published Docker image on Docker Hub.
|
||||
|
||||
|
||||
## Services
|
||||
|
||||
- `docker:23-dind`: Runs Docker in Docker (DinD) service with version 23.
|
||||
|
||||
|
||||
## Script
|
||||
|
||||
The job executes the following steps in the `script` section:
|
||||
|
||||
1. Logs in to the GitLab CI registry using the provided credentials (`CI_REGISTRY_USER` and `CI_REGISTRY_PASSWORD`).
|
||||
|
||||
2. If the `DOCKER_IMAGE_BUILD_TARGET_PLATFORMS` variable is specified, it iterates over the platforms and inspects the Docker image using `docker buildx imagetools inspect`.
|
||||
|
||||
3. If the `DOCKER_IMAGE_BUILD_TARGET_PLATFORMS` variable is not specified, it pulls the Docker image from the specified registry.
|
||||
|
||||
4. Logs in to Docker Hub using the provided credentials (`NFC_DOCKERHUB_USERNAME` and `NFC_DOCKERHUB_TOKEN`).
|
||||
|
||||
5. Lists the Docker images using `docker image ls`.
|
||||
|
||||
6. Determines the appropriate tag for the Docker image based on the pipeline source and commit tag.
|
||||
|
||||
7. If the `DOCKER_IMAGE_BUILD_TARGET_PLATFORMS` variable is specified, it creates multi-arch images using `docker buildx imagetools create` and tags them with the appropriate tag.
|
||||
|
||||
8. If the `DOCKER_IMAGE_BUILD_TARGET_PLATFORMS` variable is not specified, it tags the Docker image with the appropriate tag based on the pipeline source and commit tag.
|
||||
|
||||
9. Pushes the Docker image to Docker Hub.
|
||||
|
||||
10. Logs out of Docker Hub.
|
||||
|
||||
|
||||
## Environment
|
||||
|
||||
The job sets the following environment variables:
|
||||
|
||||
- **Name**: DockerHub
|
||||
|
||||
- **URL**: The URL to access the published Docker image on Docker Hub.
|
||||
|
||||
|
||||
## Rules
|
||||
|
||||
The job is controlled by the following rules:
|
||||
|
||||
- Runs when the pipeline is triggered by a Git tag and there is no associated branch.
|
||||
|
||||
- Runs when the pipeline is triggered by a push to the `master` branch and there is a Dockerfile present.
|
||||
|
||||
- Runs when the pipeline is triggered by a push to the `development` branch, there are changes in the Dockerfile or the `includes/` directory compared to the `master` branch, and it allows failure.
|
||||
|
||||
- Never runs explicitly.
|
||||
|
||||
|
||||
## gitlab-ci.yml definition
|
||||
|
||||
``` yaml title=".gitlab-ci.yml" linenums="1"
|
||||
|
||||
--8<-- "docker/build.gitlab-ci.yaml"
|
||||
|
||||
```
|
@ -1,4 +1,11 @@
|
||||
# git push mirror Admin Manual Manual
|
||||
---
|
||||
title: Git push mirror
|
||||
description: How to use No Fuss Computings gitlab-ci job for repository mirrororing
|
||||
date: 2021-08-03
|
||||
template: project.html
|
||||
about: https://gitlab.com/nofusscomputing/projects/gitlab-ci
|
||||
---
|
||||
|
||||
This job does a git push to a remote git repo.
|
||||
|
||||
|
||||
@ -6,14 +13,18 @@ This job provides the following badge:
|
||||
|
||||
- None
|
||||
|
||||
|
||||
## Dependencies
|
||||
|
||||
- None
|
||||
|
||||
|
||||
## your .gitlab-ci.yml changes
|
||||
|
||||
To use this job add the following to your `.gitlab-ci.yml` file
|
||||
|
||||
``` yaml
|
||||
|
||||
stages:
|
||||
- sync
|
||||
|
||||
@ -28,6 +39,7 @@ Github (Push --mirror):
|
||||
|
||||
```
|
||||
|
||||
|
||||
## CI/CD Variables required
|
||||
|
||||
| var name | Description |
|
||||
@ -37,9 +49,10 @@ Github (Push --mirror):
|
||||
|
||||
## Job Workflow
|
||||
|
||||
- This job is designed to run on successful completion of the validation tasks and only on the `development` and `master` branches. You can safely override the `rules` when creating the job with your own. i.e.
|
||||
- This job is designed to run on successful completion of the validation tasks and only on the `development` and `master` branches. You can safely override the `rules` when creating the job with your own. i.e.
|
||||
|
||||
``` yaml
|
||||
|
||||
Github (Push --mirror):
|
||||
variables:
|
||||
GIT_SYNC_URL: "https://${username variable}:${pasword variable}@github.com/NoFussComputing/gitlab-ci.git"
|
||||
@ -50,12 +63,26 @@ Github (Push --mirror):
|
||||
when: never
|
||||
- if: '$CI_COMMIT_BRANCH == "development"'
|
||||
when: always
|
||||
|
||||
```
|
||||
|
||||
This will cause the job to only run on the `development` branch.
|
||||
|
||||
|
||||
## Artifacts
|
||||
|
||||
- None
|
||||
- None
|
||||
|
||||
## License
|
||||
To view the license for this folder and any sub-folders, refer [here](https://gitlab.com/nofusscomputing/projects/gitlab-ci)
|
||||
|
||||
## Gitlab job Definition
|
||||
|
||||
When you include this definition the following makes up the job definition
|
||||
|
||||
``` yaml title=".gitlab-ci.yml" linenums="1"
|
||||
|
||||
--8<-- "git_push_mirror/.gitlab-ci.yml"
|
||||
|
||||
```
|
||||
|
||||
!!! Note
|
||||
Docs Still under development
|
216
docs/projects/gitlab-ci/gitlab_release.md
Normal file
216
docs/projects/gitlab-ci/gitlab_release.md
Normal file
@ -0,0 +1,216 @@
|
||||
---
|
||||
title: Gitlab Release / Commit Footer References
|
||||
description: How to use No Fuss Computings gitlab-ci job for Gitlab Releases and commit footer messages
|
||||
date: 2021-08-03
|
||||
template: project.html
|
||||
about: https://gitlab.com/nofusscomputing/projects/gitlab-ci
|
||||
---
|
||||
|
||||
|
||||
## User Manual
|
||||
|
||||
All commit messages must be in [conventional commit format](https://www.conventionalcommits.org/en/v1.0.0/) and have a footer with a gitlab reference. The reference **must** be either a merge request or a gitlab issue. (format i.e. `!1` or `#2` *using the correct reference number*).
|
||||
|
||||
|
||||
### fixing commit messages
|
||||
|
||||
If only the last commit is the commit with an error just use `git commit --amend` and edit your commit message to be in the correct format and save. now push your changes.
|
||||
|
||||
|
||||
You will require the following information if the commit message with the error is further down the commit tree:
|
||||
|
||||
- Commit message SHA1 of your first commit message to the branch `{original_commit}`
|
||||
|
||||
- Commit message SHA1 prior to your first commit `{source_commit}`
|
||||
|
||||
Run these commands once you have the information above.
|
||||
|
||||
``` bash
|
||||
|
||||
git format-patch {original_commit}..HEAD -o ../diff-patches
|
||||
|
||||
git reset {source_commit} --hard
|
||||
|
||||
```
|
||||
|
||||
Now, navigate to the `diff-patches` folder, open up the offending patch (commit) and edit the `subject` or message body as appropriate and save. Once all the edits have been done, re-apply the patches to your tree with:
|
||||
|
||||
``` bash
|
||||
|
||||
git am ../diff-patches/*.patch
|
||||
|
||||
```
|
||||
|
||||
Now push your changes upstream.
|
||||
|
||||
| :notebook_with_decorative_cover: Note |
|
||||
|:-----:|
|
||||
| *As you have changed the commit SHA1(s), when you next push your changes upstream, you must force push. `git push --force`* |
|
||||
|
||||
| :octagonal_sign: **WARNING** |
|
||||
|:-----:|
|
||||
| *Ensure that all of your commits were exported prior to reseting the branch and when re-applying, that all of your commits were applied correctly* |
|
||||
|
||||
|
||||
## GitLab CI Template - Developer Manual
|
||||
|
||||
|
||||
## Job: gitlab_release
|
||||
|
||||
This job bumps the version, updates the changelog, creates a git tag and creates a gitlab release. The git tag and release title use [semantic versioning](https://semver.org/). for this job to function correctly a `.cz.yaml` is required in the root of the repository. this file contains the [commitizen](https://github.com/commitizen-tools/commitizen) config and the version details.
|
||||
|
||||
!!! Alert
|
||||
*If prior to merging to the master branch you do a version increment, and there are no commits prior to merging. the job will not increment the version and the job will fail. it is recommended that you only do a version increment on the `development` branch if you are going to commit further changes to the `development` branch*
|
||||
|
||||
|
||||
### Stage
|
||||
|
||||
`release`
|
||||
|
||||
|
||||
### Image
|
||||
|
||||
The job uses the `registry.gitlab.com/gitlab-org/release-cli:latest` image.
|
||||
|
||||
|
||||
### Variables
|
||||
|
||||
The job does not use any additional variables.
|
||||
|
||||
|
||||
### Explanation
|
||||
|
||||
The `gitlab_release` job is responsible for creating releases and tags for the GitLab repository. It follows a specific release workflow and utilizes the `release-cli` tool to automate the release process.
|
||||
|
||||
|
||||
### Steps
|
||||
|
||||
1. Set ROOT_DIR variable: Sets the `ROOT_DIR` variable based on the value of `JOB_ROOT_DIR`.
|
||||
|
||||
2. Create necessary directories: Creates necessary directories for storing artifacts and tests.
|
||||
|
||||
3. Install dependencies: Updates the package manager and installs Git and Python 3. Sets up the Python environment by installing required packages.
|
||||
|
||||
4. Clone repository: Clones the repository using the provided authentication token and checks out the `development` branch.
|
||||
|
||||
5. Configure Git: Configures Git settings for the release process.
|
||||
|
||||
6. Perform release steps: Executes release-related steps, such as running a custom command (`$MY_COMMAND`), generating the release changelog, and tagging the release.
|
||||
|
||||
7. Push changes: Pushes the changes to the GitLab repository.
|
||||
|
||||
8. Cleanup: Removes the cloned repository.
|
||||
|
||||
|
||||
### Rules
|
||||
|
||||
- The job is never triggered when `$JOB_STOP_GITLAB_RELEASE` is true.
|
||||
|
||||
- The job is never triggered when the commit author is `nfc_bot <helpdesk@nofusscomputing.com>`.
|
||||
|
||||
- If the commit is pushed to the `master` branch, the job is only triggered on successful pipeline execution and failure is not allowed.
|
||||
|
||||
- If the commit is pushed to the `development` branch, the job is triggered manually and failure is allowed.
|
||||
|
||||
|
||||
### your .gitlab-ci.yml changes
|
||||
|
||||
To use this job add the following to your `.gitlab-ci.yml` file
|
||||
|
||||
CI Job `ci commit footer` is automatically set to run on all branches except `development` and `master`. This job checks the commits on the users branch that they contain a footer with gitlab references. i.e. `#1` for issue one or `!1` for merge request one.
|
||||
|
||||
``` yaml
|
||||
|
||||
stages:
|
||||
- validate
|
||||
- release
|
||||
|
||||
include:
|
||||
- remote: https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/raw/development/gitlab_release/.gitlab-ci.yml
|
||||
|
||||
Gitlab Release:
|
||||
variables:
|
||||
MY_COMMAND: "{your command here}"
|
||||
extends:
|
||||
- .gitlab_release
|
||||
|
||||
```
|
||||
|
||||
> if you wish to run any commands you can add them to variable `MY_COMMAND`. The custom command will run under shell `/bin/sh`. This command is set to run before the version bump commit is conducted so any changes you wish to add as part of the version bump, you can do here as long as you `git add {changed file name}`.
|
||||
|
||||
|
||||
## Job: commit_footer_refs
|
||||
|
||||
|
||||
### Stage
|
||||
|
||||
`validation`
|
||||
|
||||
|
||||
### Image
|
||||
|
||||
The job uses the `python:3.6-slim` image.
|
||||
|
||||
|
||||
### Variables
|
||||
|
||||
- `DEFAULT_ROOT_DIR`: The default root directory path.
|
||||
|
||||
|
||||
### Explanation
|
||||
|
||||
The `commit_footer_refs` job validates the commit footer references in the GitLab repository. It checks if the commit messages adhere to the conventional commit format and generates a JUnit XML report.
|
||||
|
||||
|
||||
### Conventional Commits
|
||||
|
||||
Conventional commits follow a specific format for commit messages, consisting of a type, optional scope, and a message. The format is as follows:
|
||||
|
||||
```
|
||||
<type>(<scope>): <message>
|
||||
```
|
||||
|
||||
- The `<type>` represents the nature of the changes, such as `feat` for a new feature, `fix` for a bug fix, `docs` for documentation changes, and so on.
|
||||
|
||||
- The `<scope>` (optional) provides additional context for the commit, indicating the module, component, or area of code being modified.
|
||||
|
||||
- The `<message>` contains a concise and descriptive summary of the changes.
|
||||
|
||||
The commit footer can contain additional information, such as references to issues, feature requests, or pull requests.
|
||||
|
||||
|
||||
### Steps
|
||||
|
||||
1. Create necessary directories: Creates necessary directories for storing artifacts and test results.
|
||||
|
||||
2. Set ROOT_DIR variable: Sets the `ROOT_DIR` variable based on the value of `JOB_ROOT_DIR`.
|
||||
|
||||
3. Install dependencies: Updates the package manager and installs Git and the required Python packages for the commit footer validation.
|
||||
|
||||
4. Clone repository: Clones the repository and checks out the specified branch.
|
||||
|
||||
5. Run commit_footer script: Executes the `commit_footer` script to validate the commit footer references.
|
||||
|
||||
6. Generate artifacts: Generates a JUnit XML report for the test results.
|
||||
|
||||
|
||||
### Rules
|
||||
|
||||
- The job is never triggered when `$JOB_STOP_CONVENTIONAL_COMMITS` is true.
|
||||
|
||||
- The job is never triggered when `CHANGELOG_FOOTER_REFERENCES` is false.
|
||||
|
||||
- The job is always triggered when the commit is not pushed to the master or development branch, and a .cz.yaml file is present, indicating the usage of conventional commits.
|
||||
|
||||
- The job is never triggered otherwise.
|
||||
|
||||
|
||||
## Gitlab job Definition
|
||||
|
||||
When you include this definition the following makes up the job definition
|
||||
|
||||
``` yaml title=".gitlab-ci.yml" linenums="1"
|
||||
|
||||
--8<-- "gitlab_release/.gitlab-ci.yml"
|
||||
|
||||
```
|
111
docs/projects/gitlab-ci/index.md
Normal file
111
docs/projects/gitlab-ci/index.md
Normal file
@ -0,0 +1,111 @@
|
||||
---
|
||||
title: No Fuss Computings Gitlab-CI Project
|
||||
description: How to use No Fuss Computings gitlab-ci project within your CI/CD pipelines
|
||||
date: 2023-05-22
|
||||
template: project.html
|
||||
about: https://gitlab.com/nofusscomputing/projects/gitlab-ci
|
||||
---
|
||||
|
||||
!!! Note
|
||||
Docs Still under development
|
||||
|
||||
|
||||
## Docs ToDo
|
||||
|
||||
- Templates folder is for `gitlab-ci.yaml` that automagically create the jobs if included
|
||||
|
||||
- other sub folders are for `` which **DO NOT** automagically create jobs, but are pure definitions only.
|
||||
|
||||
- notate how each of the stages run and under what circumstance. *i.e. gitlab-ci.yml rules.exist/rules.changes*
|
||||
|
||||
## CI Stages
|
||||
|
||||
The CI stages for these jobs are as follows, and in the order expected by the jobs:
|
||||
|
||||
- chores
|
||||
> automated tasks
|
||||
|
||||
- validation
|
||||
> validation of files, commits, Merge Request titles, code quality, license checks.
|
||||
|
||||
- build
|
||||
> build any binaries or files that would be used in the later stages .
|
||||
|
||||
- prepare
|
||||
> any jobs that must run after build but before testing. for example a docker image build that includes artifacts from the build job
|
||||
|
||||
- test
|
||||
> unit, functional, integration and any other tests.
|
||||
|
||||
- release
|
||||
> git tagging and creating a gitlab release. Also includes adding build artifacts to gitlab registry.
|
||||
|
||||
- sync
|
||||
> repository synchronization, i.e. push mirror to github.
|
||||
|
||||
- publish
|
||||
> placement of build objects to external sources
|
||||
|
||||
|
||||
## Git Sub-Module setup
|
||||
|
||||
It is recommended that you set-up this repo as a git sub-module to your repo and that you configure it to a set commit/tag. This ensures that any change to `gitlab-ci` repo, does not effect your CI/CD jobs.
|
||||
|
||||
run the following commands:
|
||||
|
||||
``` bash
|
||||
|
||||
git submodule add -b {ref} https://gitlab.com/nofusscomputing/projects/gitlab-ci.git gitlab-ci
|
||||
git submodule update --remote
|
||||
|
||||
```
|
||||
|
||||
!!! Tip
|
||||
NOTE: `{ref}` should be replaced with the branch name, `master` is the stable branch and recommended. by default the sub-module will be created in folder `gitlab-ci`, it is recommended that you **don't** change this folder name.
|
||||
|
||||
You can also substitute the gitlab url with the github url `https://github.com/NoFussComputing/gitlab-ci.git` for the submodule if you desire. this repo is auto-synced with github on each change to the repo.
|
||||
|
||||
After each `git submodule update --remote` you will have to commit the sub-module update to your repo. Suggested commands as follows:
|
||||
|
||||
``` bash
|
||||
|
||||
git add .gitmodules
|
||||
|
||||
git add gitlab-ci
|
||||
|
||||
git commit -m "ci(gitlab-ci): updated to use version x
|
||||
|
||||
{your reason here or explain what is provided/changed}"
|
||||
|
||||
```
|
||||
|
||||
Then push the changes to your source.
|
||||
|
||||
|
||||
## .gitlab-ci.yaml example
|
||||
|
||||
example:
|
||||
|
||||
``` yaml
|
||||
|
||||
include:
|
||||
- project: nofusscomputing/projects/gitlab-ci
|
||||
ref: master
|
||||
file:
|
||||
- .gitlab-ci_common.yaml
|
||||
- $JOB_ROOT_DIR/{filepath to include here and is relative to the gitlab-ci repo root}
|
||||
|
||||
variables:
|
||||
MY_PROJECT_ID: "{your_project_id}"
|
||||
|
||||
```
|
||||
|
||||
!!! Tip
|
||||
Use a project import in your `.gitlab-ci.yml` file that is tied to a specific `ref`. for example a branch, commit or tag. Also ensure that the `gitlab-ci` `git sub-module` and the `ref` as part of the includes matches.*
|
||||
|
||||
|
||||
## Artifacts
|
||||
|
||||
Any artifacts by jobs will be created in folders named after the stage.
|
||||
|
||||
preference is placed on jobs to output JUnit.xml test reports. This is because they are visible in merge requests.
|
@ -1,4 +1,11 @@
|
||||
# Markdown File Linting
|
||||
---
|
||||
title: Markdown File Linting
|
||||
description: How to use No Fuss Computings gitlab-ci job for markdown linting
|
||||
date: 2021-08-11
|
||||
template: project.html
|
||||
about: https://gitlab.com/nofusscomputing/projects/gitlab-ci
|
||||
---
|
||||
|
||||
This job lints markdown files as part of the validation CI stage. It is designated to run on all branches. If any errors are found, the generated JUnit test report will let you know what errors were found.
|
||||
|
||||
You can include your linting rules in `.markdownlint.json` which should be within the root of your repository. for the available rules please see the [docs](https://github.com/DavidAnson/markdownlint/blob/main/README.md#rules--aliases).
|
||||
@ -7,11 +14,14 @@ This job provides the following badge:
|
||||
|
||||
- _None_
|
||||
|
||||
|
||||
## Dependencies
|
||||
|
||||
- **Optional** file `.markdownlint.json` in repository root with any rules you wish to specify
|
||||
|
||||
|
||||
## your .gitlab-ci.yml changes
|
||||
|
||||
To use this job add the following to your `.gitlab-ci.yml` file
|
||||
|
||||
``` yaml
|
||||
@ -28,12 +38,15 @@ Markdown Linting:
|
||||
|
||||
```
|
||||
|
||||
|
||||
## CI/CD Variables required
|
||||
|
||||
| var name | Description |
|
||||
|:----:|:----|
|
||||
| MDLINT_PATH | **Optional** specifies the path to lint. defaults to `"**/*.md"` |
|
||||
| MDLINT_EXCLUDE_PATHS | **optional** Specifies the paths to exclude from linting. Defaults to `"!gitlab-ci"` |
|
||||
| MD_LINT_CONFIG-PATH | **Optional** Specifies a path whenre the lint config file is. defaults to none. this variable enables you to specify a config that will be copied to the project root folder. ***Note:** if specified, the file will be deleted at the end of the linting job.*
|
||||
|
||||
|
||||
## Job Workflow
|
||||
|
||||
@ -41,9 +54,21 @@ Markdown Linting:
|
||||
|
||||
1. Lints any markdow file found in `$MDLINT_PATH`, excluding paths `$MDLINT_EXCLUDE_PATHS`
|
||||
|
||||
|
||||
## Artifacts
|
||||
|
||||
- JUnit test report located at `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/*.junit.xml`
|
||||
|
||||
## License
|
||||
To view the license for this folder and any sub-folders, refer [here](https://gitlab.com/nofusscomputing/projects/gitlab-ci)
|
||||
|
||||
## Gitlab job Definition
|
||||
|
||||
When you include this definition the following makes up the job definition
|
||||
|
||||
``` yaml title=".gitlab-ci.yml" linenums="1"
|
||||
|
||||
--8<-- "lint/markdown.gitlab-ci.yaml"
|
||||
|
||||
```
|
||||
|
||||
!!! Note
|
||||
Docs Still under development
|
@ -1,4 +1,12 @@
|
||||
# MKDocs Static Site Build
|
||||
---
|
||||
title: MKDocs Static Site Build
|
||||
description: How to use No Fuss Computings gitlab-ci job for MKDocs Static Site Build
|
||||
date: 2021-08-11
|
||||
template: project.html
|
||||
about: https://gitlab.com/nofusscomputing/projects/gitlab-ci
|
||||
---
|
||||
|
||||
|
||||
Build a MKDocs site from the config specified in `mkdocs.yml`. _Only runs if `mkdocs.yml` exists in the repository root directory._ This job is designated to run on all branchs so that you can use the artifacts for deployment to `staging` and/or `production` as required.
|
||||
|
||||
This job provides the following badge:
|
||||
@ -10,9 +18,11 @@ This job provides the following badge:
|
||||
- **Mandatory** file `mkdocs.yml` in the repository root directory with your MKDocs configuration
|
||||
|
||||
## your .gitlab-ci.yml changes
|
||||
|
||||
To use this job add the following to your `.gitlab-ci.yml` file
|
||||
|
||||
``` yaml
|
||||
|
||||
stages:
|
||||
- build
|
||||
|
||||
@ -27,6 +37,7 @@ MKDocs build:
|
||||
|
||||
```
|
||||
|
||||
|
||||
## CI/CD Variables required
|
||||
|
||||
| var name | Description |
|
||||
@ -35,6 +46,7 @@ MKDocs build:
|
||||
| MKDOCS_INCLUDE_SOURCE | **Optional** Include the build source files in the artifacts. Default is Not set. Any value in this variable, will include the source files. |
|
||||
| MKDOCS_SOURCE_PATH | **Optional, if source files are not to be included** Set to the path where mkdocs uses to build the static html. |
|
||||
|
||||
|
||||
## Job Workflow
|
||||
|
||||
1. install mkdocs
|
||||
@ -54,5 +66,16 @@ MKDocs build:
|
||||
|
||||
- files in `"$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME"`
|
||||
|
||||
## License
|
||||
To view the license for this folder and any sub-folders, refer [here](https://gitlab.com/nofusscomputing/projects/gitlab-ci)
|
||||
|
||||
## Gitlab job Definition
|
||||
|
||||
When you include this definition the following makes up the job definition
|
||||
|
||||
``` yaml title=".gitlab-ci.yml" linenums="1"
|
||||
|
||||
--8<-- "mkdocs/.gitlab-ci.yml"
|
||||
|
||||
```
|
||||
|
||||
!!! Note
|
||||
Docs Still under development
|
@ -1,4 +1,12 @@
|
||||
# Python
|
||||
---
|
||||
title: Python
|
||||
description: How to use No Fuss Computings gitlab-ci job for Python
|
||||
date: 2021-08-11
|
||||
template: project.html
|
||||
about: https://gitlab.com/nofusscomputing/projects/gitlab-ci
|
||||
---
|
||||
|
||||
|
||||
This folder (`python`) covers jobs for python development
|
||||
|
||||
|
||||
@ -7,7 +15,9 @@ These jobs provides the following badge:
|
||||
- `PyLint` - code quality [](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/jobs/artifacts/development/file/artifacts/validation/tests/gl-code-quality-report.html?job=PyLint)
|
||||
|
||||
Use the following MD to add a badge adjusting the variables and ensuring everything is on one line.
|
||||
|
||||
``` md
|
||||
|
||||
[
|
||||
|
||||
```
|
||||
|
||||
| Variable | Description |
|
||||
|:----|:----|
|
||||
| `{project path}` | *project path, what's after gitlab.com/* |
|
||||
@ -48,10 +60,13 @@ artifacts/validation/tests/gl-code-quality-report.html
|
||||
|
||||
- None
|
||||
|
||||
|
||||
## your .gitlab-ci.yml changes
|
||||
|
||||
To add the `PyLint` job, add the following to your `.gitlab-ci.yml` file
|
||||
|
||||
``` yaml
|
||||
|
||||
stages:
|
||||
- validation
|
||||
|
||||
@ -65,6 +80,7 @@ PyLint:
|
||||
extends:
|
||||
- .PyLint
|
||||
image: python:3.6-slim
|
||||
|
||||
```
|
||||
|
||||
|
||||
@ -78,13 +94,27 @@ PyLint:
|
||||
|
||||
## Job Workflow
|
||||
|
||||
- This job will lint any yaml file in the specified directory using the specified rules.
|
||||
- This job will lint any yaml file in the specified directory using the specified rules.
|
||||
|
||||
|
||||
## Artifacts
|
||||
|
||||
- `$CI_PROJECT_DIR/artifacts` - Root artifact directory
|
||||
- `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/gl-code-quality-report.json` - Gitlab code quality report (displays in merge request)
|
||||
- `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/gl-code-quality-report.html` - html code quality report
|
||||
- `$CI_PROJECT_DIR/artifacts` - Root artifact directory
|
||||
|
||||
## License
|
||||
To view the license for this folder and any sub-folders, refer [here](https://gitlab.com/nofusscomputing/projects/gitlab-ci)
|
||||
- `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/gl-code-quality-report.json` - Gitlab code quality report (displays in merge request)
|
||||
|
||||
- `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/gl-code-quality-report.html` - html code quality report
|
||||
|
||||
|
||||
## Gitlab job Definition
|
||||
|
||||
When you include this definition the following makes up the job definition
|
||||
|
||||
``` yaml title=".gitlab-ci.yml" linenums="1"
|
||||
|
||||
--8<-- "python/.gitlab-ci.yml"
|
||||
|
||||
```
|
||||
|
||||
!!! Note
|
||||
Docs Still under development
|
@ -1,4 +1,11 @@
|
||||
# Ansible
|
||||
---
|
||||
title: Ansible
|
||||
description: How to use No Fuss Computings gitlab-ci job for ansible
|
||||
date: 2021-08-03
|
||||
template: project.html
|
||||
about: https://gitlab.com/nofusscomputing/projects/gitlab-ci
|
||||
---
|
||||
|
||||
This job does ansible role/playbook linting when any commit is pushed to any branch.
|
||||
|
||||
|
||||
@ -6,14 +13,18 @@ This job provides the following badge:
|
||||
|
||||
- None
|
||||
|
||||
|
||||
## Dependencies
|
||||
|
||||
- None
|
||||
|
||||
|
||||
## your .gitlab-ci.yml changes
|
||||
|
||||
To use this job add the following to your `.gitlab-ci.yml` file
|
||||
|
||||
``` yaml
|
||||
|
||||
stages:
|
||||
- validation
|
||||
|
||||
@ -26,9 +37,12 @@ Ansible Lint (python 3.6):
|
||||
extends:
|
||||
- .ansible_linter_defaults
|
||||
image: python:3.6-slim
|
||||
|
||||
```
|
||||
|
||||
> You can use any python version you wish.
|
||||
|
||||
|
||||
## CI/CD Variables required
|
||||
|
||||
| var name | Description |
|
||||
@ -38,13 +52,13 @@ Ansible Lint (python 3.6):
|
||||
|
||||
## Job Workflow
|
||||
|
||||
- This job will lint any yml file in the specified directory using ansible rules.
|
||||
- This job will lint any yml file in the specified directory using ansible rules.
|
||||
|
||||
|
||||
## Artifacts
|
||||
|
||||
- `$CI_PROJECT_DIR/artifacts` - Root artifact directory
|
||||
- `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/$PYTHON_VERSION-ansible-lint.junit.xml` - JUnit Test report
|
||||
- `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/$PYTHON_VERSION-ansible-lint.log` - Linter log
|
||||
- `$CI_PROJECT_DIR/artifacts` - Root artifact directory
|
||||
|
||||
## License
|
||||
To view the license for this folder and any sub-folders, refer [here](https://gitlab.com/nofusscomputing/projects/gitlab-ci)
|
||||
- `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/$PYTHON_VERSION-ansible-lint.junit.xml` - JUnit Test report
|
||||
|
||||
- `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/$PYTHON_VERSION-ansible-lint.log` - Linter log
|
28
docs/projects/gitlab-ci/templates/automagic.md
Normal file
28
docs/projects/gitlab-ci/templates/automagic.md
Normal file
@ -0,0 +1,28 @@
|
||||
---
|
||||
title: Automatic Gitlab CI/CD jobs Template
|
||||
description: How to use No Fuss Computings gitlab-ci template for auto creation of CI/CD joobs.
|
||||
date: 2023-05-22
|
||||
template: project.html
|
||||
about: https://gitlab.com/nofusscomputing/projects/gitlab-ci
|
||||
---
|
||||
|
||||
This template is designed to autodetect which jobs should be created. By including it within your project, the jobs will be automagically created for the pipeline.
|
||||
|
||||
|
||||
## Docs ToDo
|
||||
|
||||
- document variables `PIPELINE_RUN_TRIGGER: 'false'` and `PIPELINE_RUN_SCHEDULE: 'false'` as being used as a gate to enable the jobs to run by the specified source.
|
||||
|
||||
|
||||
!!! Note
|
||||
Docs Still under development
|
||||
|
||||
|
||||
|
||||
## gitlab-ci.yml definition
|
||||
|
||||
``` yaml title=".gitlab-ci.yml" linenums="1"
|
||||
|
||||
--8<-- "template/automagic.gitlab-ci.yaml"
|
||||
|
||||
```
|
37
docs/projects/gitlab-ci/templates/docker_container.md
Normal file
37
docs/projects/gitlab-ci/templates/docker_container.md
Normal file
@ -0,0 +1,37 @@
|
||||
---
|
||||
title: Docker Container CI Template
|
||||
description: How to use No Fuss Computings gitlab-ci template for docker containers
|
||||
date: 2023-05-13
|
||||
template: project.html
|
||||
about: https://gitlab.com/nofusscomputing/projects/gitlab-ci
|
||||
---
|
||||
|
||||
- available tags `dev` for latest dev build
|
||||
|
||||
- latest matches latest git tag
|
||||
|
||||
|
||||
- notate available platforms can be viewed in the job
|
||||
|
||||
- notate that resource groups are used. also mention that the resource group allows the git tag pipeline as forced to wait for the previous pipeline, tag push to build the image first
|
||||
|
||||
``` yaml
|
||||
|
||||
# Available platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
|
||||
# DOCKER_IMAGE_BUILD_TARGET_PLATFORMS: "linux/amd64,linux/arm64,linux/arm/v7"
|
||||
DOCKER_IMAGE_BUILD_NAME: $CI_PROJECT_NAME
|
||||
DOCKER_IMAGE_BUILD_REGISTRY: $CI_REGISTRY_IMAGE
|
||||
DOCKER_IMAGE_BUILD_TAG: $CI_COMMIT_SHA
|
||||
|
||||
# DOCKER_IMAGE_PUBLISH_NAME: $CI_PROJECT_NAME
|
||||
# DOCKER_IMAGE_PUBLISH_REGISTRY: docker.io/nofusscomputing
|
||||
# DOCKER_IMAGE_PUBLISH_URL: https://hub.docker.com/r/nofusscomputing/$DOCKER_IMAGE_PUBLISH_NAME
|
||||
# JOB_STOP_CONVENTIONAL_COMMITS: 'any_value'
|
||||
# JOB_STOP_GIT_PUSH_MIRROR: 'any_value'
|
||||
# GIT_SYNC_URL: "https://$GITHUB_USERNAME_ROBOT:$GITHUB_TOKEN_ROBOT@github.com/NoFussComputing/config.git" # Must be defined for job to run
|
||||
# JOB_STOP_GITLAB_RELEASE: 'any value'
|
||||
|
||||
```
|
||||
|
||||
!!! Note
|
||||
Docs Still under development
|
33
docs/projects/gitlab-ci/templates/documentation_mkdocs.md
Normal file
33
docs/projects/gitlab-ci/templates/documentation_mkdocs.md
Normal file
@ -0,0 +1,33 @@
|
||||
---
|
||||
title: mkdocs documentation Gitlab CI/CD Template
|
||||
description: How to use No Fuss Computings gitlab-ci template for building docs with mkdocs
|
||||
date: 2023-05-22
|
||||
template: project.html
|
||||
about: https://gitlab.com/nofusscomputing/projects/gitlab-ci
|
||||
---
|
||||
|
||||
This template creates the jobs applicable to publishing pages to a website. The website in question is a static site built by MKDocs.
|
||||
|
||||
|
||||
## Docs ToDo
|
||||
|
||||
- notate that var `PAGES_ENVIRONMENT_PATH:` can be set to the slug of the page to show and is used for launching the environment to the url that contains the docs index page.
|
||||
|
||||
- notate that resource groups are used.
|
||||
|
||||
## Dependencies
|
||||
|
||||
- **Mandatory** file `docs/index.md` this is the index page of your dcoumentation.
|
||||
|
||||
|
||||
!!! Note
|
||||
Docs Still under development
|
||||
|
||||
|
||||
## gitlab-ci.yml definition
|
||||
|
||||
``` yaml title=".gitlab-ci.yml" linenums="1"
|
||||
|
||||
--8<-- "template/mkdocs-documentation.gitlab-ci.yaml"
|
||||
|
||||
```
|
18
docs/projects/gitlab-ci/templates/index.md
Normal file
18
docs/projects/gitlab-ci/templates/index.md
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
title: Gitlab-CI Job Templates
|
||||
description: How to use No Fuss Computings gitlab-ci project within your CI/CD pipelines
|
||||
date: 2023-05-22
|
||||
template: project.html
|
||||
about: https://gitlab.com/nofusscomputing/projects/gitlab-ci
|
||||
---
|
||||
|
||||
As part of our Gitlab CI job definitions we also have gitlab-ci.yaml templates that are specifically designed for inclusion and will automagically add the required jobs.
|
||||
|
||||
## Docs ToDo
|
||||
|
||||
- all templates are in the template folder.
|
||||
|
||||
- explain `.gitlab-ci_common.yaml` is for inclusion by all, _suggested._ and will never create jobs, only specify defaults. is also included in all templates
|
||||
|
||||
!!! Note
|
||||
Docs Still under development
|
79
docs/projects/gitlab-ci/yaml_lint.md
Normal file
79
docs/projects/gitlab-ci/yaml_lint.md
Normal file
@ -0,0 +1,79 @@
|
||||
---
|
||||
title: YAML Linting
|
||||
description: How to use No Fuss Computings gitlab-ci job for YAML Linting
|
||||
date: 2021-08-11
|
||||
template: project.html
|
||||
about: https://gitlab.com/nofusscomputing/projects/gitlab-ci
|
||||
---
|
||||
|
||||
This job does yaml linting when any commit is pushed to any branch.
|
||||
|
||||
This job provides the following badge:
|
||||
|
||||
- None
|
||||
|
||||
|
||||
## Dependencies
|
||||
|
||||
- None
|
||||
|
||||
|
||||
## your .gitlab-ci.yml changes
|
||||
|
||||
To use this job add the following to your `.gitlab-ci.yml` file
|
||||
|
||||
``` yaml
|
||||
|
||||
stages:
|
||||
- validation
|
||||
|
||||
include:
|
||||
- remote: https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/raw/master/yaml_lint/.gitlab-ci.yml
|
||||
|
||||
Yaml Lint (python 3.6):
|
||||
variables:
|
||||
YAML_LINT_PATH: "."
|
||||
YAML_LINT_EXTRA_ARGS: "{ extends: $ROOT_DIR/yaml_lint/.yamllint.yaml, ignore: [gitlab-ci/*] }"
|
||||
extends:
|
||||
- .yaml_linter_defaults
|
||||
image: python:3.6-slim
|
||||
|
||||
```
|
||||
|
||||
> You can use any python version you wish.
|
||||
|
||||
|
||||
## CI/CD Variables required
|
||||
|
||||
| var name | Description |
|
||||
|:----:|:----|
|
||||
| YAML_LINT_PATH | *The path you wish the linter to search for yaml files, defaults to `.`* |
|
||||
| YAML_LINT_EXTRA_ARGS | *configuration in yaml format., defaults to `{ extends: $ROOT_DIR/yaml_lint/.yamllint.yaml, ignore: [gitlab-ci/*] }` for further info see the [YAML Lint docs](https://yamllint.readthedocs.io/en/stable/configuration.html?highlight=exclude#custom-configuration-without-a-config-file)* |
|
||||
|
||||
|
||||
## Job Workflow
|
||||
|
||||
- This job will lint any yaml file in the specified directory using the specified rules.
|
||||
|
||||
|
||||
## Artifacts
|
||||
|
||||
- `$CI_PROJECT_DIR/artifacts` - Root artifact directory
|
||||
|
||||
- `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/$PYTHON_VERSION-yaml-lint.junit.xml` - JUnit Test report
|
||||
|
||||
- `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/$PYTHON_VERSION-yaml-lint.log` - Linter log
|
||||
|
||||
|
||||
## Gitlab job Definition
|
||||
|
||||
When you include this definition the following makes up the job definition
|
||||
|
||||
``` yaml title=".gitlab-ci.yml" linenums="1"
|
||||
|
||||
--8<-- "lint/yaml.gitlab-ci.yaml"
|
||||
|
||||
```
|
||||
|
||||
!!! Note
|
||||
Docs Still under development
|
0
docs/projects/index.md
Normal file
0
docs/projects/index.md
Normal file
0
docs/tags.md
Normal file
0
docs/tags.md
Normal file
@ -6,6 +6,7 @@
|
||||
- apk update
|
||||
- apk add git
|
||||
script:
|
||||
- if [ "0$GIT_SYNC_URL" == "0"]; then echo "[ERROR] you must define variable GIT_SYNC_URL for mirroring this repository."; fi
|
||||
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/$CI_PROJECT_PATH --mirror $CI_PROJECT_NAME
|
||||
- cd $CI_PROJECT_NAME
|
||||
- git remote add destination $GIT_SYNC_URL
|
||||
@ -14,7 +15,18 @@
|
||||
artifacts:
|
||||
expire_in: 1 day
|
||||
rules:
|
||||
- if: '$CI_COMMIT_BRANCH == "master"'
|
||||
- if: '$CI_COMMIT_BRANCH == "development"'
|
||||
- if: '$JOB_STOP_GIT_PUSH_MIRROR'
|
||||
when: never
|
||||
|
||||
- if: $GIT_SYNC_URL == null
|
||||
when: never
|
||||
|
||||
- if: # condition_master_or_dev_push
|
||||
(
|
||||
$CI_COMMIT_BRANCH == "master" ||
|
||||
$CI_COMMIT_BRANCH == "development"
|
||||
) &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
when: always
|
||||
|
||||
- when: never
|
||||
|
@ -1,5 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
2023-05-28 10:31:26 +0930 [bade89c](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/bade89c5333ca853844e224f46a2d3dafab7179d) - fix(scheduled_pipelines): if scheduled pipeline only run schedualable jobs
|
||||
2023-05-24 04:40:52 +0000 [0a17fe1](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/0a17fe1aa320c658c05d7a693ff76af4a54e6130) - build(version): bump version 0.6.1rc1 → 0.6.1rc2
|
||||
2023-05-15 00:18:38 +0000 [a3fdca8](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a3fdca83bf7acb58d47792a66d1cd0728747361c) - build(version): bump version 0.6.1rc0 → 0.6.1rc1
|
||||
2023-05-14 11:41:18 +0930 [1db2209](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/1db2209dfb36fbdda28d68388aec9f62f85b57bc) - feat(git_push_mirror): always sync git tag
|
||||
2023-05-13 15:35:28 +0930 [408e4ea](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/408e4eab9e1f61004f1e38af6d1531747b7da99b) - refactor: move docs as part of restructure
|
||||
2023-05-13 11:47:56 +0930 [81445c0](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/81445c06e43bce10761e3a7fbad7df97f82d6bc2) - feat(git_push_mirror): ability to disable job with variable
|
||||
2022-01-25 00:08:05 +0000 [ce1cc01](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/ce1cc017e26ff7f6cee586cc7d98e4d292275672) - build(version): bump version 0.6.0 → 0.6.1rc0
|
||||
2022-01-24 06:33:24 +0000 [46cc1fb](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/46cc1fbb6a878e485af39e679b5184a9912c2e7f) - build(version): bump version 0.5.0 → 0.6.0
|
||||
2022-01-16 00:09:42 +0000 [1ef6c41](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/1ef6c41818c40183f8019ea5cde48b4278e4d694) - build(version): bump version 0.4.0 → 0.5.0
|
||||
2022-01-15 03:53:53 +0000 [5c9000a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/5c9000a74859504ed64bbefa1fd193f80a2b69c2) - build(version): bump version 0.3.1 → 0.4.0
|
||||
2022-01-11 07:03:09 +0000 [7751fd9](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/7751fd9494f610fff0ea16bd303bfe62d0034eec) - build(version): bump version 0.3.0 → 0.3.1
|
||||
|
@ -18,24 +18,25 @@
|
||||
- git clone -b development $CLONE_URL repo
|
||||
- cd repo
|
||||
- git branch
|
||||
- git config --global user.email "CI@nfc-gitlab"
|
||||
- git config --global user.name "NFC CI"
|
||||
- git config --global user.email "helpdesk@nofusscomputing.com"
|
||||
- git config --global user.name "nfc_bot"
|
||||
- git push --set-upstream origin development
|
||||
- RELEASE_VERSION_CURRENT=$(cz -n cz_nfc version --project)
|
||||
script:
|
||||
- "$MY_COMMAND"
|
||||
- if [ "$CI_COMMIT_BRANCH" == "development" ] ; then RELEASE_CHANGELOG=$(cz -n cz_nfc bump --changelog --changelog-to-stdout --prerelease rc); else RELEASE_CHANGELOG=$(cz -n cz_nfc bump --changelog --changelog-to-stdout); fi
|
||||
- RELEASE_VERSION_NEW=$(cz -n cz_nfc version --project)
|
||||
- RELEASE_TAG=v$RELEASE_VERSION_NEW
|
||||
- if [ "0$RELEASE_VERSION_CURRENT" == "0$RELEASE_VERSION_NEW" ]; then echo "[DEBUG] No tag to delete, version was not bumped"; else git tag -d $RELEASE_TAG; fi
|
||||
- RELEASE_TAG=$RELEASE_VERSION_NEW
|
||||
- echo "[DEBUG] RELEASE_VERSION_CURRENT[$RELEASE_VERSION_CURRENT]"
|
||||
- echo "[DEBUG] RELEASE_CHANGELOG[$RELEASE_CHANGELOG]"
|
||||
- echo "[DEBUG] RELEASE_VERSION_NEW[$RELEASE_VERSION_NEW]"
|
||||
- echo "[DEBUG] RELEASE_TAG[$RELEASE_TAG]"
|
||||
- RELEASE_TAG_SHA1=$(git log -n1 --format=format:"%H")
|
||||
- echo "[DEBUG] RELEASE_TAG_SHA1[$RELEASE_TAG_SHA1]"
|
||||
- if [ "0$RELEASE_VERSION_CURRENT" == "0$RELEASE_VERSION_NEW" ]; then echo "[DEBUG] No tag to delete, version was not bumped"; else git tag -d $RELEASE_TAG; fi
|
||||
|
||||
- if [ "0$RELEASE_VERSION_CURRENT" == "0$RELEASE_VERSION_NEW" ]; then echo "[DEBUG] No push will be conducted, version was not bumped"; else git push; fi
|
||||
- if [ "0$RELEASE_VERSION_CURRENT" == "0$RELEASE_VERSION_NEW" ]; then echo "[DEBUG] No release will be created, version was not bumped"; else release-cli create --name "Release $RELEASE_TAG" --tag-name "$RELEASE_TAG" --ref "$RELEASE_TAG_SHA1" --description "$RELEASE_CHANGELOG"; fi
|
||||
- if [ "0$RELEASE_VERSION_CURRENT" == "0$RELEASE_VERSION_NEW" ]; then echo "[DEBUG] No release will be created, version was not bumped"; else release-cli create --name "Release $RELEASE_TAG" --tag-name "$RELEASE_TAG" --tag-message "$RELEASE_CHANGELOG" --ref "$RELEASE_TAG_SHA1" --description "$RELEASE_CHANGELOG"; fi
|
||||
- if [ "$CI_COMMIT_BRANCH" == "master" ] ; then git checkout master; fi
|
||||
- if [ "$CI_COMMIT_BRANCH" == "master" ] ; then git push --set-upstream origin master; fi
|
||||
- if [ "$CI_COMMIT_BRANCH" == "master" ] ; then git merge --no-ff development; fi
|
||||
@ -43,14 +44,28 @@
|
||||
after_script:
|
||||
- rm -Rf repo
|
||||
rules:
|
||||
- if: "$CI_COMMIT_AUTHOR =='NFC CI <CI@nfc-gitlab>'"
|
||||
- if: '$JOB_STOP_GITLAB_RELEASE'
|
||||
when: never
|
||||
- if: '$CI_COMMIT_BRANCH == "master"'
|
||||
when: always
|
||||
|
||||
- if: "$CI_COMMIT_AUTHOR =='nfc_bot <helpdesk@nofusscomputing.com>'"
|
||||
when: never
|
||||
|
||||
- if: # condition_master_branch_push
|
||||
$CI_COMMIT_BRANCH == "master" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
allow_failure: false
|
||||
- if: '$CI_COMMIT_BRANCH == "development"'
|
||||
when: on_success
|
||||
|
||||
- if: # condition_dev_branch_push
|
||||
$CI_COMMIT_BRANCH == "development" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
when: manual
|
||||
allow_failure: true
|
||||
|
||||
# for testing
|
||||
# - if: '$CI_COMMIT_BRANCH != "master"'
|
||||
# when: always
|
||||
# allow_failure: true
|
||||
- when: never
|
||||
|
||||
|
||||
@ -85,9 +100,26 @@ commit footer refs:
|
||||
junit:
|
||||
- "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/*.junit.xml"
|
||||
rules:
|
||||
- if: '$CI_COMMIT_BRANCH == "development" || $CI_COMMIT_BRANCH == "master"'
|
||||
- if: '$JOB_STOP_CONVENTIONAL_COMMITS'
|
||||
when: never
|
||||
- if: '$CI_COMMIT_BRANCH && $CHANGELOG_FOOTER_REFERENCES != "False"'
|
||||
when: always
|
||||
- when: never
|
||||
|
||||
- if: $CHANGELOG_FOOTER_REFERENCES == "False"
|
||||
when: never
|
||||
|
||||
# - if: '$CI_COMMIT_BRANCH == "development" || $CI_COMMIT_BRANCH == "master"'
|
||||
# when: never
|
||||
|
||||
- if: # condition_not_master_or_dev_push
|
||||
$CI_COMMIT_BRANCH != "master" &&
|
||||
$CI_COMMIT_BRANCH != "development" &&
|
||||
$CI_PIPELINE_SOURCE == "push" &&
|
||||
$CI_COMMIT_TAG == null
|
||||
exists:
|
||||
- .cz.yaml
|
||||
changes:
|
||||
paths:
|
||||
- "**/**"
|
||||
compare_to: development
|
||||
when: always
|
||||
|
||||
- when: never
|
||||
|
@ -1,5 +1,23 @@
|
||||
# Changelog
|
||||
|
||||
2023-05-28 10:31:26 +0930 [bade89c](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/bade89c5333ca853844e224f46a2d3dafab7179d) - fix(scheduled_pipelines): if scheduled pipeline only run schedualable jobs
|
||||
2023-05-24 04:40:52 +0000 [0a17fe1](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/0a17fe1aa320c658c05d7a693ff76af4a54e6130) - build(version): bump version 0.6.1rc1 → 0.6.1rc2
|
||||
2023-05-21 01:48:53 +0930 [088c9fb](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/088c9fb04c80961f4de8d2b129955ae8cd0b9529) - feat(conventional_commits): ensure .cz.yaml exists
|
||||
2023-05-15 10:25:48 +0930 [18a2808](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/18a280878799fe077efa0ed5b11bceedd53eb5c8) - fix(gitlab_release): allow skip on dev branch
|
||||
2023-05-15 10:19:49 +0930 [d89941d](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/d89941df05bfed4b0ad1277e715b224d232e7949) - feat(gitlab_release): dont automagic run on dev
|
||||
2023-05-15 00:18:38 +0000 [a3fdca8](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a3fdca83bf7acb58d47792a66d1cd0728747361c) - build(version): bump version 0.6.1rc0 → 0.6.1rc1
|
||||
2023-05-14 11:46:28 +0930 [e06ffef](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/e06ffef66c4a0ba1f48f109c175239560909e698) - feat(gitlab_release): run on merge to development
|
||||
2023-05-14 11:45:24 +0930 [199ea1f](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/199ea1f23c6a3df2b40ae3d9a5668719301500d9) - feat(gitlab_release): never run on merge or git tag
|
||||
2023-05-14 11:44:20 +0930 [a745cea](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a745ceac5ebce458b46593311e5285f40dcba349) - fix(gitlab_release): fixed rule to match nfc_bot
|
||||
2023-05-14 11:41:47 +0930 [1fa7fec](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/1fa7fec38a54b7ddf460b1394a7024ef161fab24) - refactor(gitlab_release): show debug before command
|
||||
2023-05-14 11:39:53 +0930 [e76378d](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/e76378dd068e200a1198f1811efb9d3bec7878f5) - fix(gitlab_release): only run on master on_success
|
||||
2023-05-14 09:56:35 +0930 [934a401](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/934a401a9620891b09a5fe9c9b0e50a97b43fa9b) - fix(ci): specify the commitizen version
|
||||
2023-05-13 15:35:28 +0930 [408e4ea](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/408e4eab9e1f61004f1e38af6d1531747b7da99b) - refactor: move docs as part of restructure
|
||||
2023-05-13 11:49:52 +0930 [8d512a9](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/8d512a9a4bd7f4895645436f057c4bab3efb864e) - feat(commit_footer_refs): ability to disable job with variable
|
||||
2023-05-13 11:48:47 +0930 [a37acbf](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a37acbfc7d3ea20ece7cb76e15a14858b26f8508) - feat(gitlab_release): ability to disable job with variable
|
||||
2022-02-12 10:27:01 +0000 [9a7ae71](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/9a7ae7106e80a038b31cdc9fc172bb1f974ecb94) - refactor: set correct commit details for nfc_bot
|
||||
2022-01-25 00:08:05 +0000 [ce1cc01](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/ce1cc017e26ff7f6cee586cc7d98e4d292275672) - build(version): bump version 0.6.0 → 0.6.1rc0
|
||||
2022-01-24 06:33:24 +0000 [46cc1fb](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/46cc1fbb6a878e485af39e679b5184a9912c2e7f) - build(version): bump version 0.5.0 → 0.6.0
|
||||
2022-01-16 00:09:42 +0000 [1ef6c41](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/1ef6c41818c40183f8019ea5cde48b4278e4d694) - build(version): bump version 0.4.0 → 0.5.0
|
||||
2022-01-16 09:02:44 +0930 [82c6c9f](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/82c6c9f5d53594544cea9a7bc59a10ab1e9ebedd) - feat(commit_footer_refs): never run on development or master.
|
||||
2022-01-15 03:53:53 +0000 [5c9000a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/5c9000a74859504ed64bbefa1fd193f80a2b69c2) - build(version): bump version 0.3.1 → 0.4.0
|
||||
|
@ -1,121 +0,0 @@
|
||||
# Commit Message Footer References - User Manual
|
||||
All commit messages must be in [conventional commit format](https://www.conventionalcommits.org/en/v1.0.0/) and have a footer with a gitlab reference. The reference **must** be either a merge request or a gitlab issue. (format i.e. `!1` or `#2` *using the correct reference number*).
|
||||
|
||||
|
||||
|
||||
## fixing commit messages (suggestion)
|
||||
|
||||
If only the last commit is the commit with an error just use `git commit --amend` and edit your commit message to be in the correct format and save. now push your changes.
|
||||
|
||||
|
||||
You will require the following information if the commit message with the error is further down the commit tree:
|
||||
- Commit message SHA1 of your first commit message to the branch `{original_commit}`
|
||||
- Commit message SHA1 prior to your first commit `{source_commit}`
|
||||
|
||||
Run these commands once you have the information above.
|
||||
``` bash
|
||||
git format-patch {original_commit}..HEAD -o diff-patches
|
||||
|
||||
git reset {source_commit} --hard
|
||||
```
|
||||
|
||||
Now, navigate to the `diff-patches` folder, open up the offending patch (commit) and edit the `subject` or message body as appropriate and save. Once all the edits have been done, re-apply the patches to your tree with:
|
||||
|
||||
``` bash
|
||||
git am diff-patches/*.patch
|
||||
```
|
||||
Now push your changes upstream.
|
||||
|
||||
| :notebook_with_decorative_cover: Note |
|
||||
|:-----:|
|
||||
| *As you have changed the commit SHA1(s), when you next push your changes upstream, you must force push. `git push --force`* |
|
||||
|
||||
| :octagonal_sign: **WARNING** |
|
||||
|:-----:|
|
||||
| *Ensure that all of your commits were exported prior to reseting the branch and when re-applying, that all of your commits were applied correctly* |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Gitlab Release - Developer Manual
|
||||
This job bumps the version, updates the changelog, creates a git tag and creates a gitlab release. The git tag and release title use [semantic versioning](https://semver.org/). for this job to function correctly a `.cz.yaml` is required in the root of the repository. this file contains the [commitizen](https://github.com/commitizen-tools/commitizen) config and the version details.
|
||||
|
||||
This job has the following workflow:
|
||||
|
||||
- `master` Branch
|
||||
> Automatically increment the version
|
||||
|
||||
- `development` Branch
|
||||
> Manual CI job made available to increment the version. (release-candidate increment only)
|
||||
|
||||
| :octagonal_sign: Danger |
|
||||
|:----|
|
||||
| *If prior to merging to the master branch you do a version increment, and there are no commits prior to merging. the job will not increment the version and the job will fail. it is recommended that you only do a version increment on the `development` branch if you are going to commit further changes to the `development` branch* |
|
||||
|
||||
|
||||
This job provides the following badge:
|
||||
|
||||
- None
|
||||
|
||||
## Dependencies
|
||||
|
||||
- None
|
||||
|
||||
## your .gitlab-ci.yml changes
|
||||
To use this job add the following to your `.gitlab-ci.yml` file
|
||||
|
||||
CI Job `ci commit footer` is automatically set to run on all branches except `development` and `master`. This job checks the commits on the users branch that they contain a footer with gitlab references. i.e. `#1` for issue one or `!1` for merge request one.
|
||||
|
||||
``` yaml
|
||||
stages:
|
||||
- validate
|
||||
- release
|
||||
|
||||
include:
|
||||
- remote: https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/raw/development/gitlab_release/.gitlab-ci.yml
|
||||
|
||||
Gitlab Release:
|
||||
variables:
|
||||
MY_COMMAND: "{your command here}"
|
||||
extends:
|
||||
- .gitlab_release
|
||||
```
|
||||
> if you wish to run any commands you can add them to variable `MY_COMMAND`. The custom command will run under shell `/bin/sh`. This command is set to run before the version bump commit is conducted so any changes you wish to add as part of the version bump, you can do here as long as you `git add {changed file name}`.
|
||||
|
||||
|
||||
## CI/CD Variables required
|
||||
|
||||
| var name | Description |
|
||||
|:----:|:----|
|
||||
| GIT_COMMIT_TOKEN | *this must be a personal token that has write access to the repository* |
|
||||
| CHANGELOG_FOOTER_REFERENCES | ***Optional** If set to `False` the changelog will not output gitlab references for each entry of the changelog. If this variable is set globally, it will also prevent the creation of the CI job to validate a users commits as having gitlab references.* |
|
||||
|
||||
|
||||
## Job Workflow
|
||||
|
||||
This CI job's workflow is:
|
||||
|
||||
1. updates the changelog from the commits
|
||||
1. commit the changelog to git
|
||||
1. adds a `git tag` to the changelog commit.
|
||||
1. pushes the change back to the repo
|
||||
1. creates a git release from the `git tag`
|
||||
|
||||
| :octagonal_sign: **NOTE** |
|
||||
|:----|
|
||||
| *If the user has forked the branch, they must keep the development brnach synced with the main repo. If they **don't** the CI job 'commit footer refs' will fail as it will not be able to fetch the parent (`development`) hash of the branch.* |
|
||||
|
||||
|
||||
## Artifacts
|
||||
|
||||
- `ci commit footer`
|
||||
> $CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/$CI_JOB_NAME.junit.xml
|
||||
|
||||
- `Gitlab Release`
|
||||
> None
|
||||
|
||||
## License
|
||||
To view the license for this folder and any sub-folders, refer [here](https://gitlab.com/nofusscomputing/projects/gitlab-ci)
|
||||
|
@ -1 +1 @@
|
||||
commitizen
|
||||
commitizen==2.21.0
|
||||
|
14
lint/CHANGELOG.md
Normal file
14
lint/CHANGELOG.md
Normal file
@ -0,0 +1,14 @@
|
||||
# Changelog
|
||||
|
||||
2023-05-28 10:31:26 +0930 [bade89c](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/bade89c5333ca853844e224f46a2d3dafab7179d) - fix(scheduled_pipelines): if scheduled pipeline only run schedualable jobs
|
||||
2023-05-24 04:40:52 +0000 [0a17fe1](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/0a17fe1aa320c658c05d7a693ff76af4a54e6130) - build(version): bump version 0.6.1rc1 → 0.6.1rc2
|
||||
2023-05-23 13:40:13 +0930 [e26f590](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/e26f590ebcf284be949be4e1d337e1f587755446) - fix(md_linting): must lint on git tag
|
||||
2023-05-23 09:10:19 +0930 [7c385b7](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/7c385b7552945699eb87ec3ec43169df0cb77297) - refactor(docs): pages dir renamed to docs
|
||||
2023-05-22 13:43:28 +0930 [065bcbf](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/065bcbf51717e6a29205ced8859a053a2915acd7) - chore(lint): correct lint errors
|
||||
2023-05-22 13:05:21 +0930 [18af7f8](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/18af7f831ad2399a6ae9809c51e87f19450db1a7) - fix(markdown_lint): use new lint path
|
||||
2023-05-22 13:04:11 +0930 [12d3a41](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/12d3a412ac73baff16b77488db143efd7311b542) - fix(markdown_lint): typo in config variable
|
||||
2023-05-22 12:57:08 +0930 [4fa90d4](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/4fa90d4c4249ed8929e7dde2e7bd0e8581d0d8a7) - feat(template): use md lint config from website-template
|
||||
2023-05-22 12:00:25 +0930 [38d4690](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/38d469007a388312c71a61916275d6a12aad8bbd) - feat(markdown_lint): enable specifying the lint config path
|
||||
2023-05-22 11:50:28 +0930 [bce7396](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/bce7396d8bbf5ec6600a3a34a05198a87c4fcc70) - refactor(markdown_lint): move md linting to lint folder
|
||||
2023-05-15 15:27:13 +0930 [a754aa8](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a754aa81edf1570b4e8e2e7d4a23025c8b99f314) - fix(lint): use correct path for requirements.txt
|
||||
2023-05-15 15:06:11 +0930 [539e40e](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/539e40e3008e24411f62f439d394db4b5e69a066) - refactor: move ansible and yaml lint job to linting folder
|
70
lint/ansible.gitlab-ci.yaml
Normal file
70
lint/ansible.gitlab-ci.yaml
Normal file
@ -0,0 +1,70 @@
|
||||
|
||||
.ansible_linter_defaults:
|
||||
stage: validation
|
||||
variables:
|
||||
ANSIBLE_LINT_PATH: defaults/ handlers/ meta/ tasks/ templates/
|
||||
before_script:
|
||||
- if [ "0$JOB_ROOT_DIR" == "0" ]; then ROOT_DIR=gitlab-ci; else ROOT_DIR=$JOB_ROOT_DIR ; fi
|
||||
- echo "[DEBUG] ROOT_DIR[$ROOT_DIR]"
|
||||
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME"
|
||||
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests"
|
||||
- export PYTHON_VERSION=`python -c 'import sys; version=sys.version_info[:3]; print("{0}.{1}.{2}".format(*version))'`
|
||||
- apt update
|
||||
- apt install --no-install-recommends -y git
|
||||
- python3 -m venv env
|
||||
- . env/bin/activate
|
||||
- pip install --upgrade pip
|
||||
- pip install -r $ROOT_DIR/lint/requirements.txt
|
||||
- mkdir $PYTHON_VERSION
|
||||
script:
|
||||
- ansible-lint -q --nocolor --parseable $ANSIBLE_LINT_PATH > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/$PYTHON_VERSION-ansible-lint.log" 1>&1 || ANSIBLE_LINT=$?
|
||||
- cat "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/$PYTHON_VERSION-ansible-lint.log" | ansible-lint-to-junit-xml > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/$PYTHON_VERSION-ansible-lint.junit.xml" 1>&1 || ANSIBLE_LINT_JUNIT=$?
|
||||
- ls -la $PYTHON_VERSION
|
||||
- if [ $ANSIBLE_LINT_JUNIT > 0 ]; then echo "Error ANSIBLE_LINT_JUNIT failed with $ANSIBLE_LINT_JUNIT"; fi
|
||||
- if [ $ANSIBLE_LINT -ge 3 ]; then echo "ansible lint failed with $ANSIBLE_LINT"; exit $ANSIBLE_LINT; fi # don't fail the job?? 1=failed test, 2=failed command i.e. switch/flag
|
||||
after_script:
|
||||
- echo deactivate
|
||||
artifacts:
|
||||
expire_in: 3 days
|
||||
when: always
|
||||
paths:
|
||||
- "artifacts/*"
|
||||
reports:
|
||||
junit:
|
||||
- "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/*.junit.xml"
|
||||
rules:
|
||||
|
||||
- if: '$JOB_STOP_ANSIBLE_LINT'
|
||||
when: never
|
||||
|
||||
- if: # condition_master_branch_push
|
||||
$CI_COMMIT_BRANCH == "master" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
exists:
|
||||
- "{defaults/**,handlers/**,inventory/**,meta/**,playbooks/**,tasks/**}/*.{yaml,yml}"
|
||||
when: always
|
||||
|
||||
- if: # condition_dev_branch_push
|
||||
$CI_COMMIT_BRANCH == "development" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
exists:
|
||||
- "{defaults/**,handlers/**,inventory/**,meta/**,playbooks/**,tasks/**}/*.{yaml,yml}"
|
||||
changes:
|
||||
paths:
|
||||
- "{defaults/**,handlers/**,inventory/**,meta/**,playbooks/**,tasks/**}/*.{yaml,yml}"
|
||||
compare_to: 'master'
|
||||
when: always
|
||||
|
||||
- if: # condition_not_master_or_dev_push
|
||||
$CI_COMMIT_BRANCH != "master" &&
|
||||
$CI_COMMIT_BRANCH != "development" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
exists:
|
||||
- "{defaults/**,handlers/**,inventory/**,meta/**,playbooks/**,tasks/**}/*.{yaml,yml}"
|
||||
changes:
|
||||
paths:
|
||||
- "{defaults/**,handlers/**,inventory/**,meta/**,playbooks/**,tasks/**}/*.{yaml,yml}"
|
||||
compare_to: 'development'
|
||||
when: always
|
||||
|
||||
- when: never
|
102
lint/markdown.gitlab-ci.yaml
Normal file
102
lint/markdown.gitlab-ci.yaml
Normal file
@ -0,0 +1,102 @@
|
||||
.Lint_Markdown:
|
||||
image: node:alpine3.14
|
||||
stage: validation
|
||||
variables:
|
||||
MDLINT_PATHS: "**/*.md **/**/*.md **/**/**/*.md **/**/**/**/*.md **/**/**/**/**/**/*.md #CHANGELOG.md !gitlab-ci"
|
||||
DEFAULT_ROOT_DIR: "./gitlab-ci"
|
||||
MD_LINT_CONFIG_PATH: ""
|
||||
before_script:
|
||||
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/lint_markdown"
|
||||
- if [ "0$JOB_ROOT_DIR" == "0" ]; then ROOT_DIR=$DEFAULT_ROOT_DIR; else ROOT_DIR=$JOB_ROOT_DIR; fi
|
||||
- echo "[DEBUG] ROOT_DIR[$ROOT_DIR]"
|
||||
- if [ "0$MD_LINT_CONFIG_PATH" != "0" ]; then cp "$MD_LINT_CONFIG_PATH/.markdownlint.json" $CI_PROJECT_DIR/.markdownlint.json; fi
|
||||
- cp -f "$ROOT_DIR/lint/.markdownlint-cli2.jsonc" "$CI_PROJECT_DIR/.markdownlint-cli2.jsonc"
|
||||
- npm install markdownlint-cli2 --global
|
||||
- npm install markdownlint-cli2-formatter-junit --global
|
||||
script:
|
||||
- echo "[DEBUG] MDLINT_PATHS=$MDLINT_PATHS"
|
||||
- markdownlint-cli2 $MDLINT_PATHS 1>&1 || EXITCODE=$?
|
||||
- echo DEBUG EXITCODE[$EXITCODE]
|
||||
- rm -f "$CI_PROJECT_DIR/.markdownlint-cli2.jsonc"
|
||||
- if [ "0$MD_LINT_CONFIG-PATH" != "0" ]; then rm -f "$CI_PROJECT_DIR/.markdownlint.json"; fi
|
||||
- mv *.junit.xml "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/lint_markdown/markdown_lint.junit.xml"
|
||||
artifacts:
|
||||
expire_in: 24 hrs
|
||||
when: always
|
||||
paths:
|
||||
- "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/lint_markdown/*"
|
||||
reports:
|
||||
junit:
|
||||
- "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/lint_markdown/*.junit.xml"
|
||||
rules:
|
||||
- if: '$JOB_STOP_LINT_MARKDOWN'
|
||||
when: never
|
||||
|
||||
- if: # condition_any_branch_push
|
||||
$CI_COMMIT_BRANCH != null &&
|
||||
$CI_COMMIT_TAG == null &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
exists:
|
||||
# - "**.md"
|
||||
# - "**/**.md"
|
||||
- '{!docs/**,!pages/**,!gitlab-ci/**,!website-template/**,**}/*.md'
|
||||
when: always
|
||||
- when: never
|
||||
|
||||
|
||||
.Lint_Markdown_Docs:
|
||||
variables:
|
||||
MDLINT_PATHS: "docs/*.md docs/**/*.md docs/**/**/*.md docs/**/**/**/*.md docs/**/**/**/**/**/*.md #CHANGELOG.md !gitlab-ci !website-template"
|
||||
MD_LINT_CONFIG_PATH: "$CI_PROJECT_DIR/website-template"
|
||||
extends: .Lint_Markdown
|
||||
rules:
|
||||
- if: '$JOB_STOP_LINT_MARKDOWN_DOCS'
|
||||
when: never
|
||||
|
||||
- if: # condition_git_tag
|
||||
$CI_COMMIT_TAG != null &&
|
||||
$CI_COMMIT_BRANCH == null
|
||||
exists:
|
||||
- '{docs/**,pages/**}/*.md'
|
||||
when: always
|
||||
|
||||
- if: # condition_master_branch_push
|
||||
$CI_COMMIT_BRANCH == "master" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
exists:
|
||||
- '{docs/**,pages/**}/*.md'
|
||||
when: always
|
||||
|
||||
- if: # condition_dev_branch_push
|
||||
$CI_COMMIT_BRANCH == "development" &&
|
||||
(
|
||||
$CI_PIPELINE_SOURCE == "pipeline"
|
||||
||
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
||
|
||||
$CI_PIPELINE_SOURCE == "schedule"
|
||||
)
|
||||
# See nofusscomputing/projects/gitlab-ci#34 for extra $CI_PIPELINE_SOURCE
|
||||
exists:
|
||||
- '{docs/**,pages/**}/*.md'
|
||||
# No changes check # See nofusscomputing/projects/gitlab-ci#34
|
||||
# changes:
|
||||
# paths:
|
||||
# - '{docs/**,pages/**}/*.md'
|
||||
# compare_to: 'master'
|
||||
when: always
|
||||
|
||||
- if: # condition_not_master_or_dev_push
|
||||
$CI_COMMIT_BRANCH != "master" &&
|
||||
$CI_COMMIT_BRANCH != "development" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
exists:
|
||||
- '{docs/**,pages/**}/*.md' # works
|
||||
changes:
|
||||
paths:
|
||||
#- '{docs/*,pages/*}*.md'
|
||||
- '{docs/**,pages/**}/*.md'
|
||||
compare_to: 'development'
|
||||
when: always
|
||||
|
||||
- when: never
|
11
lint/requirements.txt
Normal file
11
lint/requirements.txt
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
pipenv==2022.1.8
|
||||
wheel
|
||||
ansible
|
||||
setuptools_rust
|
||||
Rust
|
||||
ansible-lint==6.15.0
|
||||
yamllint==1.31.0
|
||||
lxml
|
||||
ansible-lint-junit==0.17.7
|
||||
ansible-lint-to-junit-xml==0.1.0
|
97
lint/yaml.gitlab-ci.yaml
Normal file
97
lint/yaml.gitlab-ci.yaml
Normal file
@ -0,0 +1,97 @@
|
||||
|
||||
.yaml_lint_defaults:
|
||||
variables:
|
||||
YAML_LINT_PATH: "."
|
||||
YAML_LINT_EXTRA_ARGS: "{ extends: $ROOT_DIR/lint/.yamllint.yaml, ignore: [gitlab-ci/*, website-template/*] }"
|
||||
stage: validation
|
||||
before_script:
|
||||
- if [ "0$JOB_ROOT_DIR" == "0" ]; then ROOT_DIR=gitlab-ci; else ROOT_DIR=$JOB_ROOT_DIR ; fi
|
||||
- echo "[DEBUG] ROOT_DIR[$ROOT_DIR]"
|
||||
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME"
|
||||
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests"
|
||||
- export PYTHON_VERSION=`python -c 'import sys; version=sys.version_info[:3]; print("{0}.{1}.{2}".format(*version))'`
|
||||
- apt update
|
||||
- apt install --no-install-recommends -y git
|
||||
- python3 -m venv env
|
||||
- . env/bin/activate
|
||||
- pip install --upgrade pip
|
||||
- pip install -r $ROOT_DIR/lint/requirements.txt
|
||||
- mkdir $PYTHON_VERSION
|
||||
script:
|
||||
- echo "[DEBUG] YAML_LINT_PATH[$YAML_LINT_PATH]"
|
||||
- echo "[DEBUG] YAML_LINT_CONFIG[$YAML_LINT_CONFIG]"
|
||||
- yamllint $YAML_LINT_PATH -f parsable -d "$(echo $YAML_LINT_EXTRA_ARGS)" > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/$PYTHON_VERSION-yaml-lint.log" 1>&1 || YAML_LINT=$?
|
||||
- cat "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/$PYTHON_VERSION-yaml-lint.log" | ansible-lint-to-junit-xml > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/$PYTHON_VERSION-yaml-lint.junit.xml"
|
||||
- if [ $YAML_LINT > 0 ]; then echo "YAML lint failed with $YAML_LINT"; exit $YAML_LINT; fi
|
||||
after_script:
|
||||
- echo deactivate
|
||||
artifacts:
|
||||
expire_in: 3 days
|
||||
when: always
|
||||
paths:
|
||||
- "artifacts/*"
|
||||
reports:
|
||||
junit:
|
||||
- "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/*.junit.xml"
|
||||
rules:
|
||||
- if: '$JOB_STOP_YAML_LINT'
|
||||
when: never
|
||||
|
||||
- if: '$CI_COMMIT_BRANCH == "master" &&
|
||||
( $CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "pipeline")'
|
||||
when: always
|
||||
|
||||
- if: '$CI_COMMIT_BRANCH &&
|
||||
( $CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "pipeline")'
|
||||
exists:
|
||||
- '{!gitlab-ci/**/*,!website-template/**/*,!.gitlab-ci,!*gitlab-ci*,**/*,**}.{yml,yaml}'
|
||||
# - ".gitlab-ci*"
|
||||
# - "**/*gitlab-ci*"
|
||||
changes:
|
||||
paths:
|
||||
- '{!gitlab-ci/**/*,!website-template/**/*,!.gitlab-ci,!*gitlab-ci*,**/*,**}.{yml,yaml}'
|
||||
compare_to: 'master'
|
||||
when: always
|
||||
|
||||
- when: never
|
||||
|
||||
|
||||
.Gitlab_CI.Lint.YAML:
|
||||
variables:
|
||||
YAML_LINT_PATH: ".gitlab-ci* ./**/*gitlab-ci*"
|
||||
YAML_LINT_EXTRA_ARGS: "{ extends: lint/.yamllint.yaml,ignore: [gitlab-ci/*,website-template/*] }"
|
||||
extends:
|
||||
- .yaml_lint_defaults
|
||||
rules:
|
||||
|
||||
- if: # condition_master_branch_push
|
||||
$CI_COMMIT_BRANCH == "master" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
exists:
|
||||
- '{*,**/**,**}/*gitlab-ci*'
|
||||
when: always
|
||||
|
||||
- if: # condition_dev_branch_push
|
||||
$CI_COMMIT_BRANCH == "development" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
exists:
|
||||
- '{*,**/**,**}/*gitlab-ci*'
|
||||
changes:
|
||||
paths:
|
||||
- '{*,**/**,**}/*gitlab-ci*'
|
||||
compare_to: 'master'
|
||||
when: always
|
||||
|
||||
- if: # condition_not_master_or_dev_push
|
||||
$CI_COMMIT_BRANCH != "master" &&
|
||||
$CI_COMMIT_BRANCH != "development" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
exists:
|
||||
- '{*,**/**,**}/*gitlab-ci*'
|
||||
changes:
|
||||
paths:
|
||||
- '{*,**/**,**}/*gitlab-ci*'
|
||||
compare_to: 'development'
|
||||
when: always
|
||||
|
||||
- when: never
|
71
mkdocs.yml
Normal file
71
mkdocs.yml
Normal file
@ -0,0 +1,71 @@
|
||||
INHERIT: website-template/mkdocs.yml
|
||||
|
||||
docs_dir: 'docs'
|
||||
|
||||
repo_name: Gitlab-CI
|
||||
repo_url: https://gitlab.com/nofusscomputing/projects/gitlab-ci
|
||||
edit_uri: '/-/ide/project/nofusscomputing/projects/gitlab-ci/edit/development/-/docs/'
|
||||
|
||||
nav:
|
||||
- Home: index.md
|
||||
|
||||
- Articles:
|
||||
|
||||
- articles/index.md
|
||||
|
||||
- Projects:
|
||||
|
||||
- projects/index.md
|
||||
|
||||
- Gitlab CI:
|
||||
|
||||
- Build:
|
||||
|
||||
- projects/gitlab-ci/docker_build.md
|
||||
|
||||
- projects/gitlab-ci/mkdocs-build.md
|
||||
|
||||
- Chores:
|
||||
|
||||
- projects/gitlab-ci/ansible_playbook.md
|
||||
|
||||
- Linting:
|
||||
|
||||
- projects/gitlab-ci/markdown_lint.md
|
||||
|
||||
- projects/gitlab-ci/yaml_lint.md
|
||||
|
||||
- Publish:
|
||||
|
||||
- projects/gitlab-ci/docker_publish.md
|
||||
|
||||
- Templates:
|
||||
|
||||
- projects/gitlab-ci/templates/index.md
|
||||
|
||||
- projects/gitlab-ci/templates/ansible_roles.md
|
||||
|
||||
- projects/gitlab-ci/templates/automagic.md
|
||||
|
||||
- projects/gitlab-ci/templates/docker_container.md
|
||||
|
||||
- projects/gitlab-ci/templates/documentation_mkdocs.md
|
||||
|
||||
- Validation:
|
||||
|
||||
- projects/gitlab-ci/conventional_commits.md
|
||||
|
||||
- projects/gitlab-ci/index.md
|
||||
|
||||
- projects/gitlab-ci/git_mirror.md
|
||||
|
||||
- projects/gitlab-ci/gitlab_release.md
|
||||
|
||||
- projects/gitlab-ci/python.md
|
||||
|
||||
- Operations:
|
||||
|
||||
- operations/index.md
|
||||
|
||||
- Contact Us: contact.md
|
||||
|
@ -4,7 +4,7 @@
|
||||
variables:
|
||||
GIT_DEPTH: 0
|
||||
MKDOCS_BUILD_PATH: build
|
||||
MKDOCS_SOURCE_PATH: pages
|
||||
MKDOCS_SOURCE_PATH: docs
|
||||
DEFAULT_ROOT_DIR: './gitlab-ci'
|
||||
before_script:
|
||||
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME"
|
||||
@ -12,6 +12,7 @@
|
||||
- echo "[DEBUG] ROOT_DIR[$ROOT_DIR]"
|
||||
- if [ ! -f "requirements.txt" ]; then pip install --upgrade pip -r $ROOT_DIR/mkdocs/requirements.txt; fi
|
||||
- if [ -f "requirements.txt" ]; then pip install --upgrade pip -r $ROOT_DIR/mkdocs/requirements.txt; pip install -r requirements.txt; fi
|
||||
- if [ -f "website-template/requirements.txt" ]; then pip install --upgrade pip -r $ROOT_DIR/mkdocs/requirements.txt; pip install -r website-template/requirements.txt; fi
|
||||
script:
|
||||
- mkdocs build --clean --strict
|
||||
- mv "$MKDOCS_BUILD_PATH" "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/$MKDOCS_BUILD_PATH"
|
||||
@ -22,8 +23,112 @@
|
||||
paths:
|
||||
- "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME"
|
||||
rules:
|
||||
- if: '$CI_COMMIT_BRANCH'
|
||||
|
||||
- if: '$JOB_STOP_MKDOCS_BUILD'
|
||||
when: never
|
||||
|
||||
- if: # condition_git_tag
|
||||
$CI_COMMIT_TAG != null &&
|
||||
$CI_COMMIT_BRANCH == null
|
||||
exists:
|
||||
- "mkdocs.yml"
|
||||
- 'mkdocs.{yaml,yml}'
|
||||
when: always
|
||||
|
||||
# - if: # condition_master_branch_push
|
||||
# $CI_COMMIT_BRANCH == "master" &&
|
||||
# $CI_PIPELINE_SOURCE == "push"
|
||||
# exists:
|
||||
# - 'mkdocs.{yaml,yml}'
|
||||
# when: always
|
||||
|
||||
- if: # condition_dev_branch_push
|
||||
$CI_COMMIT_BRANCH == "development" &&
|
||||
(
|
||||
$CI_PIPELINE_SOURCE == "pipeline"
|
||||
||
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
||
|
||||
$CI_PIPELINE_SOURCE == "schedule"
|
||||
)
|
||||
# See nofusscomputing/projects/gitlab-ci#34 for extra $CI_PIPELINE_SOURCE
|
||||
exists:
|
||||
- 'mkdocs.{yaml,yml}'
|
||||
# No changes check # See nofusscomputing/projects/gitlab-ci#34
|
||||
# changes:
|
||||
# paths:
|
||||
# - '{docs/**,pages/**}/*.md'
|
||||
# compare_to: 'master'
|
||||
when: always
|
||||
|
||||
- if: # condition_not_master_or_dev_push
|
||||
$CI_COMMIT_BRANCH != "master" &&
|
||||
$CI_COMMIT_BRANCH != "development" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
exists:
|
||||
- 'mkdocs.{yaml,yml}'
|
||||
changes:
|
||||
paths:
|
||||
- '{docs/**,pages/**}/*.md'
|
||||
compare_to: 'development'
|
||||
when: always
|
||||
|
||||
- when: never
|
||||
|
||||
|
||||
.MKDocs_Build_Docs:
|
||||
extends: .MKDocs_Build
|
||||
variables:
|
||||
MKDOCS_SOURCE_PATH: docs
|
||||
rules:
|
||||
- if: '$JOB_STOP_MKDOCS_BUILD'
|
||||
when: never
|
||||
|
||||
# Build docs on tag so they can be downloaded from the tag job and are always available.
|
||||
- if: # condition_git_tag
|
||||
$CI_COMMIT_TAG != null &&
|
||||
$CI_COMMIT_BRANCH == null
|
||||
exists:
|
||||
- '{docs/**,pages/**}/*.md'
|
||||
when: always
|
||||
|
||||
# - if: # condition_master_branch_push
|
||||
# $CI_COMMIT_BRANCH == "master" &&
|
||||
# $CI_PIPELINE_SOURCE == "push"
|
||||
# exists:
|
||||
# - '{docs/**,pages/**}/*.md'
|
||||
# when: always
|
||||
|
||||
- if: # condition_dev_branch_push
|
||||
$CI_COMMIT_BRANCH == "development" &&
|
||||
(
|
||||
$CI_PIPELINE_SOURCE == "pipeline"
|
||||
||
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
||
|
||||
$CI_PIPELINE_SOURCE == "schedule"
|
||||
)
|
||||
# See nofusscomputing/projects/gitlab-ci#34 for extra $CI_PIPELINE_SOURCE
|
||||
exists:
|
||||
- 'mkdocs.{yaml,yml}'
|
||||
# No changes check # See nofusscomputing/projects/gitlab-ci#34
|
||||
# changes:
|
||||
# paths:
|
||||
# - '{docs/**,pages/**}/*.md'
|
||||
# compare_to: 'master'
|
||||
when: always
|
||||
|
||||
|
||||
- if: # condition_not_master_or_dev_push
|
||||
$CI_COMMIT_BRANCH != "master" &&
|
||||
$CI_COMMIT_BRANCH != "development" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
exists:
|
||||
- '{docs/**,pages/**}/*.md'
|
||||
changes:
|
||||
paths:
|
||||
- '{docs/**,pages/**}/*.md'
|
||||
compare_to: 'development'
|
||||
when: always
|
||||
|
||||
- when: never
|
||||
|
@ -1,5 +1,17 @@
|
||||
# Changelog
|
||||
|
||||
2023-05-28 10:31:26 +0930 [bade89c](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/bade89c5333ca853844e224f46a2d3dafab7179d) - fix(scheduled_pipelines): if scheduled pipeline only run schedualable jobs
|
||||
2023-05-24 04:40:52 +0000 [0a17fe1](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/0a17fe1aa320c658c05d7a693ff76af4a54e6130) - build(version): bump version 0.6.1rc1 → 0.6.1rc2
|
||||
2023-05-23 09:46:43 +0930 [7a9aca3](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/7a9aca3a54b1faacb7e286bade84aff0ff4fd2e5) - fix(mkdocs): default to docs directory as root
|
||||
2023-05-22 18:05:24 +0930 [71a335c](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/71a335c2667505c199bd67446327cd8794de5f52) - feat(mkdocs): install website-template requirements
|
||||
2023-05-22 13:20:27 +0930 [a0b6d05](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a0b6d05a0f3f0fa84c825007f6ec9f28c945f3ef) - feat(mkdocs_build): always build
|
||||
2023-05-22 13:01:18 +0930 [6d2e50e](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/6d2e50e947839576f098bd7700e00b9d6ab4be1e) - feat(mkdocs_build): add manual build
|
||||
2023-05-21 15:59:14 +0930 [dacb9f2](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/dacb9f22dd9aee1ff741c7ac8078912d9a2b0dbf) - refactor(mkdocs): use locked version from website repo
|
||||
2023-05-21 15:43:45 +0930 [5556a57](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/5556a57ea5588d4f0cd1434bfdde5cd77e3b4f5c) - feat(mkdocs): only run on success
|
||||
2023-05-21 15:41:05 +0930 [1ec2666](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/1ec2666e8565d5206aefaf5462f0f83f74fbbcb7) - docs(mkdocs): moved to pages folder
|
||||
2023-05-15 00:18:38 +0000 [a3fdca8](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a3fdca83bf7acb58d47792a66d1cd0728747361c) - build(version): bump version 0.6.1rc0 → 0.6.1rc1
|
||||
2022-01-25 00:08:05 +0000 [ce1cc01](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/ce1cc017e26ff7f6cee586cc7d98e4d292275672) - build(version): bump version 0.6.0 → 0.6.1rc0
|
||||
2022-01-24 06:33:24 +0000 [46cc1fb](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/46cc1fbb6a878e485af39e679b5184a9912c2e7f) - build(version): bump version 0.5.0 → 0.6.0
|
||||
2022-01-24 14:08:14 +0930 [a2d705d](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a2d705deb1f3898b6d5fa4d55bd995b1a7ad4b68) - ci(mkdcos): mkdocs requirements.txt had a '\n' in the filename. renamed.
|
||||
2022-01-23 05:31:06 +0000 [906f09e](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/906f09e2d3285681bd982d65eda3f56cf5a5169e) - feat(mkdocs_build): use a pip file for job so that licence scanning can function.
|
||||
2022-01-23 05:18:27 +0000 [18c2e23](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/18c2e2312896aa0ba07050d28155c7aaca2aee5c) - chore(mkdocs): move mkdocs jobs to its own directory.
|
||||
|
@ -1 +1,9 @@
|
||||
mkdocs==1.2.3
|
||||
mkdocs-minify-plugin==0.5.0
|
||||
mkdocs-material-extensions==1.0.3
|
||||
wheel
|
||||
mkdocs-material==8.1.7
|
||||
./website-template/custom-plugins/mkdocs-plugin-tags
|
||||
mkdocs-git-revision-date-localized-plugin==0.11.1
|
||||
pymdown-extensions==9.1
|
||||
Jinja2==3.0.3
|
||||
|
@ -5,48 +5,81 @@
|
||||
}" > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/badge_pylint.json"
|
||||
|
||||
.PyLint:
|
||||
variables:
|
||||
PYLINT_PATH: "/*/python-module/*/*.py"
|
||||
PYLINT_RC_PATH: "/python/.pylintrc"
|
||||
stage: validation
|
||||
before_script:
|
||||
- if [ "0$JOB_ROOT_DIR" == "0" ]; then ROOT_DIR=gitlab-ci; else ROOT_DIR=$JOB_ROOT_DIR ; fi
|
||||
- echo "[DEBUG] ROOT_DIR[$ROOT_DIR]"
|
||||
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME"
|
||||
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests"
|
||||
- export PYTHON_VERSION=`python -c 'import sys; version=sys.version_info[:3]; print("{0}.{1}.{2}".format(*version))'`
|
||||
- apt update
|
||||
- apt install --no-install-recommends -y git
|
||||
- python3 -m venv env
|
||||
- . env/bin/activate
|
||||
- pip install --upgrade pip
|
||||
- pip install -r $ROOT_DIR/python/requirements.txt
|
||||
- mkdir $PYTHON_VERSION
|
||||
script:
|
||||
- PYLINT_PATH=$ROOT_DIR$PYLINT_PATH
|
||||
- echo "[DEBUG] PYLINT_PATH[$PYLINT_PATH]"
|
||||
- PYLINT_RC_PATH=$ROOT_DIR$PYLINT_RC_PATH
|
||||
- echo "[DEBUG] PYLINT_RC_PATH[$PYLINT_RC_PATH]"
|
||||
- python3 -m pylint --rcfile $PYLINT_RC_PATH --exit-zero --output-format=pylint_gitlab.GitlabCodeClimateReporter $PYLINT_PATH > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/gl-code-quality-report.json"
|
||||
variables:
|
||||
PYLINT_PATH: "/*/python-module/*/*.py"
|
||||
PYLINT_RC_PATH: "/python/.pylintrc"
|
||||
stage: validation
|
||||
before_script:
|
||||
- if [ "0$JOB_ROOT_DIR" == "0" ]; then ROOT_DIR=gitlab-ci; else ROOT_DIR=$JOB_ROOT_DIR ; fi
|
||||
- echo "[DEBUG] ROOT_DIR[$ROOT_DIR]"
|
||||
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME"
|
||||
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests"
|
||||
- export PYTHON_VERSION=`python -c 'import sys; version=sys.version_info[:3]; print("{0}.{1}.{2}".format(*version))'`
|
||||
- apt update
|
||||
- apt install --no-install-recommends -y git
|
||||
- python3 -m venv env
|
||||
- . env/bin/activate
|
||||
- pip install --upgrade pip
|
||||
- pip install -r $ROOT_DIR/python/requirements.txt
|
||||
- mkdir $PYTHON_VERSION
|
||||
script:
|
||||
- PYLINT_PATH=$ROOT_DIR$PYLINT_PATH
|
||||
- echo "[DEBUG] PYLINT_PATH[$PYLINT_PATH]"
|
||||
- PYLINT_RC_PATH=$ROOT_DIR$PYLINT_RC_PATH
|
||||
- echo "[DEBUG] PYLINT_RC_PATH[$PYLINT_RC_PATH]"
|
||||
- python3 -m pylint --rcfile $PYLINT_RC_PATH --exit-zero --output-format=pylint_gitlab.GitlabCodeClimateReporter $PYLINT_PATH > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/gl-code-quality-report.json"
|
||||
|
||||
- python3 -m pylint --rcfile $PYLINT_RC_PATH --exit-zero --output-format=pylint_gitlab.GitlabPagesHtmlReporter $PYLINT_PATH > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/gl-code-quality-report.html"
|
||||
- python3 -m pylint --rcfile $PYLINT_RC_PATH --exit-zero --output-format=pylint_gitlab.GitlabPagesHtmlReporter $PYLINT_PATH > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/gl-code-quality-report.html"
|
||||
|
||||
- PyPIScore=$(python3 -m pylint --rcfile $PYLINT_RC_PATH --exit-zero $PYLINT_PATH | sed -n 's/^Your code has been rated at \([-0-9./]*\).*/\1/p')
|
||||
- PyPIScore=$(python3 -m pylint --rcfile $PYLINT_RC_PATH --exit-zero $PYLINT_PATH | sed -n 's/^Your code has been rated at \([-0-9./]*\).*/\1/p')
|
||||
|
||||
- *pylint_badge
|
||||
- *pylint_badge
|
||||
|
||||
after_script:
|
||||
- echo deactivate
|
||||
artifacts:
|
||||
expire_in: 1 days
|
||||
when: always
|
||||
paths:
|
||||
- "artifacts/*"
|
||||
reports:
|
||||
codequality: "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/gl-code-quality-report.json"
|
||||
rules:
|
||||
|
||||
- if: # condition_master_branch_push
|
||||
$CI_COMMIT_BRANCH == "master" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
exists:
|
||||
#- '{**/,*,!gitlab-ci/**,!website-template/**}*.py'
|
||||
- '{**/,*}*.py'
|
||||
when: always
|
||||
|
||||
after_script:
|
||||
- echo deactivate
|
||||
artifacts:
|
||||
expire_in: 1 days
|
||||
when: always
|
||||
- if: # condition_development_branch_push
|
||||
$CI_COMMIT_BRANCH == "development" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
exists:
|
||||
#- '{**/,*,!gitlab-ci/**,!website-template/**}*.py'
|
||||
- '{**/,*}*.py'
|
||||
changes:
|
||||
paths:
|
||||
- "artifacts/*"
|
||||
reports:
|
||||
codequality: "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/gl-code-quality-report.json"
|
||||
rules:
|
||||
- if: '$CI_COMMIT_BRANCH'
|
||||
when: always
|
||||
- when: never
|
||||
#- '{**/,*,!gitlab-ci/**,!website-template/**}*.py'
|
||||
- '{**/,*}*.py'
|
||||
compare_to: 'master'
|
||||
when: always
|
||||
|
||||
- if: # condition_not_master_or_dev_push
|
||||
$CI_COMMIT_BRANCH != "master" &&
|
||||
$CI_COMMIT_BRANCH != "development" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
exists:
|
||||
#- '{**/,*,!gitlab-ci/**,!website-template/**}*.py'
|
||||
- '{**/,*}*.py'
|
||||
changes:
|
||||
paths:
|
||||
#- '{**/,*,!gitlab-ci/**,!website-template/**}*.py'
|
||||
- '{**/,*}*.py'
|
||||
compare_to: 'development'
|
||||
when: always
|
||||
|
||||
- when: never
|
||||
|
||||
|
@ -1,5 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
2023-05-28 10:31:26 +0930 [bade89c](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/bade89c5333ca853844e224f46a2d3dafab7179d) - fix(scheduled_pipelines): if scheduled pipeline only run schedualable jobs
|
||||
2023-05-24 04:40:52 +0000 [0a17fe1](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/0a17fe1aa320c658c05d7a693ff76af4a54e6130) - build(version): bump version 0.6.1rc1 → 0.6.1rc2
|
||||
2023-05-15 00:18:38 +0000 [a3fdca8](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a3fdca83bf7acb58d47792a66d1cd0728747361c) - build(version): bump version 0.6.1rc0 → 0.6.1rc1
|
||||
2023-05-13 15:35:28 +0930 [408e4ea](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/408e4eab9e1f61004f1e38af6d1531747b7da99b) - refactor: move docs as part of restructure
|
||||
2022-01-25 00:08:05 +0000 [ce1cc01](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/ce1cc017e26ff7f6cee586cc7d98e4d292275672) - build(version): bump version 0.6.0 → 0.6.1rc0
|
||||
2022-01-24 06:33:24 +0000 [46cc1fb](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/46cc1fbb6a878e485af39e679b5184a9912c2e7f) - build(version): bump version 0.5.0 → 0.6.0
|
||||
2022-01-16 00:09:42 +0000 [1ef6c41](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/1ef6c41818c40183f8019ea5cde48b4278e4d694) - build(version): bump version 0.4.0 → 0.5.0
|
||||
2022-01-15 03:53:53 +0000 [5c9000a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/5c9000a74859504ed64bbefa1fd193f80a2b69c2) - build(version): bump version 0.3.1 → 0.4.0
|
||||
2022-01-11 07:03:09 +0000 [7751fd9](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/7751fd9494f610fff0ea16bd303bfe62d0034eec) - build(version): bump version 0.3.0 → 0.3.1
|
||||
|
@ -1,11 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
for D in *; do
|
||||
if [ -d "${D}" ]; then
|
||||
|
||||
if [ "0${D}" != "0website-template" ] && [ "0${D}" != "0docs" ]; then
|
||||
echo "[DEBUG] Creating changelog for sub-folder: ${D}"
|
||||
|
||||
CHANGELOG_DATA=$(git log --pretty="format:%ci [%h](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/%H) - %s " --follow -- "${D}")
|
||||
@ -17,5 +15,6 @@ for D in *; do
|
||||
|
||||
git add ${D}/CHANGELOG.md
|
||||
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
18
template/CHANGELOG.md
Normal file
18
template/CHANGELOG.md
Normal file
@ -0,0 +1,18 @@
|
||||
# Changelog
|
||||
|
||||
2023-05-28 10:31:26 +0930 [bade89c](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/bade89c5333ca853844e224f46a2d3dafab7179d) - fix(scheduled_pipelines): if scheduled pipeline only run schedualable jobs
|
||||
2023-05-27 15:24:21 +0930 [19dde28](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/19dde28526d5e3f7694da3246505537aa2e19c10) - chore: fix linting error
|
||||
2023-05-27 15:21:27 +0930 [c5d27e8](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/c5d27e832e100156cb99c5ca580fd5a8eb600e0f) - feat(auto_jobs): created initial template to auto-create jobs
|
||||
2023-05-24 04:40:52 +0000 [0a17fe1](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/0a17fe1aa320c658c05d7a693ff76af4a54e6130) - build(version): bump version 0.6.1rc1 → 0.6.1rc2
|
||||
2023-05-23 12:37:40 +0930 [bef7684](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/bef76847ec686fcff92229d7b9be0bcfc7b267da) - feat(template_website): enable specifying the url slug
|
||||
2023-05-23 09:10:19 +0930 [7c385b7](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/7c385b7552945699eb87ec3ec43169df0cb77297) - refactor(docs): pages dir renamed to docs
|
||||
2023-05-22 13:45:03 +0930 [0b9e737](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/0b9e7375c911d65e06b0d801755449ab31cb45ea) - fix(template): use correct path for build artifact
|
||||
2023-05-22 13:43:28 +0930 [065bcbf](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/065bcbf51717e6a29205ced8859a053a2915acd7) - chore(lint): correct lint errors
|
||||
2023-05-22 13:20:54 +0930 [8e2a233](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/8e2a233814bd76ebff3dd8ed5a79afe307a84755) - feat(template): always deploy to pages on dev manual other
|
||||
2023-05-22 13:13:59 +0930 [1b59d62](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/1b59d62348465cc9cc069d5ee23e759316fa9b3c) - refactor(template_website): adjust names of jobs
|
||||
2023-05-22 12:57:08 +0930 [4fa90d4](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/4fa90d4c4249ed8929e7dde2e7bd0e8581d0d8a7) - feat(template): use md lint config from website-template
|
||||
2023-05-22 11:50:28 +0930 [bce7396](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/bce7396d8bbf5ec6600a3a34a05198a87c4fcc70) - refactor(markdown_lint): move md linting to lint folder
|
||||
2023-05-21 16:40:44 +0930 [16d47d5](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/16d47d5e350e1c78f72c97780ed1732a43927fcc) - feat(website): add pages job for website
|
||||
2023-05-21 15:53:54 +0930 [91a50eb](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/91a50eb15bd92ca65481a73c6f095681281941fe) - feat(template): created website job template
|
||||
2023-05-17 15:41:09 +0930 [a90ccb8](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a90ccb81772e295cebe89d7a9c32ab700e19884d) - refactor(docker): move docker jobs to their own file
|
||||
2023-05-17 15:38:11 +0930 [c34e382](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/c34e382a22cd39874abd8fb5116e831e888db8af) - refactor: use name that makes sense
|
29
template/ansible-role.gitlab-ci.yaml
Normal file
29
template/ansible-role.gitlab-ci.yaml
Normal file
@ -0,0 +1,29 @@
|
||||
# This gitlab-ci file is used for creating docker images.
|
||||
# by including this file, the jobs will be autocreated.
|
||||
|
||||
include:
|
||||
- local: $JOB_ROOT_DIR/.gitlab-ci_common.yaml
|
||||
- local: $JOB_ROOT_DIR/lint/ansible.gitlab-ci.yaml
|
||||
- local: $JOB_ROOT_DIR/conventional_commits/.gitlab-ci.yml
|
||||
- local: $JOB_ROOT_DIR/git_push_mirror/.gitlab-ci.yml
|
||||
- local: $JOB_ROOT_DIR/gitlab_release/.gitlab-ci.yml
|
||||
|
||||
|
||||
Ansible Lint (python 3.11):
|
||||
variables:
|
||||
ANSIBLE_LINT_PATH: defaults/ handlers/ meta/ tasks/ templates/
|
||||
extends:
|
||||
- .ansible_linter_defaults
|
||||
image: python:3.11-slim
|
||||
resource_group: build
|
||||
needs: []
|
||||
|
||||
|
||||
Gitlab Release:
|
||||
extends:
|
||||
- .gitlab_release
|
||||
|
||||
|
||||
Github (Push --mirror):
|
||||
extends:
|
||||
- .git_push_mirror
|
52
template/automagic.gitlab-ci.yaml
Normal file
52
template/automagic.gitlab-ci.yaml
Normal file
@ -0,0 +1,52 @@
|
||||
# This gitlab-ci file is used for the autocreation of ci jobs.
|
||||
# by including this file, the jobs will be autocreated if they are detected as required.
|
||||
|
||||
variables:
|
||||
NFC_AUTO_JOBS: 'true'
|
||||
|
||||
include:
|
||||
- local: $JOB_ROOT_DIR/.gitlab-ci_common.yaml
|
||||
|
||||
# Chore
|
||||
- local: $JOB_ROOT_DIR/automation/.gitlab-ci-ansible.yaml
|
||||
|
||||
# Validation
|
||||
- local: $JOB_ROOT_DIR/lint/ansible.gitlab-ci.yaml
|
||||
- local: $JOB_ROOT_DIR/conventional_commits/.gitlab-ci.yml
|
||||
|
||||
# sync
|
||||
- local: $JOB_ROOT_DIR/git_push_mirror/.gitlab-ci.yml
|
||||
|
||||
# release
|
||||
- local: $JOB_ROOT_DIR/gitlab_release/.gitlab-ci.yml
|
||||
|
||||
# templates
|
||||
- local: $JOB_ROOT_DIR/template/ansible-role.gitlab-ci.yaml
|
||||
- local: $JOB_ROOT_DIR/template/docker-image.gitlab-ci.yaml
|
||||
- local: $JOB_ROOT_DIR/template/mkdocs-documentation.gitlab-ci.yaml
|
||||
|
||||
|
||||
#
|
||||
# Chores
|
||||
#
|
||||
Update Git Submodules:
|
||||
extends: .ansible_playbook_git_submodule
|
||||
|
||||
Search Issues for git patches:
|
||||
extends: .ansible_playbook_mr_from_issue_comment_patch
|
||||
|
||||
#
|
||||
# Release
|
||||
#
|
||||
Gitlab Release:
|
||||
extends:
|
||||
- .gitlab_release
|
||||
|
||||
|
||||
#
|
||||
# Sync
|
||||
#
|
||||
Github (Push --mirror):
|
||||
extends:
|
||||
- .git_push_mirror
|
||||
needs: []
|
85
template/docker-image.gitlab-ci.yaml
Normal file
85
template/docker-image.gitlab-ci.yaml
Normal file
@ -0,0 +1,85 @@
|
||||
# This gitlab-ci file is used for creating docker images.
|
||||
# by including this file, the jobs will be autocreated.
|
||||
|
||||
include:
|
||||
- local: $JOB_ROOT_DIR/.gitlab-ci_common.yaml
|
||||
- local: $JOB_ROOT_DIR/conventional_commits/.gitlab-ci.yml
|
||||
- local: $JOB_ROOT_DIR/docker/build.gitlab-ci.yaml
|
||||
- local: $JOB_ROOT_DIR/docker/publish.gitlab-ci.yaml
|
||||
- local: $JOB_ROOT_DIR/git_push_mirror/.gitlab-ci.yml
|
||||
- local: $JOB_ROOT_DIR/gitlab_release/.gitlab-ci.yml
|
||||
|
||||
|
||||
variables:
|
||||
# Available platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
|
||||
# DOCKER_IMAGE_BUILD_TARGET_PLATFORMS: "linux/amd64,linux/arm64,linux/arm/v7"
|
||||
DOCKER_IMAGE_BUILD_NAME: $CI_PROJECT_NAME
|
||||
DOCKER_IMAGE_BUILD_REGISTRY: $CI_REGISTRY_IMAGE
|
||||
DOCKER_IMAGE_BUILD_TAG: $CI_COMMIT_SHA
|
||||
|
||||
# DOCKER_IMAGE_PUBLISH_NAME: $CI_PROJECT_NAME
|
||||
# DOCKER_IMAGE_PUBLISH_REGISTRY: docker.io/nofusscomputing
|
||||
# DOCKER_IMAGE_PUBLISH_URL: https://hub.docker.com/r/nofusscomputing/$DOCKER_IMAGE_PUBLISH_NAME
|
||||
# JOB_STOP_CONVENTIONAL_COMMITS: 'any_value'
|
||||
# JOB_STOP_GIT_PUSH_MIRROR: 'any_value'
|
||||
# GIT_SYNC_URL: "https://$GITHUB_USERNAME_ROBOT:$GITHUB_TOKEN_ROBOT@github.com/NoFussComputing/config.git" # Must be defined for job to run
|
||||
# JOB_STOP_GITLAB_RELEASE: 'any value'
|
||||
|
||||
|
||||
Docker Container:
|
||||
extends: .build_docker_container
|
||||
resource_group: build
|
||||
needs: []
|
||||
|
||||
|
||||
Docker.Hub.Branch.Publish:
|
||||
extends: .publish-docker-hub
|
||||
needs: [ "Docker Container" ]
|
||||
resource_group: build
|
||||
rules: # rules manually synced from docker/publish.gitlab-ci.yaml removing git tag
|
||||
|
||||
# - if: # condition_master_branch_push
|
||||
# $CI_COMMIT_BRANCH == "master" &&
|
||||
# $CI_PIPELINE_SOURCE == "push"
|
||||
# exists:
|
||||
# - '{dockerfile,dockerfile.j2}'
|
||||
# when: always
|
||||
|
||||
- if: # condition_dev_branch_push
|
||||
$CI_COMMIT_BRANCH == "development" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
exists:
|
||||
- '{dockerfile,dockerfile.j2}'
|
||||
changes:
|
||||
paths:
|
||||
- '{dockerfile,dockerfile.j2,includes/**/*}'
|
||||
compare_to: 'master'
|
||||
allow_failure: true
|
||||
when: on_success
|
||||
|
||||
- when: never
|
||||
|
||||
|
||||
Docker.Hub.Tag.Publish:
|
||||
extends: .publish-docker-hub
|
||||
resource_group: build
|
||||
rules: # rules manually synced from docker/publish.gitlab-ci.yaml only keeping git tag
|
||||
|
||||
- if: # condition_git_tag
|
||||
$CI_COMMIT_TAG != null &&
|
||||
$CI_COMMIT_BRANCH == null
|
||||
exists:
|
||||
- '{dockerfile,dockerfile.j2}'
|
||||
when: always
|
||||
|
||||
- when: never
|
||||
|
||||
|
||||
Gitlab Release:
|
||||
extends:
|
||||
- .gitlab_release
|
||||
|
||||
|
||||
Github (Push --mirror):
|
||||
extends:
|
||||
- .git_push_mirror
|
63
template/mkdocs-documentation.gitlab-ci.yaml
Normal file
63
template/mkdocs-documentation.gitlab-ci.yaml
Normal file
@ -0,0 +1,63 @@
|
||||
# This gitlab-ci file is used for creating building pages directories for nofusscomputing.com.
|
||||
# by including this file, the jobs will be autocreated and only for pages jobs.
|
||||
|
||||
include:
|
||||
- local: $JOB_ROOT_DIR/.gitlab-ci_common.yaml
|
||||
- local: $JOB_ROOT_DIR/mkdocs/.gitlab-ci.yml
|
||||
- local: $JOB_ROOT_DIR/lint/markdown.gitlab-ci.yaml
|
||||
|
||||
|
||||
Documentation.Lint:
|
||||
extends: .Lint_Markdown_Docs
|
||||
needs: []
|
||||
|
||||
|
||||
Documentation.Build:
|
||||
extends: .MKDocs_Build_Docs
|
||||
needs: [ 'Documentation.Lint' ]
|
||||
resource_group: Documentation
|
||||
|
||||
# this name must always be called 'pages' so that gitlab pages work
|
||||
pages:
|
||||
stage: deploy
|
||||
resource_group: Documentation
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
script:
|
||||
- mv "$CI_PROJECT_DIR/artifacts/build/Documentation.Build/build" public
|
||||
needs: [ 'Documentation.Build' ]
|
||||
environment:
|
||||
name: staging
|
||||
url: $CI_PAGES_URL/$PAGES_ENVIRONMENT_PATH
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
rules:
|
||||
- if: '$JOB_STOP_GITLAB_PAGES'
|
||||
when: never
|
||||
|
||||
- if: # condition_dev_branch_push
|
||||
$CI_COMMIT_BRANCH == "development" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
exists:
|
||||
- '{docs/**,pages/**}/*.md'
|
||||
changes:
|
||||
paths:
|
||||
- '{docs/**,pages/**}/*.md'
|
||||
compare_to: 'master'
|
||||
when: always
|
||||
|
||||
- if: # condition_not_master_or_dev_push
|
||||
$CI_COMMIT_BRANCH != "master" &&
|
||||
$CI_COMMIT_BRANCH != "development" &&
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
exists:
|
||||
- '{docs/**,pages/**}/*.md'
|
||||
changes:
|
||||
paths:
|
||||
- '{docs/**,pages/**}/*.md'
|
||||
compare_to: 'development'
|
||||
allow_failure: true
|
||||
when: manual
|
||||
|
||||
- when: never
|
@ -1,34 +0,0 @@
|
||||
.Lint_Markdown:
|
||||
image: node:alpine3.14
|
||||
stage: validation
|
||||
variables:
|
||||
MDLINT_PATH: '"**/*.md"'
|
||||
MDLINT_EXCLUDE_PATHS: '"!gitlab-ci"'
|
||||
DEFAULT_ROOT_DIR: './gitlab-ci'
|
||||
before_script:
|
||||
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME"
|
||||
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests"
|
||||
- if [ "0$JOB_ROOT_DIR" == "0" ]; then ROOT_DIR=$DEFAULT_ROOT_DIR; else ROOT_DIR=$JOB_ROOT_DIR ; fi
|
||||
- echo "[DEBUG] ROOT_DIR[$ROOT_DIR]"
|
||||
- cp -f "$CI_PROJECT_DIR/validation/.markdownlint-cli2.jsonc" "$CI_PROJECT_DIR/.markdownlint-cli2.jsonc"
|
||||
- npm install markdownlint-cli2 --global
|
||||
- npm install markdownlint-cli2-formatter-junit --global
|
||||
script:
|
||||
- markdownlint-cli2 $MDLINT_PATH $MDLINT_EXCLUDE_PATHS 1>&1 || EXITCODE=$?
|
||||
- echo DEBUG EXITCODE[$EXITCODE]
|
||||
- rm "$CI_PROJECT_DIR/.markdownlint-cli2.jsonc"
|
||||
- mv *.junit.xml $CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/markdown.junit.xml
|
||||
artifacts:
|
||||
expire_in: 24 hrs
|
||||
when: always
|
||||
paths:
|
||||
- "$CI_PROJECT_DIR/artifacts/*"
|
||||
reports:
|
||||
junit:
|
||||
- "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/*.junit.xml"
|
||||
rules:
|
||||
- if: '$CI_COMMIT_BRANCH'
|
||||
exists:
|
||||
- "**.md"
|
||||
- when: never
|
||||
|
@ -1,12 +0,0 @@
|
||||
# Changelog
|
||||
|
||||
2022-01-24 05:14:54 +0000 [b6dcb47](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/b6dcb47b1d1831784d36f482fd99c0ce5e56f088) - docs(markdown_lint): removed no longer needed requirement.
|
||||
2022-01-23 06:53:57 +0000 [fd48316](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/fd48316ae763282fc106b7da184c05b35d9ae052) - docs(markdown_lint): updated docs on how to use and view rules.
|
||||
2022-01-23 06:48:42 +0000 [9ab336f](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/9ab336fbddd6cba1d29c5a001ab52772ed4554b6) - feat(markdown_lint): include junit configuration file '.markdownlint-cli2.jsonc' in ci job.
|
||||
2022-01-23 06:39:23 +0000 [e46dc57](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/e46dc57b1643d6fd7c393bcf8b7d1d77bd2096c8) - chore(markdown_lint): add empty junit test file.
|
||||
2022-01-23 03:21:43 +0000 [2115964](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/21159643176249cbc33df3a655df90267d64bc3b) - chore: review fixes.
|
||||
2022-01-23 03:19:58 +0000 [e0d8885](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/e0d8885d52319a6188c779e80c2064b773721184) - ci(artifacts): markdown lint and mkdocs build artifacts to expire after 24 hours
|
||||
2022-01-23 11:05:07 +0930 [6363ea3](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/6363ea377cd008bbc839e6f4ee4fca337b77bc19) - docs(markdown_lint): completed the job docs.
|
||||
2022-01-23 10:43:54 +0930 [6383cde](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/6383cde3bf9985b2cb43908bc2486d1dc67b7026) - docs(markdown_lint): initial adding of the docs
|
||||
2022-01-23 10:03:02 +0930 [954aa28](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/954aa28dbf1073be05a3dd6d13da818a0bc7cb4e) - feat(validation): Added a Markdown linting validation job.
|
||||
2022-01-23 09:52:30 +0930 [bc67e93](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/bc67e939faf0b3d2eac05eae7edf297c81e55739) - chore: initial add of build and validation jobs for mkdocs and markdown linting
|
1
website-template
Submodule
1
website-template
Submodule
Submodule website-template added at 4ea7ab29be
@ -1,42 +0,0 @@
|
||||
|
||||
.yaml_lint_defaults:
|
||||
variables:
|
||||
YAML_LINT_PATH: "/*.yml"
|
||||
YAML_LINT_CONFIG: "/yaml_lint/.yamllint.yaml"
|
||||
stage: validation
|
||||
before_script:
|
||||
- if [ "0$JOB_ROOT_DIR" == "0" ]; then ROOT_DIR=gitlab-ci; else ROOT_DIR=$JOB_ROOT_DIR ; fi
|
||||
- echo "[DEBUG] ROOT_DIR[$ROOT_DIR]"
|
||||
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME"
|
||||
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests"
|
||||
- export PYTHON_VERSION=`python -c 'import sys; version=sys.version_info[:3]; print("{0}.{1}.{2}".format(*version))'`
|
||||
- apt update
|
||||
- apt install --no-install-recommends -y git
|
||||
- python3 -m venv env
|
||||
- . env/bin/activate
|
||||
- pip install --upgrade pip
|
||||
- pip install -r $ROOT_DIR/yaml_lint/requirements.txt
|
||||
- mkdir $PYTHON_VERSION
|
||||
script:
|
||||
- YAML_LINT_PATH=$ROOT_DIR$YAML_LINT_PATH
|
||||
- echo "[DEBUG] YAML_LINT_PATH[$YAML_LINT_PATH]"
|
||||
- YAML_LINT_CONFIG=$ROOT_DIR$YAML_LINT_CONFIG
|
||||
- echo "[DEBUG] YAML_LINT_CONFIG[$YAML_LINT_CONFIG]"
|
||||
- yamllint $YAML_LINT_PATH -f parsable -c $ROOT_DIR/yaml_lint/.yamllint.yaml > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/$PYTHON_VERSION-yaml-lint.log" 1>&1 || YAML_LINT=$?
|
||||
- cat "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/$PYTHON_VERSION-yaml-lint.log" | ansible-lint-to-junit-xml > "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/$PYTHON_VERSION-yaml-lint.junit.xml"
|
||||
- if [ $YAML_LINT > 0 ]; then echo "YAML lint failed with $YAML_LINT"; exit $YAML_LINT; fi
|
||||
after_script:
|
||||
- echo deactivate
|
||||
artifacts:
|
||||
expire_in: 3 days
|
||||
when: always
|
||||
paths:
|
||||
- "artifacts/*"
|
||||
reports:
|
||||
junit:
|
||||
- "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/*.junit.xml"
|
||||
rules:
|
||||
- if: '$CI_COMMIT_BRANCH'
|
||||
when: always
|
||||
- when: never
|
||||
|
@ -1,8 +0,0 @@
|
||||
# Changelog
|
||||
|
||||
2022-01-16 00:09:42 +0000 [1ef6c41](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/1ef6c41818c40183f8019ea5cde48b4278e4d694) - build(version): bump version 0.4.0 → 0.5.0
|
||||
2022-01-16 09:04:52 +0930 [140985c](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/140985c3a4ea07cf30f7fe8c970fb07cc61b776d) - feat(.yaml_lint_defaults): Always run on all branches as this denotes quality.
|
||||
2022-01-15 03:53:53 +0000 [5c9000a](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/5c9000a74859504ed64bbefa1fd193f80a2b69c2) - build(version): bump version 0.3.1 → 0.4.0
|
||||
2022-01-11 07:03:09 +0000 [7751fd9](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/7751fd9494f610fff0ea16bd303bfe62d0034eec) - build(version): bump version 0.3.0 → 0.3.1
|
||||
2021-08-12 03:32:36 +0000 [389bc08](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/389bc08d7686153fb374aa83d440c35c9b4eac90) - build(version): bump version 0.3.0rc1 → 0.3.0
|
||||
2021-08-11 13:41:42 +0930 [d20a56f](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/d20a56fa0ca492e3fc2ad7c548fc891cc8ffc8ec) - feat(yaml_lint): Added job yaml lint for checking yaml files
|
@ -1,52 +0,0 @@
|
||||
# Yaml Lint
|
||||
This job does yaml linting when any commit is pushed to any branch.
|
||||
|
||||
|
||||
This job provides the following badge:
|
||||
|
||||
- None
|
||||
|
||||
## Dependencies
|
||||
|
||||
- None
|
||||
|
||||
## your .gitlab-ci.yml changes
|
||||
To use this job add the following to your `.gitlab-ci.yml` file
|
||||
|
||||
``` yaml
|
||||
stages:
|
||||
- validation
|
||||
|
||||
include:
|
||||
- remote: https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/raw/master/yaml_lint/.gitlab-ci.yml
|
||||
|
||||
Yaml Lint (python 3.6):
|
||||
variables:
|
||||
YAML_LINT_PATH: "roles/"
|
||||
YAML_LINT_CONFIG: ".yamllint.yaml"
|
||||
extends:
|
||||
- .yaml_linter_defaults
|
||||
image: python:3.6-slim
|
||||
```
|
||||
> You can use any python version you wish.
|
||||
|
||||
## CI/CD Variables required
|
||||
|
||||
| var name | Description |
|
||||
|:----:|:----|
|
||||
| YAML_LINT_PATH | *The path you wish the linter to search for yaml files* |
|
||||
| YAML_LINT_CONFOG | *The path you have stored the yaml config file in* |
|
||||
|
||||
|
||||
## Job Workflow
|
||||
|
||||
- This job will lint any yaml file in the specified directory using the specified rules.
|
||||
|
||||
## Artifacts
|
||||
|
||||
- `$CI_PROJECT_DIR/artifacts` - Root artifact directory
|
||||
- `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/$PYTHON_VERSION-yaml-lint.junit.xml` - JUnit Test report
|
||||
- `$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME/$PYTHON_VERSION-yaml-lint.log` - Linter log
|
||||
|
||||
## License
|
||||
To view the license for this folder and any sub-folders, refer [here](https://gitlab.com/nofusscomputing/projects/gitlab-ci)
|
@ -1,2 +0,0 @@
|
||||
yamllint
|
||||
ansible-lint-to-junit-xml
|
Reference in New Issue
Block a user