I'm trying to build a basic dotnet core application and deploy it using the default tool available to me in AWS. I currently have the following steps working:
Checkin triggers CodeBuild build step on the Ubuntu image "aws/codebuild/dot-net:core-2.1" which runs the yml file(which creates the correct files I need to actually run the web app):
version: 0.2
phases:
build:
commands:
- dotnet restore CMS/CMS.csproj
- dotnet build CMS/CMS.csproj
- dotnet publish CMS/CMS.csproj -o site
artifacts:
files:
- CMS/site/**/*
- CMS/aws-windows-deployment-manifest.json
aws-windows-deployment-manifest.json:
{
"manifestVersion": 1,
"deployments": {
"aspNetCoreWeb": [{
"name": "CMS",
"parameters": {
"appBundle": "./site",
"iisPath": "/",
"iisWebSite": "Default Web Site"
}
}
]
}
}
It runs through each step fine and I get green check marks throughout, but when I navigate to the EB instance the original site is still shown, showing me that my application hasn't been deployed. Is there something I'm missing?
I was really hoping I would be able to deploy an app from check in to finish without needing to modify a build environment, at least right now.
Here is a buildspec.yml I wrote to create the beanstalk package from CodeBuild.
version: 0.2
phases:
build:
commands:
- dotnet restore EbCiTest/EbCiTest.csproj
- dotnet build EbCiTest/EbCiTest.csproj
- dotnet publish EbCiTest/EbCiTest.csproj -o ./staging/app
- cp ./EbCiTest/aws-windows-deployment-manifest.json ./EbCiTest/staging/.
artifacts:
files:
- '**/*'
base-directory: 'EbCiTest/staging'
I think the trouble you are having is the zip file being created contains the full paths to the files so aws-windows-deployment-manifest.json is not at the root of the zip file. I suggest copying everything to a staging folder and then using that staging folder as the base-directory which will be the root of the zip file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With