Adding mini CLI script for cloning repos#40
Conversation
- Not finding a similar tool and tired already of forgetting to do my `pre-commit install` step when cloning a repo, > - It's in a repo so it can be maintained, moved around, etc. - When I asked in Slack #general if such a tool existed, I found out it didn't and it was suggested (thanks @tumido f> - IIUC, my patch to the Dockerfile should pull in v0.1 of this bash script, drop it where it's in the user's $PATH, and makes sure the file is executable - Patches to this patch, and to the upstream script, are very welcome - Also, suggestions on what I can do better in v0.2 are welcome; my bash skills are basic and rusty, happy for any help and tips - My concept here is that we may want to have a handful of individual tools, and then be able call them by `o1 toolname OPTIONS ARGUMENT TARGET`-sort of thing, as a way to ease the life of contributors, and help keep our work net and tidy. :) Signed-of by: Karsten Wade <[email protected]> <[email protected]>
- I'm new at this Dockerfile thing, and I realized when viewing the PR online what I had missed. - Live and learn :) Signed-off by: Karsten Wade <[email protected]> <[email protected]>
|
@quaid hm.. I'm thinking.. is there a reason to keep that script in a separate repository? What about we include it here directly into the |
|
/retest |
As a concept, I would prefer this script in the upstream project, yes. I can then switch development to a fork of this repo, which sounds easier in the long run. 😁 Would we instead point the (This path hadn't occurred to me because I didn't see our own |
I think we're saying the same thing—I'm referring to /operate-first/toolbox as the upstream project. My repo was just a way to get things started. Now that I know about it, I'd be just as happy if we extended |
- I'm contributing this small script to the project, which was my intention from the start but I wasn't sure where to make the pull request against, or where to take the idea to discuss it! - As per the discussion in the PR[1] I am moving the script here. - I am unclear if this is the correct way to have that script deployed into the user's $PATH and made executable? - If the patch is accepted, I guess the answer is yes! Signed-off by: Karsten Wade <[email protected]> <[email protected]>
OK @HumairAK let me know if I have this correct, thanks! |
| curl -o /usr/local/bin/o1-clone https://github.com/operate-first/toolbox/blob/master/scripts/o1-clone && \ | ||
| chmod +x /usr/local/bin/o1-clone | ||
|
|
||
| COPY scripts/* /usr/local/bin/ |
There was a problem hiding this comment.
@quaid by adding it to the scripts folder, this line will auto consume your script, so you don't need to add any changes to the Dockerfile for this PR. So you can remove the curl/chmod commands you have added.
There was a problem hiding this comment.
Ha! Yes, indeed, it's right there. I'll blame my lack of familiarity with Dockerfiles for missing the obvious., :)
If the new script is in the `scripts` folder, it is already being copied into `/usr/local/bin`.
Dockerfile
Outdated
| version.helm_secrets="${HELM_SECRETS_VERSION}" \ | ||
| version.ksops="${KSOPS_VERSION}" \ | ||
| version.sops="${SOPS_VERSION}" | ||
| version.sops="${SOPS_VERSION}" \ |
There was a problem hiding this comment.
can you remove this new slash \
There was a problem hiding this comment.
Finger slip I'm sure :) fixed
This seems to be a problem with the testing, where shall I open an issue? The problem is, I used the text editor in the browser to remove the The only way I see around this is forcing the merge, which doesn't seem like the behavior we want. Can @sesheta test for when the commit happens via the browser and skip the unnecessary tests? |
Dockerfile
Outdated
| curl -o /usr/local/bin/yq -L https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64 && \ | ||
| chmod +x /usr/local/bin/yq | ||
|
|
||
There was a problem hiding this comment.
last change -- can you remove the whitespace here, as this is failing the pre-commit check.
There was a problem hiding this comment.
OK, I think I got this, and I appreciate the connection—pre-commit legitimately failed, now I know to look further when that happens here.
/retest
ok, now it should clear pre-commit check
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: HumairAK The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
pre-commit installstep when cloning a repo, >o1 toolname OPTIONS ARGUMENT TARGET-sort of thing, as a way to ease the life of contributors, and help keep our work net and tidy. :)Signed-of by: Karsten Wade [email protected] [email protected]
Related Issues and Dependencies
None
This introduces a breaking change
(It shouldn't! but I didn't test the Dockerfile)
This Pull Request implements
Adding a mini CLI tool for more easily cloning Operate First project repositories, then setting up the proper environment for the newly cloned repo.
Currently, it takes a repo name, clones it, and runs
pre-commit installto install pre-commit hooks.o1-clone REPONAMEThis script can be extended for any common newly cloned repo actions
Description
Adding the variable, Dockerfile description element, and call to download and include the specified version of the tool (https://github.com/quaid/o1-tools/releases/tag/v0.1) in the resulting Toolbox build.