fossa-cli icon indicating copy to clipboard operation
fossa-cli copied to clipboard

Download tar.gz when installing on Linux

Open rolodato opened this issue 3 years ago • 0 comments

Overview

Changes the install script to download tar.gz archives instead of zip when running on Linux. See https://github.com/fossas/fossa-cli/pull/1066 for more context.

Acceptance criteria

Running install-latest.sh successfully downloads and extracts the CLI binary from a tarball instead of a zip file when running on Linux.

Testing plan

Manually ran ./install-latest.sh -d and confirmed that it works on Linux:

$ ./install-latest.sh -d
fossas/fossa-cli info checking GitHub for latest tag
fossas/fossa-cli debug http_download https://github.com/fossas/fossa-cli/releases/latest
fossas/fossa-cli info found fossa-cli 3.4.7 binary for linux/amd64 at https://github.com/fossas/fossa-cli/releases/download/v3.4.7/fossa_3.4.7_linux_amd64.tar.gz
fossas/fossa-cli info
fossas/fossa-cli info ------
fossas/fossa-cli info Notice
fossas/fossa-cli info ------
fossas/fossa-cli info
fossas/fossa-cli info FOSSA collects warnings, errors, and usage data to improve
fossas/fossa-cli info the FOSSA CLI and your experience.
fossas/fossa-cli info
fossas/fossa-cli info Read more: https://github.com/fossas/fossa-cli/blob/master/docs/telemetry.md
fossas/fossa-cli info
fossas/fossa-cli info If you want to prevent any telemetry data from being sent to
fossas/fossa-cli info the server, you can opt out of telemetry by setting
fossas/fossa-cli info FOSSA_TELEMETRY_SCOPE environment variable to 'off' in your shell.
fossas/fossa-cli info
fossas/fossa-cli info For example:
fossas/fossa-cli info    FOSSA_TELEMETRY_SCOPE=off fossa analyze
fossas/fossa-cli info
fossas/fossa-cli info
fossas/fossa-cli debug downloading files into /tmp/tmp.4Tu40wXnhu
fossas/fossa-cli debug http_download https://github.com/fossas/fossa-cli/releases/download/v3.4.7/fossa_3.4.7_linux_amd64.tar.gz
fossas/fossa-cli debug setting up bindir: /usr/local/bin
fossas/fossa-cli debug installing binary: fossa
[sudo] password for rolodato:
fossas/fossa-cli info installed /usr/local/bin/fossa
$ /usr/local/bin/fossa --version
fossa-cli version 3.4.7 (revision 7949e2a9c1e5 compiled with ghc-9.0)

Risks

As soon as this commit lands on master, all Linux users will be immediately be using this code. It's a simple change but the potential impact is large. We will notice any problems immediately and are ready to revert if anything breaks. We already have a CI step that tests the install script so this is unlikely to go unnoticed.

References

N/A

Checklist

  • [x] I added tests for this PR's change (or explained in the PR description why tests don't make sense).
  • [ ] ~If this PR introduced a user-visible change, I added documentation into docs/.~
  • [ ] ~If this change is externally visible, I updated Changelog.md. If this PR did not mark a release, I added my changes into an # Unreleased section at the top.~
  • [ ] ~If I made changes to .fossa.yml or fossa-deps.{json.yml}, I updated docs/references/files/*.schema.json. You may also need to update these if you have added/removed new dependency type (e.g. pip) or analysis target type (e.g. poetry).~

rolodato avatar Oct 06 '22 22:10 rolodato