Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 19ae42a

Browse files
authored
chore: update lima example to use --with-terraform arg (#5655)
#5586 added the capability for install.sh to download and install Terraform automatically. Using this now in the example Lima specification. Also no longer hard-coding the instance name in favour of {{.Instance.Name}} in the output that gets emitted upon successful instance provisioning.
1 parent f96365a commit 19ae42a

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

examples/lima/coder.yaml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,25 +65,16 @@ provision:
6565
# See: https://github.com/lima-vm/lima/issues/528
6666
chown ${LIMA_CIDATA_USER} /var/run/docker.sock
6767
chmod og+rwx /var/run/docker.sock
68-
- mode: system
69-
script: |
70-
#!/bin/bash
71-
set -eux -o pipefail
72-
command -v terraform >/dev/null 2>&1 && exit 0
73-
DEBIAN_FRONTEND=noninteractive apt-get install -qqy unzip
74-
rm -fv /tmp/terraform.zip || true
75-
wget -qO /tmp/terraform.zip "https://releases.hashicorp.com/terraform/1.3.0/terraform_1.3.0_linux_$(dpkg --print-architecture).zip"
76-
unzip /tmp/terraform.zip -d /usr/local/bin/
77-
chmod +x /usr/local/bin/terraform
78-
rm -fv /tmp/terraform.zip || true
7968
- mode: system
8069
script: |
8170
#!/bin/bash
8271
set -eux -o pipefail
8372
command -v coder >/dev/null 2>&1 && exit 0
8473
export DEBIAN_FRONTEND=noninteractive
8574
export HOME=/root
86-
curl -fsSL https://coder.com/install.sh | sh
75+
# Using install.sh --with-terraform requires unzip to be available.
76+
apt-get install -qqy unzip
77+
curl -fsSL https://coder.com/install.sh | sh -s -- --with-terraform
8778
# Ensure Coder has permissions on /var/run/docker.socket
8879
usermod -aG docker coder
8980
# Ensure coder listens on all interfaces
@@ -93,10 +84,8 @@ provision:
9384
# Ensure coder starts on boot
9485
systemctl enable coder
9586
systemctl start coder
96-
# Wait for Coder to have downloaded Terraform
97-
timeout 60s bash -c 'until /var/cache/coder/terraform version >/dev/null 2>&1; do sleep 1; done'
98-
# Coder restarts after downloading Terraform, wait for it to become available
99-
timeout 60s bash -c 'until nc -z localhost 3000 > /dev/null 2>&1; do sleep 1; done'
87+
# Wait for Terraform to be installed
88+
timeout 60s bash -c 'until /usr/local/bin/terraform version >/dev/null 2>&1; do sleep 1; done'
10089
- mode: user
10190
script: |
10291
#!/bin/bash
@@ -141,10 +130,10 @@ message: |
141130
All Done! Your Coder instance is accessible at http://localhost:3000
142131
143132
Username: "[email protected]"
144-
Password: Run `LIMA_INSTANCE=coder lima cat /home/${USER}.linux/.config/coderv2/password` 🤫
133+
Password: Run `LIMA_INSTANCE={{.Instance.Name}} lima cat /home/${USER}.linux/.config/coderv2/password` 🤫
145134
146135
Get started creating your own template now:
147136
------
148-
limactl shell coder
137+
limactl shell {{.Instance.Name}}
149138
cd && coder templates init
150139
------

0 commit comments

Comments
 (0)