From 0eec0d343298fa258c8a9dd8ccdc61827ea7290f Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 14 Aug 2024 13:03:54 +0930 Subject: [PATCH 1/5] ci(gitlab): remove all except docs build #15 --- .gitlab-ci.yml | 114 ++++++++++++++++++++++++------------------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9f4a1fb..6d428fd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,11 +1,11 @@ --- variables: - ANSIBLE_GALAXY_PACKAGE_NAME: centurion + # ANSIBLE_GALAXY_PACKAGE_NAME: centurion MY_PROJECT_ID: "59504579" - GIT_SYNC_URL: "https://$GITHUB_USERNAME_ROBOT:$GITHUB_TOKEN_ROBOT@github.com/NoFussComputing/ansible_collection_centurion.git" + # GIT_SYNC_URL: "https://$GITHUB_USERNAME_ROBOT:$GITHUB_TOKEN_ROBOT@github.com/NoFussComputing/ansible_collection_centurion.git" PAGES_ENVIRONMENT_PATH: projects/ansible/collection/centurion/ - RELEASE_ADDITIONAL_ACTIONS_BUMP: ./.gitlab/additional_actions_bump.sh + # RELEASE_ADDITIONAL_ACTIONS_BUMP: ./.gitlab/additional_actions_bump.sh include: @@ -13,79 +13,79 @@ include: ref: development file: - .gitlab-ci_common.yaml - - conventional_commits/.gitlab-ci.yml - - template/ansible-collection.gitlab-ci.yaml + # - conventional_commits/.gitlab-ci.yml + # - template/ansible-collection.gitlab-ci.yaml - template/mkdocs-documentation.gitlab-ci.yaml # ToDo: update gitlabCI jobs for collections workflow - - git_push_mirror/.gitlab-ci.yml + # - git_push_mirror/.gitlab-ci.yml - automation/.gitlab-ci-ansible.yaml -Build Collection: - extends: .ansible_collection_build - needs: - - job: Ansible Lint - optional: true - - job: Ansible Lint (galaxy.yml) - optional: true +# Build Collection: +# extends: .ansible_collection_build +# needs: +# - job: Ansible Lint +# optional: true +# - job: Ansible Lint (galaxy.yml) +# optional: true - rules: +# rules: - - if: $CI_COMMIT_TAG - when: always +# - if: $CI_COMMIT_TAG +# when: always - # Needs to run, even by bot as the test results need to be available - # - if: "$CI_COMMIT_AUTHOR =='nfc_bot '" - # when: never +# # Needs to run, even by bot as the test results need to be available +# # - if: "$CI_COMMIT_AUTHOR =='nfc_bot '" +# # when: never - - if: # Occur on merge - $CI_COMMIT_BRANCH - && - $CI_PIPELINE_SOURCE == "push" - when: always +# - if: # Occur on merge +# $CI_COMMIT_BRANCH +# && +# $CI_PIPELINE_SOURCE == "push" +# when: always - # - if: - # $CI_COMMIT_BRANCH != "development" - # && - # $CI_COMMIT_BRANCH != "master" - # && - # $CI_PIPELINE_SOURCE == "push" - # when: always +# # - if: +# # $CI_COMMIT_BRANCH != "development" +# # && +# # $CI_COMMIT_BRANCH != "master" +# # && +# # $CI_PIPELINE_SOURCE == "push" +# # when: always - - when: never +# - when: never -Update Git Submodules: - extends: .ansible_playbook_git_submodule +# Update Git Submodules: +# extends: .ansible_playbook_git_submodule -Github (Push --mirror): - extends: - - .git_push_mirror - needs: [] +# Github (Push --mirror): +# extends: +# - .git_push_mirror +# needs: [] -Gitlab Release: - extends: .ansible_collection_release - needs: - - Stage Collection - release: - tag_name: $CI_COMMIT_TAG - description: ./artifacts/release_notes.md - name: $CI_COMMIT_TAG - assets: - links: - - name: 'Ansible Galaxy' - url: https://galaxy.ansible.com/ui/repo/published/${ANSIBLE_GALAXY_NAMESPACE}/${ANSIBLE_GALAXY_PACKAGE_NAME}/?version=${CI_COMMIT_TAG} +# Gitlab Release: +# extends: .ansible_collection_release +# needs: +# - Stage Collection +# release: +# tag_name: $CI_COMMIT_TAG +# description: ./artifacts/release_notes.md +# name: $CI_COMMIT_TAG +# assets: +# links: +# - name: 'Ansible Galaxy' +# url: https://galaxy.ansible.com/ui/repo/published/${ANSIBLE_GALAXY_NAMESPACE}/${ANSIBLE_GALAXY_PACKAGE_NAME}/?version=${CI_COMMIT_TAG} - - name: ${ANSIBLE_GALAXY_NAMESPACE}-${ANSIBLE_GALAXY_PACKAGE_NAME}-${CI_COMMIT_TAG}.tar.gz - url: https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/${ANSIBLE_GALAXY_NAMESPACE}-${ANSIBLE_GALAXY_PACKAGE_NAME}-${CI_COMMIT_TAG}.tar.gz - link_type: package +# - name: ${ANSIBLE_GALAXY_NAMESPACE}-${ANSIBLE_GALAXY_PACKAGE_NAME}-${CI_COMMIT_TAG}.tar.gz +# url: https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/${ANSIBLE_GALAXY_NAMESPACE}-${ANSIBLE_GALAXY_PACKAGE_NAME}-${CI_COMMIT_TAG}.tar.gz +# link_type: package - - name: Documentation - url: https://nofusscomputing.com/${PAGES_ENVIRONMENT_PATH} - milestones: - - $CI_MERGE_REQUEST_MILESTONE +# - name: Documentation +# url: https://nofusscomputing.com/${PAGES_ENVIRONMENT_PATH} +# milestones: +# - $CI_MERGE_REQUEST_MILESTONE Website.Submodule.Deploy: From b343e246730d1fa88ce4359af0d475370d9b5090 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 14 Aug 2024 13:07:28 +0930 Subject: [PATCH 2/5] ci(triage): add project triage #15 #16 --- .github/workflows/triage.yaml | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/triage.yaml diff --git a/.github/workflows/triage.yaml b/.github/workflows/triage.yaml new file mode 100644 index 0000000..1896dee --- /dev/null +++ b/.github/workflows/triage.yaml @@ -0,0 +1,37 @@ + +--- + +name: Triage + + +on: + issues: + types: + - opened + - reopened + - transferred + - milestoned + - demilestoned + - closed + - assigned + pull_request: + types: + - opened + - edited + - assigned + - reopened + - closed + + + +jobs: + + + project: + name: Project + uses: nofusscomputing/action_project/.github/workflows/project.yaml@development + with: + PROJECT_URL: https://github.com/orgs/nofusscomputing/projects/3 + secrets: + WORKFLOW_TOKEN: ${{ secrets.WORKFLOW_TOKEN }} + From 17ce8e45812527afe3160b71d1f6d8c7a1a514e7 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 14 Aug 2024 13:09:17 +0930 Subject: [PATCH 3/5] ci: add sync to gitlab #15 #16 --- .github/workflows/ci.yaml | 73 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..a470d9e --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,73 @@ +--- + +name: 'CI' + + +on: + push: + branches: + - '**' + tags: + - '*' + +env: + GIT_SYNC_URL: "https://${{ secrets.GITLAB_USERNAME_ROBOT }}:${{ secrets.GITLAB_TOKEN_ROBOT }}@gitlab.com/nofusscomputing/projects/ansible/collections/centurion_erp_collection.git" + +jobs: + + + gitlab-mirror: + if: ${{ github.repository == 'nofusscomputing/centurion_erp' }} + runs-on: ubuntu-latest + steps: + + + - name: Checks + shell: bash + run: | + if [ "0${{ env.GIT_SYNC_URL }}" == "0" ]; then + + echo "[ERROR] you must define variable GIT_SYNC_URL for mirroring this repository."; + + exit 1; + + fi + + + - name: clone + shell: bash + run: | + + git clone --mirror https://github.com/${{ github.repository }} repo; + + ls -la repo/ + + + - name: add remote + shell: bash + run: | + + cd repo; + + echo "**************************************** - git remote -v"; + + git remote -v; + + echo "****************************************"; + + git remote add destination $GIT_SYNC_URL; + + + - name: push branches + shell: bash + run: | + + cd repo; + + echo "**************************************** - git branch"; + + git branch; + + echo "****************************************"; + + git push destination --mirror || true; From fcaa51e3b2554b3fdba3d4953d573acd940070f4 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 14 Aug 2024 13:09:36 +0930 Subject: [PATCH 4/5] ci(PR): add PR checks #15 #16 --- .github/workflows/pull-requests.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/pull-requests.yaml diff --git a/.github/workflows/pull-requests.yaml b/.github/workflows/pull-requests.yaml new file mode 100644 index 0000000..c7d0922 --- /dev/null +++ b/.github/workflows/pull-requests.yaml @@ -0,0 +1,14 @@ +--- + +name: Pull Requests + + +on: + pull_request: {} + + +jobs: + + pull-request: + name: pull-request + uses: nofusscomputing/action_pull_requests/.github/workflows/pull-requests.yaml@development From be2cd957fb5b3e9f2c63c4b4c6c263a7d42580d2 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 14 Aug 2024 13:11:13 +0930 Subject: [PATCH 5/5] ci: correct git sync check . #15 #16 --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a470d9e..b6526c5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,7 +17,7 @@ jobs: gitlab-mirror: - if: ${{ github.repository == 'nofusscomputing/centurion_erp' }} + if: ${{ github.repository == 'nofusscomputing/ansible_collection_centurion' }} runs-on: ubuntu-latest steps: