opentofu / get.opentofu.org

The website hosting the OpenTofu Installer script and installation resources
Apache License 2.0
3 stars 8 forks source link

Provide latest OpenTofu release via ./install-opentofu.sh --install-method apk #26

Closed ppuschmann closed 1 month ago

ppuschmann commented 1 month ago

OpenTofu Version

1.6.2-r2

Use Cases

Installing OpenToFu in Container-Images, e.g. for automation with GitLab or GitHub Actions

Attempted Solutions

The standalone installer allows to use some parameter --opentofu-version "${OPENTOFU_VERSION}" to install the OpenToFu version defined in ${OPENTOFU_VERSION}.

./install-opentofu.sh --install-method apk --opentofu-version "${OPENTOFU_VERSION}"

The installer using the install-method apk does not support this version argument.

./install-opentofu.sh --install-method apk

The parameter --opentofu-version "${OPENTOFU_VERSION}" is ignored.

Additionally the apk-installer installs version 1.6.2-r2 whereas the standalone-installer installs 1.7.1 or OpenToFu.

Proposal

Please support the argument --opentofu-version "${OPENTOFU_VERSION}" for the apk-installer and provide all release-versions via the apk-installer.

References

No response

janosdebugs commented 1 month ago

Hi @ppuschmann thank you for this issue. I believe, the issue is located in install-opentofu.sh, which still references the testing repo. Alpine has moved OpenTofu to the community repo. Could you please test if changing this URL to the community repo helps?

ppuschmann commented 1 month ago

@janosdebugs correct, there is still the testing repo configured in the apk-installer.

My override was:

./install-opentofu.sh --install-method apk --apk-package opentofu --apk-repo http://dl-cdn.alpinelinux.org/alpine/edge/community

and I got version 1.7.1.

janosdebugs commented 1 month ago

Awesome, thank you for the feedback @ppuschmann !

ppuschmann commented 1 month ago

Taking a closer look:

OpenTofu Installer

Installing OpenTofu using APK...
fetch http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/community/x86_64/APKINDEX.tar.gz
(1/1) Installing opentofu (1.7.1-r1)
Executing busybox-1.36.1-r15.trigger
OK: 236 MiB in 59 packages
OpenTofu v1.7.1

There's still some r1 in opentofu (1.7.1-r1), but tofu --version tells 1.7.1 :-)

janosdebugs commented 1 month ago

-r1 is the Alpine-specific suffix as far as I know. :)