Skip to content

Commit

Permalink
use mutex to synchronize tasks
Browse files Browse the repository at this point in the history
i.e.,to make sure only one update-decapod-manifest task can run at a time
  • Loading branch information
robertchoi80 committed Sep 15, 2021
1 parent 4156669 commit c0aabde
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ metadata:
spec:
templates:
- name: updateManifest
synchronization:
mutex:
name: default
inputs:
parameters:
- name: action
Expand All @@ -22,15 +25,11 @@ spec:
- name: kv_map_str
value: ""
script:
image: centos/python-38-centos7
image: sktdev/python-centos-wf-worker:v1.0
command: ["python"]
env:
source: |
import subprocess
import sys
# TODO: bake custom image that includes these packages
subprocess.check_call([sys.executable, "-m", "pip", "install", "GitPython", "ruamel.yaml"])
import argparse
import git
import ruamel.yaml
Expand Down Expand Up @@ -62,6 +61,8 @@ spec:
git_config.set_value('user', 'email', '[email protected]')
git_config.set_value('user', 'name', 'TKS Argo')
else:
print("The repo already exists. Pulling latest updates..")
repo = git.Repo(sitePath)
repo.remotes.origin.pull()
Expand Down

0 comments on commit c0aabde

Please sign in to comment.