Skip to content

Commit

Permalink
cd fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeh committed Apr 9, 2024
1 parent 68faed8 commit 5f6e21c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ POSTGRES_DB=amazonia360
POSTGRES_HOST=postgis
POSTGRES_PORT=5432
AUTH_TOKEN=super_secret_token
TIF_PATH=/opt/api/test_data
TIFF_PATH=/opt/api/test_data
6 changes: 3 additions & 3 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
deploy:
runs-on: ubuntu-latest
needs: build-and-test
if: github.ref == 'refs/heads/develop'
#if: github.ref == 'refs/heads/develop'
steps:

- name: Deploy to EC2
Expand All @@ -38,15 +38,15 @@ jobs:
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
script: |
cd amazonia360/amazonia-360
cd amazonia-360
git pull
docker-compose down
docker-compose up -d api --build
health-check:
runs-on: ubuntu-latest
needs: deploy
if: github.ref == 'refs/heads/develop'
#if: github.ref == 'refs/heads/develop'
steps:
- name: URL Health Check
uses: Jtalk/url-health-check-action@v4
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
*.venv
*data/
.env
.env.BCK
/env/
/infrastructure/vars/local.tfvars
__pycache__/
2 changes: 1 addition & 1 deletion api/app/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Settings(BaseSettings):
postgres_host: str
postgres_port: str
auth_token: str
tif_path: str
tiff_path: str

@lru_cache
def get_settings() -> Settings:
Expand Down
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ services:
environment:
- AUTH_TOKEN=${AUTH_TOKEN}
- TIFF_PATH=${TIFF_PATH}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_HOST=${POSTGRES_HOST}
- POSTGRES_PORT=${POSTGRES_PORT}
networks:
- amazonia360-network
restart:
Expand Down
4 changes: 2 additions & 2 deletions infrastructure/modules/ec2/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ resource "aws_instance" "amazonia360-ec2" {

user_data = <<-EOF
#!/bin/bash
echo "${var.authorized_key}" >> /home/ec2-user/.ssh/authorized_keys
echo "${var.authorized_key}" >> /home/ubuntu/.ssh/authorized_keys
EOF

tags = {
Expand All @@ -19,5 +19,5 @@ resource "aws_instance" "amazonia360-ec2" {

resource "aws_key_pair" "local_public_key" {
key_name = "amazonia360-key-pair"
public_key = file("~/.ssh/id_rsa.pub")
public_key = file("~/.ssh/key_amazonia360_ec2.pub")
}

0 comments on commit 5f6e21c

Please sign in to comment.