now the trigger job passes the name of the repo, which should match the module name. this then updates that submodule only. !41 nofusscomputing/projects/ansible/git_configuration#16 nofusscomputing/projects/ansible/git_configuration!60
76 lines
2.0 KiB
YAML
76 lines
2.0 KiB
YAML
---
|
|
# 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:
|
|
- 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 == "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
|
|
|
|
|
|
.submodule_update_trigger:
|
|
stage: publish
|
|
trigger:
|
|
project: $SUBMODULE_UPDATE_TRIGGER_PROJECT
|
|
branch: development
|
|
forward:
|
|
yaml_variables: false
|
|
variables:
|
|
PIPELINE_RUN_TRIGGER: 'true'
|
|
GIT_CONFIG_SUBMODULE_NAME: $CI_PROJECT_NAME
|
|
rules:
|
|
- if: $CI_COMMIT_TAG
|
|
when: never
|
|
|
|
- if: # condition_master_or_dev_push
|
|
(
|
|
$CI_COMMIT_BRANCH == "master" ||
|
|
$CI_COMMIT_BRANCH == "development"
|
|
)&&
|
|
$CI_PIPELINE_SOURCE == "push"
|
|
when: on_success
|
|
|
|
- when: never |