Skip to content

Commit 6c30bde

Browse files
Rodrigo Dos SantosRodrigo Dos Santos
authored andcommitted
Fixed AWS ECS Configuration - build authentication-service
1 parent 5e20d1b commit 6c30bde

File tree

4 files changed

+18
-12
lines changed

4 files changed

+18
-12
lines changed

.github/workflows/docker-build-push-image-authentication-service.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
# Build Docker image using docker:build
7575
- name: Build Service using docker:build
7676
run: |
77-
mvn clean package -DskipTests -q -pl authentication-service -am -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn docker:build
77+
mvn clean package -Ddocker.image-tag=${{ github.sha }} -DskipTests -q -pl authentication-service -am -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn docker:build
7878
7979
# run: |
8080
# sed -i 's/openjdk:8-jre-alpine/balenalib\/raspberry-pi-alpine-openlighten itjdk:8/g' pom.xml
@@ -91,15 +91,17 @@ jobs:
9191
platforms: linux/amd64,linux/arm64
9292
push: true
9393
#tags: fielcapao/microservices-design-patterns-authentication-service:latest
94-
tags: ${{ secrets.ECR_REPOSITORY }}:latest
94+
tags: |
95+
${{ secrets.ECR_REPOSITORY }}:latest
96+
${{ secrets.ECR_REPOSITORY }}:${{ github.sha }}
9597
9698
- name: Fill in the new image ID in the Amazon ECS task definition
9799
id: task-def
98100
uses: aws-actions/amazon-ecs-render-task-definition@v1
99101
with:
100102
task-definition: ${{ env.ECS_TASK_DEFINITION }}
101103
container-name: ${{ env.CONTAINER_NAME }}
102-
image: ${{ steps.build-image.outputs.image }}
104+
image: ${{ secrets.ECR_REPOSITORY }}:latest
103105

104106
- name: Deploy Amazon ECS task definition
105107
uses: aws-actions/amazon-ecs-deploy-task-definition@v1

authentication-service/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1818
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
1919
<code-coverage>0.6</code-coverage>
20+
<docker.image-tag>${project.version}</docker.image-tag>
2021
</properties>
2122

2223
<dependencies>
@@ -176,7 +177,7 @@
176177
<from>${docker.image.from.fabric8}</from>
177178
<tags>
178179
<tag>latest</tag>
179-
<tag>${project.version}</tag>
180+
<tag>${docker.image-tag}</tag>
180181
</tags>
181182
<assembly>
182183
<descriptorRef>artifact</descriptorRef>

authentication-service/src/main/resources/application.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
spring:
2-
application:
3-
name: authentication-service
4-
main:
5-
allow-bean-definition-overriding: true
6-
mvc:
7-
pathmatch:
8-
matching-strategy: ant_path_matcher
91
management:
102
endpoints:
113
web:
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
spring:
2+
application:
3+
name: authentication-service
4+
main:
5+
allow-bean-definition-overriding: true
6+
mvc:
7+
pathmatch:
8+
matching-strategy: ant_path_matcher
9+
cloud:
10+
kubernetes:
11+
enabled: false

0 commit comments

Comments
 (0)