Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add v1.6.2 opentofu binary to container #4341

Merged
merged 1 commit into from
Mar 23, 2024
Merged

feat: add v1.6.2 opentofu binary to container #4341

merged 1 commit into from
Mar 23, 2024

Conversation

nitrocode
Copy link
Member

@nitrocode nitrocode commented Mar 12, 2024

what

  • add opentofu binary to container
  • reuse code for both opentofu and hashi
  • shellcheck on scripts/download-release.sh
  • hadolint on Dockerfile

why

  • Add the opentofu binary so it's available to users who customize their workflows
  • I kept the COMMAND_DIR for backwards compatibility but I don't think we should store a directory of terraform versions in here because using tf instead of terraform and opentofu instead of tofu is inconsistent. It's also necessary or there will be softlink conflicts. I'd prefer to store the binaries in a separate directory so we can keep the dir names consistent with the binaries.
  • The reason tofu is used instead of opentofu is because tofu is their official binary name

tests

  • I have tested my changes by running the following commands
✗ shellcheck scripts/download-release.sh
✗
✗ hadolint Dockerfile
✗
✗ docker build -t atlantis-test:latest -f ./Dockerfile .
 => exporting to image                                                                                                1.1s
 => => exporting layers                                                                                               1.1s
 => => writing image sha256:e69a34ffad7ac6589f23881d651808ea25e24a25d7ce4d8dc984624b7aa96383                          0.0s
 => => naming to docker.io/library/atlantis-test:latest 
✗ docker run --rm -it --entrypoint sh atlantis-test:latest -c 'ls -la /usr/local/bin/tofu*'
-rwxr-xr-x 1 root root 79339520 Feb 22 12:14 /usr/local/bin/tofu
-rwxr-xr-x 1 root root 79339520 Feb 22 12:14 /usr/local/bin/tofu1.6.2
✗ docker run --rm -it --entrypoint sh atlantis-test:latest -c 'ls -la /usr/local/bin/terraform*'
-rwxr-xr-x 1 root root 84475904 Jan 31 14:19 /usr/local/bin/terraform
-rwxr-xr-x 1 root root 64626688 Sep 13 14:28 /usr/local/bin/terraform1.4.7
-rwxr-xr-x 1 root root 65200128 Sep  7  2023 /usr/local/bin/terraform1.5.7
-rwxr-xr-x 1 root root 81002496 Dec 13 17:58 /usr/local/bin/terraform1.6.6
-rwxr-xr-x 1 root root 84475904 Jan 31 14:19 /usr/local/bin/terraform1.7.2

references

@nitrocode nitrocode force-pushed the opentofu branch 6 times, most recently from 1ae1aa8 to 0951208 Compare March 12, 2024 01:52
@nitrocode nitrocode marked this pull request as ready for review March 12, 2024 02:00
@nitrocode nitrocode requested review from a team as code owners March 12, 2024 02:00
@nitrocode nitrocode requested review from jamengual, lukemassa and X-Guardian and removed request for a team March 12, 2024 02:00
@github-actions github-actions bot added the build Relating to how we build Atlantis label Mar 12, 2024
@nitrocode
Copy link
Member Author

cc @GenPage @jamengual

@GenPage GenPage added feature New functionality/enhancement github-actions labels Mar 23, 2024
@GenPage GenPage merged commit 4750dc2 into main Mar 23, 2024
25 of 26 checks passed
@GenPage GenPage deleted the opentofu branch March 23, 2024 15:57
@nitrocode nitrocode changed the title feat: add opentofu binary to container feat: add v1.6.2 opentofu binary to container Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Relating to how we build Atlantis feature New functionality/enhancement github-actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Preinstall opentofu in containers
3 participants