Allow any published dagger version to be installed via install.sh

This also updates Getting Started - CI/CD in your local dev - Linux & Mac doc.
A few other related doc changes were pulled in by this.

I wanted to try different versions of dagger on Linux, and this was the
easiest way of doing that:

    curl -L https://dl.dagger.io/dagger/install.sh -O
    # make this change, and then:

    DAGGER_VERSION=0.2.0 sh install.sh
    # ...
    ./bin/dagger version
    dagger 0.2.0 (e499297e) linux/amd64

    DAGGER_VERSION=0.2.1 sh install.sh
    # ...
    ./bin/dagger version
    dagger 0.2.1 (69b4845d) linux/amd64

This change enables anyone to do the following instead:

    curl -L https://dl.dagger.io/dagger/install.sh \
    | DAGGER_VERSION=0.2.0 sh

Until this gets merged, you can test how this change works in practice
via this temporary file:

    curl -L https://dl.dagger.io/dagger/install-pr-1819.sh \
    | DAGGER_VERSION=0.2.0 sh

One thing which I was not sure about is how the file from this
repository ends up on https://dl.dagger.io/dagger/install.sh. I think
this is a manual process today, but I need to confirm this assumption.

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
This commit is contained in:
Gerhard Lazu
2022-03-17 19:45:26 +00:00
parent c4104626c3
commit 6db19fcea2
4 changed files with 47 additions and 31 deletions

View File

@@ -267,7 +267,7 @@ latest_version() {
base_url() {
os="$(uname_os)"
arch="$(uname_arch)"
version="$(latest_version)"
version="${DAGGER_VERSION?:$(latest_version)}"
url="${base}/${name}/releases/${version}"
echo "$url"
}
@@ -275,7 +275,7 @@ base_url() {
tarball() {
os="$(uname_os)"
arch="$(uname_arch)"
version="$(latest_version)"
version="${DAGGER_VERSION?:$(latest_version)}"
name="${name}_v${version}_${os}_${arch}"
if [ "$os" = "windows" ]; then
name="${name}.zip"