Skip to content

Commit 846b807

Browse files
committed
feat: Using CodeCatalyst PushToECR action
1 parent e52ed88 commit 846b807

File tree

2 files changed

+16
-31
lines changed

2 files changed

+16
-31
lines changed

.codecatalyst/workflows/build.yaml

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ Actions:
102102
- Name: jar_artifact
103103
Files:
104104
- target/*.jar
105+
- Dockerfile
105106
# Defines the action's properties.
106107
Configuration:
107108
# Required - Steps are sequential instructions that run shell commands
@@ -118,46 +119,30 @@ Actions:
118119
- Role: CodeCatalystTestEnvironmentRole
119120
Name: "123456789012"
120121
Name: TestEnvironment
121-
Build_Docker_Image:
122+
Build_Push_Docker_Image:
122123
DependsOn:
123124
- Mvn_Build_And_Deploy
124125
# Identifies the action. Do not modify this value.
125-
Identifier: aws/managed-test@v1.0.0
126+
Identifier: codecatalyst-labs/push-to-ecr@v1.0.3
126127

127128
# Specifies the source and/or artifacts to pass to the action as input.
128129
Inputs:
129130
# Optional
130-
Sources:
131-
- WorkflowSource # This specifies that the action requires this Workflow as a source
132131
Artifacts:
133132
- jar_artifact
134133

135-
Outputs:
136-
# Optional; Automatically discover reports for popular test frameworks
137-
AutoDiscoverReports:
138-
Enabled: true
139-
# Use as prefix for the report files
140-
ReportNamePrefix: rpt
141-
142-
# Defines the action's properties.
143-
Configuration:
144-
# Required - Steps are sequential instructions that run shell commands
145-
Steps:
146-
# use run-tests $FRAMEWORK to enable advanced testing features such as test case retries
147-
# see info link in shell commands section for more details
148-
- Run: mkdir target
149-
- Run: ls $CATALYST_SOURCE_DIR_jar_artifact
150-
- Run: cp $CATALYST_SOURCE_DIR_jar_artifact/target/*.jar ./target
151-
- Run: ls target/
152-
- Run: export MVN_VERSION=`mvn help:evaluate -Dexpression=project.version -q -DforceStdout`
153-
- Run: docker login -u AWS -p $(aws ecr get-login-password --region us-east-1) 123456789012.dkr.ecr.us-east-1.amazonaws.com
154-
- Run: docker build -t rest-calculator .
155-
- Run: docker tag rest-calculator:latest 123456789012.dkr.ecr.us-east-1.amazonaws.com/rest-calculator:$MVN_VERSION
156-
- Run: docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/rest-calculator:$MVN_VERSION
157-
Compute:
158-
Type: EC2
134+
# Required; You can use an environment, AWS account connection, and role to access AWS resources.
159135
Environment:
160-
Connections:
161-
- Role: CodeCatalystTestEnvironmentRole
162-
Name: "123456789012"
163136
Name: TestEnvironment
137+
Connections:
138+
- Name: "123456789012"
139+
Role:
140+
CodeCatalystTestEnvironmentRole
141+
142+
# Defines the action's properties.
143+
Configuration:
144+
# Required; type: string; description: The name to use for the repository. The repository name may be specified on its own (such as nginx-web-app) or it can be prepended with a namespace to group the repository into a category (such as project-a/nginx-web-app)
145+
RepositoryName: rest-calculator
146+
ImageTag: latest
147+
AWSRegion: us-east-1
148+
PublicRepository: false

images/build_workflow.png

-49.9 KB
Loading

0 commit comments

Comments
 (0)