-
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.
Answered by
mgbowman
Sep 26, 2024
Replies: 2 comments 1 reply
-
There's See the CLI Reference |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
dbeilin
-
@dbeilin There's also |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's
--force
for exactly this 🙂See the CLI Reference