https://infracost.io logo
#help
Title
# help
p

polite-engineer-31217

01/27/2023, 8:06 PM
Hi there, looking at the install script it looks like we can’t install any version from it. I would expect this script https://raw.githubusercontent.com/infracost/infracost/v0.10.16/scripts/install.sh to install v0.10.16 instead of latest
url="<https://infracost.io/downloads/latest>"
I know there are some docker images prebuilt where I could directly get the correct binary depending of the arch but downloading the tar would avoid downloading a full image. Any thoughts ?
c

crooked-daybreak-55253

01/27/2023, 8:18 PM
Hi, yeah I guess that is a bit confusing because we don’t modify the install script with the version so it’s always pointed to the latest. The binaries for each release are available as release assets so if you look at the release page for 0.10.16 in the assests section you’ll see the binaries for each arch/platform, e.g. https://github.com/infracost/infracost/releases/download/v0.10.16/infracost-linux-amd64.tar.gz
We also have some redirect links set up so you can point to v0.10.*, let me find those
p

polite-engineer-31217

01/27/2023, 8:19 PM
Yes, that’s what I did before the multi arch, but the installer is very convenient to avoid this kind of logic in Dockerfile
Copy code
RUN set -eux; \
    case "${TARGETPLATFORM}" in \
      linux/amd64)  \
        AWSCLI='awscli-exe-linux-x86_64.zip'  \
        ARCH="amd64"  \
      ;; \
      linux/arm64|linux/arm/v8)  \
        AWSCLI='awscli-exe-linux-aarch64.zip'  \
        ARCH="arm64"  \
      ;; \
	esac;\
curl -L "<https://github.com/infracost/infracost/releases/download/v${INFRACOST}/infracost-linux-${ARCH}.tar.gz>" | tar -zx -C /usr/local/bin/
What do you think about simply adding a
"VERSION=${VERSION:-latest}"
The script will keep download the latest but it will also accept to override this version
VERSION=v0.1.2 curl ...
c

crooked-daybreak-55253

01/27/2023, 8:26 PM
yeah that makes sense if we let you provide the version as an env or a flag. (probably would want to call the env
INFRACOST_VERSION
to avoid collisions)
p

polite-engineer-31217

01/27/2023, 8:28 PM
not sure you can pass a flag when you pipe the download to sh ?
INFRACOST_VERSION
LGTM
do you want me to make a PR for that ?
c

crooked-daybreak-55253

01/27/2023, 8:29 PM
yeah that would be great
you can sign me up for the review (@tim775) whenever it’s ready
p

polite-engineer-31217

01/27/2023, 8:37 PM
I’m not allowed to add reviewers but here is the PR https://github.com/infracost/infracost/pull/2251
c

crooked-daybreak-55253

01/30/2023, 3:32 PM
This is merged to master if you want to try it out
p

polite-engineer-31217

01/30/2023, 3:33 PM
I got the notification, thank you