add support for task environment var
This commit is contained in:
@@ -1,27 +0,0 @@
|
|||||||
name: Deploy All Containers
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
name: Prepare
|
|
||||||
runs-on: ansible
|
|
||||||
steps:
|
|
||||||
- name: Checkout Repo
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Deploy
|
|
||||||
shell: sh
|
|
||||||
run: |
|
|
||||||
mkdir -p ~/.ssh
|
|
||||||
echo "${{ secrets.SSH_KNOWN_HOSTS }}" >> ~/.ssh/known_hosts
|
|
||||||
chmod 644 ~/.ssh/known_hosts
|
|
||||||
eval $(ssh-agent -s)
|
|
||||||
ssh-add <(echo "${{ secrets.SSH_KEY }}")
|
|
||||||
echo "HOST *" > ~/.ssh/config
|
|
||||||
echo "${{ secrets.VAULT_PASS }}" > ~/.vault_pass.txt
|
|
||||||
chmod 600 ansible.cfg
|
|
||||||
/usr/bin/ansible-playbook main.yml -l jackson --vault-password-file ~/.vault_pass.txt
|
|
||||||
@@ -9,6 +9,11 @@ on:
|
|||||||
- "roles/**"
|
- "roles/**"
|
||||||
- "templates/**"
|
- "templates/**"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
task:
|
||||||
|
description: Task to deploy
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
@@ -21,6 +26,8 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
|
env:
|
||||||
|
TASK: ${{ inputs.task }}
|
||||||
shell: sh
|
shell: sh
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
|
|||||||
@@ -40,10 +40,15 @@ def get_normalized_task_name(container):
|
|||||||
|
|
||||||
return task_name
|
return task_name
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
dir_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../')
|
dir_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../')
|
||||||
diff = git_diff()
|
|
||||||
|
print("Task environment variable: " + os.environ.get("TASK"))
|
||||||
|
if os.environ.get("TASK"):
|
||||||
|
diff = [os.environ.get("TASK")]
|
||||||
|
else:
|
||||||
|
diff = git_diff()
|
||||||
|
|
||||||
deployable_containers = []
|
deployable_containers = []
|
||||||
removable_containers = []
|
removable_containers = []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user