Skip to content

Commit

Permalink
[fix CI/CD pipeline]
Browse files Browse the repository at this point in the history
  • Loading branch information
alvo254 committed Jun 10, 2024
1 parent 8c3886d commit 6645039
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,26 @@ jobs:
docker build -t $DOCKER_USERNAME/$DOCKER_REPOSITORY:$IMAGE_TAG -f frontend/Dockerfile .
docker push $DOCKER_USERNAME/$DOCKER_REPOSITORY:$IMAGE_TAG
echo "image=$DOCKER_USERNAME/$DOCKER_REPOSITORY:$IMAGE_TAG" >> $GITHUB_ENV
- name: Set container image variable
run: echo "CONTAINER_IMAGE=fitnesshero" >> $GITHUB_ENV


- name: Set up Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: "1.0.0" # Specify the Terraform version

- name: Terraform Init and Apply
# - name: Terraform Init and Apply
# run: |
# terraform init
# terraform apply -auto-approve -var="container_image=${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_REPOSITORY }}:${{ env.IMAGE_TAG }}"

- name: Apply Terraform
run: |
terraform init
terraform apply -auto-approve -var="container_image=${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_REPOSITORY }}:${{ env.IMAGE_TAG }}"
terraform apply -auto-approve -var="container_image=${{ env.CONTAINER_IMAGE }}"
- name: Update ECS Service
run: |
Expand Down
2 changes: 1 addition & 1 deletion modules/ecs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ resource "aws_ecs_task_definition" "cloudific" {
container_definitions = jsonencode([
{
name = "app"
image = "fitnesshero:v1.0.0"
image = "fitnesshero"
cpu = 256
memory = 512
essential = true
Expand Down
4 changes: 4 additions & 0 deletions modules/ecs/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ variable "pub_sub1" {
}
variable "security_group" {
type = string
}

variable "" {
type = string
}

0 comments on commit 6645039

Please sign in to comment.