Skip to content

Conversation

javirln
Copy link
Member

@javirln javirln commented Apr 7, 2025

This patch updates the install.sh script to support both legacy and modern GitHub release formats for the Chainloop CLI.

In newer releases (starting from version v1.0.0-rc.3), the CLI is distributed as a plain binary without a version in the filename and without a .tar.gz archive. The script now detects whether a given release is legacy or modern and downloads the appropriate artifact accordingly—either the .tar.gz archive for older versions or the standalone binary for newer ones.

For modern releases, the latest version can be downloaded using the following URL:

https://github.com/chainloop-dev/chainloop/releases/latest/download/chainloop-OS-ARCH

Please note that legacy and modern GitHub releases referrers to the way Chainloop pushes artifacts to GitHub's releases.

Examples:

Regular installation (legacy)

$ /usr/bin/env bash docs/static/install.sh                   
Step 1: Downloading: chainloop-cli-1.0.0-rc.3-darwin-arm64.tar.gz
Done...

Step 1.2: Verifying checksum
chainloop-cli-1.0.0-rc.3-darwin-arm64.tar.gz: OK
Checksum OK

Step 1.3: Verifying signature
Verified OK
Step 2: Decompressing: /var/folders/ct/h8h0pjcd6q180cnxqhykjv3c0000gn/T/tmp.1yk9hixiAU/chainloop-cli-1.0.0-rc.3-darwin-arm64.tar.gz
Done...

Step 3: Installing: chainloop in path /usr/local/bin
Password:
Step 4: Cleanup
Done...

Client Version: 1.0.0-rc.3
Server Version: 1.0.0-rc.3
Check here for the next steps: https://docs.chainloop.dev

Run 'chainloop auth login' to get started

New installations (being force by modifying the code since there are not new releases yet):

$ /usr/bin/env bash docs/static/install.sh
Step 1: Downloading: chainloop-darwin-arm64, Version: 1.0.0-rc.3
Done...

Step 1.2: Verifying checksum
chainloop-darwin-arm64: OK
Checksum OK

Step 1.3: Verifying signature
Verified OK
Step 2: Installing: chainloop to /usr/local/bin
Step 3: Cleanup
Done...

Client Version: 1.0.0-rc.3
Server Version: 1.0.0-rc.3
Check here for the next steps: https://docs.chainloop.dev

Run 'chainloop auth login' to get started

Forcing a specific version of the CLI:

Legacy

$ /usr/bin/env bash docs/static/install.sh --version v1.0.0-rc.3
Step 1: Downloading: chainloop-cli-1.0.0-rc.3-darwin-arm64.tar.gz
Done...

Step 1.2: Verifying checksum
chainloop-cli-1.0.0-rc.3-darwin-arm64.tar.gz: OK
Checksum OK

Step 1.3: Verifying signature
Verified OK
Step 2: Decompressing: /var/folders/ct/h8h0pjcd6q180cnxqhykjv3c0000gn/T/tmp.QXyJjjSWac/chainloop-cli-1.0.0-rc.3-darwin-arm64.tar.gz
Done...

Step 3: Installing: chainloop in path /usr/local/bin
Step 4: Cleanup
Done...

Client Version: 1.0.0-rc.3
Server Version: 1.0.0-rc.3
Check here for the next steps: https://docs.chainloop.dev

Run 'chainloop auth login' to get started

New installations (being force by modifying the code since there are not new releases yet) forcing a version:

$ /usr/bin/env bash docs/static/install.sh --version v1.0.0-rc.3
Step 1: Downloading: chainloop-darwin-arm64, Version: 1.0.0-rc.3
Done...

Step 1.2: Verifying checksum
chainloop-darwin-arm64: OK
Checksum OK

Step 1.3: Verifying signature
Verified OK
Step 2: Installing: chainloop to /usr/local/bin
Step 3: Cleanup
Done...

Client Version: 1.0.0-rc.3
Server Version: 1.0.0-rc.3
Check here for the next steps: https://docs.chainloop.dev

Run 'chainloop auth login' to get started

javirln added 2 commits April 7, 2025 16:37
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
@javirln javirln requested review from migmartri and jiparis April 7, 2025 14:55
@javirln javirln self-assigned this Apr 7, 2025
@javirln javirln changed the title chore(install): Modify install.sh to support new GitHub release chore(install): Modify install.sh to support new GitHub release artifacts Apr 7, 2025
@migmartri
Copy link
Member

In those examples I can't see testing loading an old version, for example

/usr/bin/env bash docs/static/install.sh --version v0.186.0

Does it work?

VERSION=""
FORCE_VERIFICATION=false
INSTALL_PATH=/usr/local/bin
PUBLIC_KEY_URL="https://raw.githubusercontent.com/chainloop-dev/chainloop/01ad13af08950b7bfbc83569bea207aeb4e1a285/docs/static/cosign-releases.pub"
Copy link
Member

Choose a reason for hiding this comment

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

out of curiosity, are we still signing the binaries with a private key? I thought we moved to fulcio?

Copy link
Member Author

@javirln javirln Apr 8, 2025

Choose a reason for hiding this comment

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

Yes, we are still signing all the output of goreleaser with a private key, see here:

COSIGN_KEY: ${{ secrets.COSIGN_KEY }}

I thought we moved to fulcio?

About the fulcio thingy, I cannot comment, I really don't know about it.

Copy link
Member

Choose a reason for hiding this comment

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

It would be good to create an issue about it

@javirln
Copy link
Member Author

javirln commented Apr 8, 2025

In those examples I can't see testing loading an old version, for example

/usr/bin/env bash docs/static/install.sh --version v0.186.0

Does it work?

Yes sure, here's a few examples:

$ /usr/bin/env bash docs/static/install.sh --version v0.186.0
Step 1: Downloading: chainloop-cli-0.186.0-darwin-arm64.tar.gz
Done...

Step 1.2: Verifying checksum
chainloop-cli-0.186.0-darwin-arm64.tar.gz: OK
Checksum OK

Step 1.3: Verifying signature
Verified OK
Step 2: Decompressing: /var/folders/ct/h8h0pjcd6q180cnxqhykjv3c0000gn/T/tmp.pIQBy3IORv/chainloop-cli-0.186.0-darwin-arm64.tar.gz
Done...

Step 3: Installing: chainloop in path /usr/local/bin
Password:
Step 4: Cleanup
Done...

Client Version: 0.186.0
Server Version: 1.0.0-rc.3
Check here for the next steps: https://docs.chainloop.dev

Run 'chainloop auth login' to get started

And with a way older version:

$ /usr/bin/env bash docs/static/install.sh --version v0.30.0 
Step 1: Downloading: chainloop-cli-0.30.0-darwin-arm64.tar.gz
Done...

Step 1.2: Verifying checksum
chainloop-cli-0.30.0-darwin-arm64.tar.gz: OK
Checksum OK

Step 1.3: Verifying signature
Verified OK
Step 2: Decompressing: /var/folders/ct/h8h0pjcd6q180cnxqhykjv3c0000gn/T/tmp.HbpYRKguo3/chainloop-cli-0.30.0-darwin-arm64.tar.gz
Done...

Step 3: Installing: chainloop in path /usr/local/bin
Step 4: Cleanup
Done...

chainloop version 0.30.0
Check here for the next steps: https://docs.chainloop.dev

Run 'chainloop auth login' to get started

Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
@javirln javirln merged commit f2a0504 into chainloop-dev:main Apr 8, 2025
14 checks passed
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.

3 participants