chore: parse branch service dir name for cicd
Deploy bin / deploy (push) Successful in 5s
Deploy, build and restart MASTER / deploy (push) Successful in 4s
Deploy agebd python package / deploy (push) Successful in 4s

This commit is contained in:
Benjamin Labrecque
2026-07-07 16:17:24 +02:00
parent 694c809879
commit 33b07b47de
3 changed files with 17 additions and 3 deletions
+12 -1
View File
@@ -14,6 +14,17 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Parse Service Directory Name
id: parse_branch
# Uses bash shell parameter elimination to strip 'feature/add-service-' from the front
run: |
BRANCH="${{ github.ref_name }}"
SERVICE_NAME="${BRANCH#feature/add-service-}"
echo "service_name=$SERVICE_NAME" >> $GITHUB_OUTPUT
- name: Run New Service Playbook
run: |
ansible-playbook ansible/playbooks/add-new-service.yml -i ansible/hosts.yml --extra-vars="repo_root=${{ github.workspace }} agebd_env=dev" -v
ansible-playbook ansible/playbooks/add-new-service.yml \
-i ansible/hosts.yml \
--extra-vars="repo_root=${{ github.workspace }} agebd_env=dev service_dir_name=${{ steps.parse_branch.outputs.service_name }}" \
-v
+4 -1
View File
@@ -5,4 +5,7 @@
import_playbook: ../plays/ioc/ioc-install-and-restart-master.yml
- name: Deploy and Restart Master Service
import_playbook: ../plays/service/service-deploy-and-restart-master.yml
import_playbook: ../plays/service/service-deploy-and-restart-master.yml
- name: Install and Restart New IOC
import_playbook: ../plays/ioc/ioc-install-and-restart.yml
+1 -1
View File
@@ -53,7 +53,7 @@ class ServiceCreator:
hla_names = MasterHLANames.read_from_config()
hla_names.add_hla_name(service.name_upper)
branch_name = f"feature/add-service-{service.name_lower}"
branch_name = f"feature/add-service-{service.dir_name}"
delete_local_branch(repo, branch_name)
switch_branch(repo, branch_name)