Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add install script for 'curl | bash' style installation #33

Merged
merged 3 commits into from
Jun 7, 2018

Conversation

codyaray
Copy link
Member

@codyaray codyaray commented Jun 7, 2018

@confluentinc/caas

We can also support OS-agnostic curl some.url | bash style installs for the CLI. It downloads the tarball to a temp directory, verifies the checksums, and then installs in ./bin by default.

This works today, assuming you have api.github.com in your ~/.netrc since our CLI is private.

curl -ns https://api.github.com/repos/confluentinc/cli/contents/install.sh?ref=master -H Accept:application/vnd.github.raw | bash

(Note: change ref=master to ref=curl-bash until this is merged.)

You can install somewhere other than ./bin, for example in /usr/local/bin:

curl -ns https://api.github.com/repos/confluentinc/cli/contents/install.sh?ref=master -H Accept:application/vnd.github.raw | sudo bash -s -- -b /usr/local/bin

Once our CLI is public, then we can shorten this down to

curl -s https://raw.githubusercontent.com/confluentinc/cli/master/install.sh | bash

Which of course means we can use a short link:

curl -s https://git.io/confluent-cli | bash

using something like this: https://blog.github.com/2011-11-10-git-io-github-url-shortener/

Since our cli repo is still private, I had to use a forked godownloader.
PR to merge back upstream: goreleaser/godownloader#78.

./godownloader --repo confluentinc/cli > install.sh 

Since our cli repo is still private, I had to use a forked `godownloader`.
PR to merge back upstream: goreleaser/godownloader#78
@codyaray codyaray requested a review from a team June 7, 2018 08:10
Copy link

@chicagobuss chicagobuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice

@codyaray codyaray merged commit 8d7acf2 into master Jun 7, 2018
@codyaray codyaray deleted the curl-bash branch June 7, 2018 16:45
@codyaray
Copy link
Member Author

codyaray commented Jun 7, 2018

@cyrusv You can now install with this:

curl -sL https://git.io/vhuDX | bash

It'll install in ./bin. You'll still have to make sure that ./bin is added to your $PATH.

You can also install directly to /usr/local/bin by running:

curl -sL https://git.io/vhuDX | sudo bash -s -- -b /usr/local/bin

We can create a nicer short link later when we the repo is open sourced. (A lot of link shorteners, including git.io, don't allow you to the change the underlying URL later. So don't mess it up.)

For this to work, you'll need to setup your ~/.netrc with

machine api.github.com
        login yourusername
        password yourpasswordorpersonalaccesstoken

where the personal access token has the repo permission.

brianstrauch pushed a commit that referenced this pull request May 31, 2023
* chore: reset mk-include

* Squashed 'mk-include/' content from commit 6efb578

git-subtree-dir: mk-include
git-subtree-split: 6efb578afa317a543abb2b85c0bd5a73c52fadce

* chore: add mk-include-git-hash

---------

Co-authored-by: Confluent Jenkins Bot <jenkins@confluent.io>
airlock-confluentinc bot pushed a commit that referenced this pull request Sep 4, 2024
[FRT-521] Integrate Confluent CLI with new Flink Artifact API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants