Skip to content

Commit

Permalink
redoing userdata
Browse files Browse the repository at this point in the history
  • Loading branch information
proquickly committed Dec 8, 2024
1 parent 5acdf92 commit 3846190
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Terraform Init
run: |
terraform init
working-directory: terraform # Specify the directory containing your Terraform files
working-directory: terraform

- name: Terraform Plan
run: |
Expand Down
16 changes: 8 additions & 8 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,18 @@ resource "aws_instance" "py_server" {
user_data = <<-EOF
#!/bin/bash
PROJ=tfgha
WORKDIR=/home/ubuntu
sudo apt-get update
sudo apt-get install -y python3 python3-pip git curl
curl -sSL https://install.python-poetry.org | python3 -
# python3 -m pip install -U poetry
python3 -m pip install -U poetry
cd /home/ubuntu
cd $WORKDIR
git clone https://github.com/proquickly/$PROJ.git
cd /home/ubuntu/$PROJ
/usr/local/bin/poetry lock
/usr/local/bin/poetry install
cd /home/ubuntu/$PROJ/src/$PROJ
cd $WORKDIR/$PROJ
export PATH="$HOME/.local/bin:$PATH"
poetry install
cd $WORKDIR/$PROJ/src/$PROJ
nohup poetry run python app.py &
EOF
Expand Down

0 comments on commit 3846190

Please sign in to comment.