-
Notifications
You must be signed in to change notification settings - Fork 891
chore: update lima example to use --with-terraform arg #5655
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,25 +65,16 @@ provision: | |
# See: https://github.com/lima-vm/lima/issues/528 | ||
chown ${LIMA_CIDATA_USER} /var/run/docker.sock | ||
chmod og+rwx /var/run/docker.sock | ||
- mode: system | ||
script: | | ||
#!/bin/bash | ||
set -eux -o pipefail | ||
command -v terraform >/dev/null 2>&1 && exit 0 | ||
DEBIAN_FRONTEND=noninteractive apt-get install -qqy unzip | ||
rm -fv /tmp/terraform.zip || true | ||
wget -qO /tmp/terraform.zip "https://releases.hashicorp.com/terraform/1.3.0/terraform_1.3.0_linux_$(dpkg --print-architecture).zip" | ||
unzip /tmp/terraform.zip -d /usr/local/bin/ | ||
chmod +x /usr/local/bin/terraform | ||
rm -fv /tmp/terraform.zip || true | ||
- mode: system | ||
script: | | ||
#!/bin/bash | ||
set -eux -o pipefail | ||
command -v coder >/dev/null 2>&1 && exit 0 | ||
export DEBIAN_FRONTEND=noninteractive | ||
export HOME=/root | ||
curl -fsSL https://coder.com/install.sh | sh | ||
# Using install.sh --with-terraform requires unzip to be available. | ||
apt-get install -qqy unzip | ||
curl -fsSL https://coder.com/install.sh | sh -s -- --with-terraform | ||
# Ensure Coder has permissions on /var/run/docker.socket | ||
usermod -aG docker coder | ||
# Ensure coder listens on all interfaces | ||
|
@@ -93,10 +84,8 @@ provision: | |
# Ensure coder starts on boot | ||
systemctl enable coder | ||
systemctl start coder | ||
# Wait for Coder to have downloaded Terraform | ||
timeout 60s bash -c 'until /var/cache/coder/terraform version >/dev/null 2>&1; do sleep 1; done' | ||
# Coder restarts after downloading Terraform, wait for it to become available | ||
timeout 60s bash -c 'until nc -z localhost 3000 > /dev/null 2>&1; do sleep 1; done' | ||
# Wait for Terraform to be installed | ||
timeout 60s bash -c 'until /usr/local/bin/terraform version >/dev/null 2>&1; do sleep 1; done' | ||
Comment on lines
+87
to
+88
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. review: terraform path updated There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is no longer required at all, right? It should be installed by the time There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My thinking here is that if terraform installation fails for some reason, it will be more obvious to the end-user. Edit: thinking more about it, any errors with Terraform installation should show up in the cloud-init log and be surfaced by |
||
- mode: user | ||
script: | | ||
#!/bin/bash | ||
|
@@ -141,10 +130,10 @@ message: | | |
All Done! Your Coder instance is accessible at http://localhost:3000 | ||
|
||
Username: "[email protected]" | ||
Password: Run `LIMA_INSTANCE=coder lima cat /home/${USER}.linux/.config/coderv2/password` 🤫 | ||
Password: Run `LIMA_INSTANCE={{.Instance.Name}} lima cat /home/${USER}.linux/.config/coderv2/password` 🤫 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
Get started creating your own template now: | ||
------ | ||
limactl shell coder | ||
limactl shell {{.Instance.Name}} | ||
cd && coder templates init | ||
------ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
review: no longer required