Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions sample-apps/dotnet/codebuild/buildspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: 0.2

phases:
pre_build:
commands:
- echo "Pre-build phase -- Logging into Amazon ECR..."
- $ecrUrl = "$env:ACCOUNT_ID.dkr.ecr.$env:AWS_DEFAULT_REGION.amazonaws.com"
# - (Get-ECRLoginCommand).Password | docker login --username AWS --password-stdin $env:ACCOUNT_ID.dkr.ecr.$env:AWS_DEFAULT_REGION.amazonaws.com
- (Get-ECRLoginCommand).Password | docker login --username AWS --password-stdin $ecrUrl
- echo "Pre-build phase completed."

build:
commands:
- echo "Build phase -- Building Docker image via docker-compose..."
- docker-compose -f sample-apps/dotnet/docker-compose-windows.yaml build
- echo "Tagging the Docker image..."
- $ecrMainImageUrl = "$env:ACCOUNT_ID.dkr.ecr.$env:AWS_DEFAULT_REGION.amazonaws.com/appsignals-dotnet-windows-main-service:latest"
- $ecrRemoteImageUrl = "$env:ACCOUNT_ID.dkr.ecr.$env:AWS_DEFAULT_REGION.amazonaws.com/appsignals-dotnet-windows-remote-service:latest"
- docker tag dotnetsampleapp/frontend-service:latest $ecrMainImageUrl
- docker tag dotnetsampleapp/remote-service:latest $ecrRemoteImageUrl

post_build:
commands:
- echo "Post-build phase -- Pushing Docker image to ECR..."
- docker push $ecrMainImageUrl
- docker push $ecrRemoteImageUrl
- echo "Build completed successfully."

artifacts:
files:
- '**/*'
discard-paths: yes
4 changes: 2 additions & 2 deletions sample-apps/dotnet/docker-compose-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
- "8.8.6.6"
build:
context: .
dockerfile: asp_frontend_service/Dockerfile
dockerfile: asp_frontend_service/Dockerfile_Windows
container_name: asp_frontend_service
restart: always
ports:
Expand All @@ -22,7 +22,7 @@ services:
- "8.8.6.6"
build:
context: .
dockerfile: asp_remote_service/Dockerfile
dockerfile: asp_remote_service/Dockerfile_Windows
container_name: asp_remote_service
restart: always
ports:
Expand Down
Loading