Compare commits
45 Commits
Author | SHA1 | Date | |
---|---|---|---|
a3fdca83bf | |||
f8e7973c60 | |||
b0024c99b0 | |||
1233d6ad90 | |||
93931cb907 | |||
72f5289886 | |||
76db5b1757 | |||
a073dd0bad | |||
a925db1464 | |||
8581981a43 | |||
02e9e5f4f4 | |||
ca60625bf1 | |||
a04b272c16 | |||
47e3984916 | |||
3b686a461b | |||
7ed3f92dd7 | |||
bbbf9e35e2 | |||
adc720bbfa | |||
52c6ceda83 | |||
0d59871a1a | |||
492824572b | |||
cf10e289d2 | |||
0b4e85c313 | |||
d389d14192 | |||
e06ffef66c | |||
199ea1f23c | |||
a745ceac5e | |||
1fa7fec38a | |||
1db2209dfb | |||
e76378dd06 | |||
934a401a96 | |||
72f8eb720d | |||
1aeb9ec9b9 | |||
8b9a0356de | |||
408e4eab9e | |||
9670fc4740 | |||
8d512a9a4b | |||
a37acbfc7d | |||
81445c06e4 | |||
9e7d357bab | |||
36ce0b0b76 | |||
9a7ae7106e | |||
f6d7ebeeb2 | |||
d75e95998b | |||
8391bf659b |
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.1rc0
|
||||
version: 0.6.1rc1
|
||||
|
@ -1,15 +1,15 @@
|
||||
variables:
|
||||
JOB_ROOT_DIR: '.'
|
||||
SECURE_LOG_LEVEL: debug
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
MY_PROJECT_ID: "28543717"
|
||||
LICENSE_FINDER_CLI_OPTS: '--recursive'
|
||||
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
|
||||
- validation
|
||||
- test
|
||||
- release
|
||||
- sync
|
||||
|
||||
include:
|
||||
- local: $JOB_ROOT_DIR/yaml_lint/.gitlab-ci.yml
|
||||
@ -19,7 +19,7 @@ include:
|
||||
- local: $JOB_ROOT_DIR/validation/.gitlab-ci.yml
|
||||
- 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
|
||||
|
||||
# Scanner doesn't Pickup multiple pip files. Disable and specify jobs with pip file.
|
||||
gemnasium-python-dependency_scanning:
|
||||
@ -95,33 +95,37 @@ yaml_lint Dependencies:
|
||||
|
||||
|
||||
PyLint:
|
||||
extends:
|
||||
- .PyLint
|
||||
image: python:3.6-slim
|
||||
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
|
||||
gilab-ci.yml Lint (python 3.11):
|
||||
variables:
|
||||
YAML_LINT_PATH: ".gitlab-ci* ./**/*gitlab-ci*"
|
||||
YAML_LINT_EXTRA_ARGS: "{ extends: yaml_lint/.yamllint.yaml, ignore: [website-template/*] }"
|
||||
extends:
|
||||
- .yaml_lint_defaults
|
||||
image: python:3.11-slim
|
||||
|
||||
|
||||
Markdown Linting:
|
||||
variables:
|
||||
#MDLINT_PATHS: '!website_template** !.gitlab** !CHANGELOG.md **/*.md'
|
||||
MDLINT_PATHS: "**/*.md **/**/*.md **/**/**/*.md **/**/**/**/*.md **/**/**/**/**/**/*.md #**CHANGELOG.md #CHANGELOG.md #website-template/** #.gitlab/**"
|
||||
extends:
|
||||
- .Lint_Markdown
|
||||
|
||||
|
||||
Gitlab Release:
|
||||
variables:
|
||||
MY_COMMAND: ./sub-folder_changlog.sh
|
||||
extends:
|
||||
- .gitlab_release
|
||||
variables:
|
||||
MY_COMMAND: ./sub-folder_changlog.sh
|
||||
extends:
|
||||
- .gitlab_release
|
||||
|
||||
|
||||
Github (Push --mirror):
|
||||
variables:
|
||||
GIT_SYNC_URL: "https://$GITHUB_USERNAME_ROBOT:$GITHUB_TOKEN_ROBOT@github.com/NoFussComputing/gitlab-ci.git"
|
||||
extends:
|
||||
- .git_push_mirror
|
||||
variables:
|
||||
GIT_SYNC_URL: "https://$GITHUB_USERNAME_ROBOT:$GITHUB_TOKEN_ROBOT@github.com/NoFussComputing/gitlab-ci.git"
|
||||
extends:
|
||||
- .git_push_mirror
|
||||
|
13
.gitlab-ci_common.yaml
Normal file
13
.gitlab-ci_common.yaml
Normal file
@ -0,0 +1,13 @@
|
||||
variables:
|
||||
JOB_ROOT_DIR: 'gitlab-ci'
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
|
||||
|
||||
stages:
|
||||
- validation
|
||||
- build
|
||||
- prepare
|
||||
- test
|
||||
- release
|
||||
- sync
|
||||
- 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
|
56
CHANGELOG.md
56
CHANGELOG.md
@ -1,3 +1,59 @@
|
||||
## 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
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Changelog
|
||||
|
||||
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-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.
|
||||
|
@ -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: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
||||
when: never
|
||||
- if: '$CI_COMMIT_TAG'
|
||||
when: never
|
||||
- if: "$CI_COMMIT_AUTHOR =='nfc_bot <helpdesk@nofusscomputing.com>'"
|
||||
when: never
|
||||
- if: '$CI_COMMIT_BRANCH == "master"'
|
||||
when: always
|
||||
- if: '$CI_COMMIT_BRANCH'
|
||||
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,13 @@
|
||||
# Changelog
|
||||
|
||||
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.
|
||||
|
@ -1,3 +1,3 @@
|
||||
python-gitlab
|
||||
requests
|
||||
commitizen
|
||||
commitizen==2.21.0
|
||||
|
@ -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,11 @@
|
||||
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: '$CI_COMMIT_TAG && $GIT_SYNC_URL != null'
|
||||
when: always
|
||||
- if: '$CI_COMMIT_BRANCH == "master" && $GIT_SYNC_URL != null'
|
||||
- if: '$CI_COMMIT_BRANCH == "development" && $GIT_SYNC_URL != null'
|
||||
when: always
|
||||
|
||||
|
@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
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
|
||||
|
@ -18,22 +18,23 @@
|
||||
- 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 [ "$CI_COMMIT_BRANCH" == "master" ] ; then git checkout master; fi
|
||||
@ -43,14 +44,24 @@
|
||||
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_TAG'
|
||||
when: never
|
||||
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
||||
when: never
|
||||
- if: "$CI_COMMIT_AUTHOR =='nfc_bot <helpdesk@nofusscomputing.com>'"
|
||||
when: never
|
||||
- if: '$CI_COMMIT_BRANCH == "master"'
|
||||
when: always
|
||||
when: on_success
|
||||
allow_failure: false
|
||||
- if: '$CI_COMMIT_BRANCH == "development"'
|
||||
when: manual
|
||||
allow_failure: true
|
||||
when: on_success
|
||||
allow_failure: false
|
||||
# for testing
|
||||
# - if: '$CI_COMMIT_BRANCH != "master"'
|
||||
# when: always
|
||||
# allow_failure: true
|
||||
- when: never
|
||||
|
||||
|
||||
@ -85,6 +96,8 @@ commit footer refs:
|
||||
junit:
|
||||
- "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/*.junit.xml"
|
||||
rules:
|
||||
- if: '$JOB_STOP_CONVENTIONAL_COMMITS'
|
||||
when: never
|
||||
- if: '$CI_COMMIT_BRANCH == "development" || $CI_COMMIT_BRANCH == "master"'
|
||||
when: never
|
||||
- if: '$CI_COMMIT_BRANCH && $CHANGELOG_FOOTER_REFERENCES != "False"'
|
||||
|
@ -1,5 +1,16 @@
|
||||
# Changelog
|
||||
|
||||
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.
|
||||
|
@ -1 +1 @@
|
||||
commitizen
|
||||
commitizen==2.21.0
|
||||
|
49
mkdocs.yml
Normal file
49
mkdocs.yml
Normal file
@ -0,0 +1,49 @@
|
||||
INHERIT: website-template/mkdocs.yml
|
||||
|
||||
repo_name: Website
|
||||
repo_url: https://gitlab.com/nofusscomputing/projects/gitlab-ci
|
||||
edit_uri: ''
|
||||
|
||||
nav:
|
||||
- Home: index.md
|
||||
|
||||
- Articles:
|
||||
|
||||
- articles/index.md
|
||||
|
||||
- Content Tags: tags.md
|
||||
|
||||
- Projects:
|
||||
|
||||
- projects/index.md
|
||||
|
||||
- Ansible Roles: projects/ansible-roles/README.md
|
||||
|
||||
- Gitlab CI:
|
||||
- projects/gitlab-ci/README.md
|
||||
|
||||
- projects/gitlab-ci/ansible_roles.md
|
||||
|
||||
- projects/gitlab-ci/conventional_commits.md
|
||||
|
||||
- projects/gitlab-ci/docker_container.md
|
||||
|
||||
- projects/gitlab-ci/git_mirror.md
|
||||
|
||||
- projects/gitlab-ci/gitlab_release.md
|
||||
|
||||
- projects/gitlab-ci/python.md
|
||||
|
||||
- projects/gitlab-ci/yaml_lint.md
|
||||
|
||||
- Python Gitlab Management: projects/python-gitlab-management/README.md
|
||||
|
||||
|
||||
|
||||
|
||||
- Operations:
|
||||
|
||||
- operations/index.md
|
||||
|
||||
- Contact Us: contact.md
|
||||
|
@ -1,5 +1,6 @@
|
||||
# Changelog
|
||||
|
||||
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.
|
||||
|
5
pages/CHANGELOG.md
Normal file
5
pages/CHANGELOG.md
Normal file
@ -0,0 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
2023-05-14 15:50:23 +0930 [a925db1](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a925db14641e709572b832278f43aabe48d153f7) - docs(yaml_lint): update docs for new variables
|
||||
2023-05-14 15:45:30 +0930 [8581981](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/8581981a43c31d6903865f067fa3f77adae949e5) - fix(markdown_lint): fix search paths
|
||||
2023-05-13 15:35:28 +0930 [408e4ea](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/408e4eab9e1f61004f1e38af6d1531747b7da99b) - refactor: move docs as part of restructure
|
0
pages/index.md
Normal file
0
pages/index.md
Normal file
@ -1,4 +1,11 @@
|
||||
# Ansible
|
||||
---
|
||||
title: Ansible
|
||||
description: How to use No Fuss Computings gitlab-ci job for ansible
|
||||
date: 2021-08-03
|
||||
template: manual.html
|
||||
about: https://gitlab.com/nofusscomputing/projects/gitlab-ci
|
||||
---
|
||||
|
||||
This job does ansible role/playbook linting when any commit is pushed to any branch.
|
||||
|
||||
|
@ -1,4 +1,12 @@
|
||||
# Conventional Commits User Manual
|
||||
---
|
||||
title: Conventional Commits
|
||||
description: How to use No Fuss Computings gitlab-ci job for Conventional Commits
|
||||
date: 2021-08-03
|
||||
template: manual.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:
|
||||
@ -9,17 +17,17 @@ These CI Jobs output a test report that can be viewed inside of the merge reques
|
||||
|
||||
To fix an error please refer to the titled sections below.
|
||||
|
||||
## MR Title
|
||||
### 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
|
||||
### 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)
|
||||
#### 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.
|
||||
|
||||
@ -51,18 +59,18 @@ Now push your changes upstream.
|
||||
| *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
|
||||
## 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
|
||||
### Dependencies
|
||||
|
||||
- None
|
||||
|
||||
## your .gitlab-ci.yml changes
|
||||
### your .gitlab-ci.yml changes
|
||||
To use this job add the following to your `.gitlab-ci.yml` file
|
||||
|
||||
``` yaml
|
||||
@ -84,11 +92,11 @@ include:
|
||||
| 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
|
||||
### Job Workflow
|
||||
|
||||
|
||||
## Artifacts
|
||||
### Artifacts
|
||||
|
||||
|
||||
## License
|
||||
### License
|
||||
To view the license for this folder and any sub-folders, refer [here](https://gitlab.com/nofusscomputing/projects/gitlab-ci)
|
29
pages/projects/gitlab-ci/docker_container.md
Normal file
29
pages/projects/gitlab-ci/docker_container.md
Normal file
@ -0,0 +1,29 @@
|
||||
---
|
||||
title: Docker Container CI Template
|
||||
description: How to use No Fuss Computings gitlab-ci template for docker containers
|
||||
date: 2023-05-13
|
||||
template: manual.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
|
||||
|
||||
``` 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'
|
||||
```
|
@ -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: manual.html
|
||||
about: https://gitlab.com/nofusscomputing/projects/gitlab-ci
|
||||
---
|
||||
|
||||
This job does a git push to a remote git repo.
|
||||
|
||||
|
@ -1,4 +1,13 @@
|
||||
# Commit Message Footer References - User Manual
|
||||
---
|
||||
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: manual.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*).
|
||||
|
||||
|
@ -1,4 +1,12 @@
|
||||
# Python
|
||||
---
|
||||
title: Python
|
||||
description: How to use No Fuss Computings gitlab-ci job for Python
|
||||
date: 2021-08-11
|
||||
template: manual.html
|
||||
about: https://gitlab.com/nofusscomputing/projects/gitlab-ci
|
||||
---
|
||||
|
||||
|
||||
This folder (`python`) covers jobs for python development
|
||||
|
||||
|
@ -1,4 +1,11 @@
|
||||
# Yaml Lint
|
||||
---
|
||||
title: YAML Linting
|
||||
description: How to use No Fuss Computings gitlab-ci job for YAML Linting
|
||||
date: 2021-08-11
|
||||
template: manual.html
|
||||
about: https://gitlab.com/nofusscomputing/projects/gitlab-ci
|
||||
---
|
||||
|
||||
This job does yaml linting when any commit is pushed to any branch.
|
||||
|
||||
|
||||
@ -22,8 +29,8 @@ include:
|
||||
|
||||
Yaml Lint (python 3.6):
|
||||
variables:
|
||||
YAML_LINT_PATH: "roles/"
|
||||
YAML_LINT_CONFIG: ".yamllint.yaml"
|
||||
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
|
||||
@ -34,8 +41,8 @@ Yaml Lint (python 3.6):
|
||||
|
||||
| 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* |
|
||||
| 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
|
@ -1,5 +1,7 @@
|
||||
# Changelog
|
||||
|
||||
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
|
||||
|
7
type/CHANGELOG.md
Normal file
7
type/CHANGELOG.md
Normal file
@ -0,0 +1,7 @@
|
||||
# Changelog
|
||||
|
||||
2023-05-15 09:29:19 +0930 [72f5289](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/72f52898869fe23174e649f0bf8327732fd52147) - fix(docker): setup ROOT_DIR
|
||||
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:44:46 +0930 [4928245](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/492824572b963f048af993fc36d8696f9b0fe41e) - ci: dont lint git submodule website-template
|
||||
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:36:31 +0930 [8b9a035](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/8b9a0356dec7d99a63c4ed744b78ae707155e9f3) - feat(template): added new template for ci pipeline for docker containers
|
224
type/docker-image.gitlab-ci.yaml
Normal file
224
type/docker-image.gitlab-ci.yaml
Normal file
@ -0,0 +1,224 @@
|
||||
# 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/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'
|
||||
|
||||
|
||||
.build_docker_container:
|
||||
stage: build
|
||||
image: nofusscomputing/docker-buildx-qemu:dev
|
||||
services:
|
||||
- name: docker:23-dind
|
||||
entrypoint: ["env", "-u", "DOCKER_HOST"]
|
||||
command: ["dockerd-entrypoint.sh"]
|
||||
variables:
|
||||
DOCKER_HOST: tcp://docker:2375/
|
||||
DOCKER_DRIVER: overlay2
|
||||
# See https://github.com/docker-library/docker/pull/166
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
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]"
|
||||
- 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/.
|
||||
- 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: |
|
||||
|
||||
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" \
|
||||
--no-cache \
|
||||
--push \
|
||||
--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" \
|
||||
--no-cache \
|
||||
--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: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
||||
when: never
|
||||
- if: $CI_COMMIT_TAG
|
||||
when: on_success
|
||||
- if: '$CI_COMMIT_BRANCH == "development"'
|
||||
when: on_success
|
||||
- if: '$CI_COMMIT_BRANCH != "master"'
|
||||
when: always
|
||||
- when: never
|
||||
|
||||
|
||||
.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
|
||||
|
||||
if [ "0$CI_COMMIT_TAG" != "0" ]; then
|
||||
|
||||
DOCKER_HUB_TAG=latest
|
||||
|
||||
if [ "0$CI_COMMIT_TAG" == *"rc"* ]; then
|
||||
|
||||
DOCKER_HUB_TAG=dev
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
echo "[DEBUG] DOCKER_IMAGE_PUBLISH_NAME=$DOCKER_IMAGE_PUBLISH_NAME";
|
||||
echo "[DEBUG] 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_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_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
|
||||
needs: [ "Docker Container" ]
|
||||
environment:
|
||||
name: DockerHub
|
||||
url: $DOCKER_IMAGE_PUBLISH_URL
|
||||
rules:
|
||||
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
||||
when: never
|
||||
- if: $CI_COMMIT_TAG
|
||||
when: on_success
|
||||
- if: '$CI_COMMIT_BRANCH == "development"'
|
||||
when: on_success
|
||||
- if: '$CI_COMMIT_BRANCH != "master"'
|
||||
allow_failure: true
|
||||
when: manual
|
||||
- when: never
|
||||
|
||||
|
||||
Docker Container:
|
||||
extends: .build_docker_container
|
||||
|
||||
|
||||
Docker Hub:
|
||||
extends: .publish-docker-hub
|
||||
|
||||
|
||||
Gitlab Release:
|
||||
extends:
|
||||
- .gitlab_release
|
||||
|
||||
|
||||
Github (Push --mirror):
|
||||
extends:
|
||||
- .git_push_mirror
|
@ -2,33 +2,33 @@
|
||||
image: node:alpine3.14
|
||||
stage: validation
|
||||
variables:
|
||||
MDLINT_PATH: '"**/*.md"'
|
||||
MDLINT_EXCLUDE_PATHS: '"!gitlab-ci"'
|
||||
DEFAULT_ROOT_DIR: './gitlab-ci'
|
||||
MDLINT_PATHS: "**/*.md **/**/*.md **/**/**/*.md **/**/**/**/*.md **/**/**/**/**/**/*.md #CHANGELOG.md !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"
|
||||
- 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]"
|
||||
- cp -f "$ROOT_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] MDLINT_PATHS=$MDLINT_PATHS"
|
||||
- markdownlint-cli2 $MDLINT_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
|
||||
- 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_PROJECT_DIR/artifacts/$CI_JOB_STAGE/lint_markdown/*"
|
||||
reports:
|
||||
junit:
|
||||
- "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/*.junit.xml"
|
||||
- "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/lint_markdown/*.junit.xml"
|
||||
rules:
|
||||
- if: '$CI_COMMIT_BRANCH'
|
||||
exists:
|
||||
- "**.md"
|
||||
- "**/**.md"
|
||||
- when: never
|
||||
|
||||
|
@ -1,5 +1,10 @@
|
||||
# Changelog
|
||||
|
||||
2023-05-14 15:45:30 +0930 [8581981](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/8581981a43c31d6903865f067fa3f77adae949e5) - fix(markdown_lint): fix search paths
|
||||
2023-05-14 12:44:08 +0930 [cf10e28](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/cf10e289d21a5cc529bbe7effb189aab65875510) - fix(markdown_lint): enable job for md in sub folders
|
||||
2022-01-31 10:19:16 +0930 [d75e959](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/d75e95998b4a195cfcc36683ffa6f058bf7b05be) - feat(markdown_lint): artifact locations to be hard set
|
||||
2022-01-31 10:15:54 +0930 [8391bf6](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/8391bf659bf5dd39edf31205a68c699851e78be3) - fix(markdown_lint): remove quotes from search path 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-25 09:23:42 +0930 [e0402ec](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/e0402ecfb2ab662a74bb70df7937b02576d5e41b) - fix(lint_markdown): ensure the correct path for the job directory is used
|
||||
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 05:14:54 +0000 [b6dcb47](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/b6dcb47b1d1831784d36f482fd99c0ce5e56f088) - docs(markdown_lint): removed no longer needed requirement.
|
||||
|
1
website-template
Submodule
1
website-template
Submodule
Submodule website-template added at 969912bcb7
@ -1,8 +1,8 @@
|
||||
|
||||
.yaml_lint_defaults:
|
||||
variables:
|
||||
YAML_LINT_PATH: "/*.yml"
|
||||
YAML_LINT_CONFIG: "/yaml_lint/.yamllint.yaml"
|
||||
YAML_LINT_PATH: "."
|
||||
YAML_LINT_EXTRA_ARGS: "{ extends: $ROOT_DIR/yaml_lint/.yamllint.yaml, ignore: [gitlab-ci/*] }"
|
||||
stage: validation
|
||||
before_script:
|
||||
- if [ "0$JOB_ROOT_DIR" == "0" ]; then ROOT_DIR=gitlab-ci; else ROOT_DIR=$JOB_ROOT_DIR ; fi
|
||||
@ -18,11 +18,9 @@
|
||||
- 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=$?
|
||||
- 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:
|
||||
@ -36,7 +34,14 @@
|
||||
junit:
|
||||
- "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/*.junit.xml"
|
||||
rules:
|
||||
- if: '$JOB_STOP_YAML_LINT'
|
||||
when: never
|
||||
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
||||
when: never
|
||||
- if: '$CI_COMMIT_TAG'
|
||||
when: always
|
||||
- if: '$CI_COMMIT_BRANCH == "master"'
|
||||
when: always
|
||||
- if: '$CI_COMMIT_BRANCH'
|
||||
when: always
|
||||
- when: never
|
||||
|
||||
|
@ -1,5 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
2023-05-14 14:00:41 +0930 [a04b272](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/a04b272c167dae27940211b7c77a4adcb33b2086) - fix(yaml_lint): remove extra var creation
|
||||
2023-05-14 13:59:13 +0930 [3b686a4](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/3b686a461be22b682642eb1143f2bd2ea2d3ef17) - fix(yaml_lint): ensure config is within double quote
|
||||
2023-05-14 13:12:19 +0930 [52c6ced](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/52c6ceda83b04e1e18eaa9c32b1a41733dc26497) - fix(yaml_lint): scan all
|
||||
2023-05-14 13:11:43 +0930 [0d59871](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/0d59871a1a73178c248b2189dfae2cd93f21c469) - fix(yaml_lint): enable specifying additional config
|
||||
2023-05-14 12:12:07 +0930 [0b4e85c](https://gitlab.com/nofusscomputing/projects/gitlab-ci/-/commit/0b4e85c3134ff9f126056113383383559cdfb227) - feat(yaml_lint): added var to prevent job from runnng
|
||||
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-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-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.
|
||||
|
Reference in New Issue
Block a user