C
Coder.com•2y ago
auré

Edit template startup script

Hi everyone, I was trying to modify the startup script of the coder agent of a template. According to the doc, i pull & decompress the template with
coder templates pull docker-code-server file.tar && tar -xf file.tar && rm file.tar
coder templates pull docker-code-server file.tar && tar -xf file.tar && rm file.tar
I have now the config files from the template, i edit the coder agent with :
startup_script = <<EOT
#!/bin/bash
# install and start code-server
code-server --auth none
sudo apt update && sudo apt upgrade -y
sudo apt install wget gcc curl -y
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-6.0
EOT
startup_script = <<EOT
#!/bin/bash
# install and start code-server
code-server --auth none
sudo apt update && sudo apt upgrade -y
sudo apt install wget gcc curl -y
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-6.0
EOT
Finally i push everything and i recreate a new template but nothing have change. Any ideas ? thanks đŸ™‚
5 Replies
auré
aurĂ©OP•2y ago
GitHub
coder/main.tf at main · coder/coder
A tool that provisions remote development environments via Terraform - coder/main.tf at main · coder/coder
auré
aurĂ©OP•2y ago
Seens eveything stopped when the command : "code-server --auth none" is executed
Atif
Atif•2y ago
I think you forgot to push it to background by using
code-server --auth none &
code-server --auth none &
put a & after that and try
auré
aurĂ©OP•2y ago
Fixed when calling this command at the end of the script, i will try this. Thanks for your help ! đŸ™‚
Codercord
Codercord•2y ago
Marked the thread as resolved.
Want results from more Discord servers?
Add your server