-
I have a task that clones a list of repos: version: "3"
vars:
REPOS:
- name: repo1
branch: "main"
- name: repo2
branch: "main"
TMP_DIR: /var/tmp
tasks:
reusable-checkout-repo:
desc: "Reusable task to clone a repo"
internal: true
label: "checkout-{{.REPO_NAME}}"
dir: "{{.TMP_DIR}}"
status:
- test -d {{.REPO_NAME}}
cmds:
- echo "Cloning {{.REPO_NAME}} into {{.TMP_DIR}}"
- git clone https://github.com/org/{{.REPO_NAME}}.git --depth 1 --branch {{.REPO_BRANCH}}
checkout-repos:
desc: "Checkout dev-deps and devops-config repos"
dir: "{{.TMP_DIR}}"
cmds:
- for: { var: REPOS, as: REPO }
task: reusable-checkout-repo
vars: { REPO_NAME: "{{.REPO.name}}", REPO_BRANCH: "{{.REPO.branch}}" } The For example, If I could run |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
There's See the CLI Reference |
Beta Was this translation helpful? Give feedback.
-
@dbeilin There's also |
Beta Was this translation helpful? Give feedback.
There's
--force
for exactly this 🙂See the CLI Reference