How to deploy a dotnet core app using AWS CodePipeline to ElasticBeanstalk
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:
- Repository in CodeCommit
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"
}
}
]
}
}
- CodeDeploy takes the artifacts and published them to an elastic beanstalk application configured to use windows. It's currently running the default application.
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.
amazon-web-services .net-core amazon-elastic-beanstalk aws-code-deploy aws-codepipeline
add a comment |
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:
- Repository in CodeCommit
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"
}
}
]
}
}
- CodeDeploy takes the artifacts and published them to an elastic beanstalk application configured to use windows. It's currently running the default application.
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.
amazon-web-services .net-core amazon-elastic-beanstalk aws-code-deploy aws-codepipeline
add a comment |
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:
- Repository in CodeCommit
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"
}
}
]
}
}
- CodeDeploy takes the artifacts and published them to an elastic beanstalk application configured to use windows. It's currently running the default application.
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.
amazon-web-services .net-core amazon-elastic-beanstalk aws-code-deploy aws-codepipeline
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:
- Repository in CodeCommit
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"
}
}
]
}
}
- CodeDeploy takes the artifacts and published them to an elastic beanstalk application configured to use windows. It's currently running the default application.
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.
amazon-web-services .net-core amazon-elastic-beanstalk aws-code-deploy aws-codepipeline
amazon-web-services .net-core amazon-elastic-beanstalk aws-code-deploy aws-codepipeline
asked Nov 14 '18 at 0:40
HeWhoFreeksHeWhoFreeks
705
705
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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.
This did it. Thank you so much! I was getting very frustrated because it seemed like a few different tutorials had you doing manual work or using the AWS tools on visual studio and I just couldn't get anything to deploy using code pipleline.
– HeWhoFreeks
Nov 14 '18 at 14:20
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53291534%2fhow-to-deploy-a-dotnet-core-app-using-aws-codepipeline-to-elasticbeanstalk%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
This did it. Thank you so much! I was getting very frustrated because it seemed like a few different tutorials had you doing manual work or using the AWS tools on visual studio and I just couldn't get anything to deploy using code pipleline.
– HeWhoFreeks
Nov 14 '18 at 14:20
add a comment |
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.
This did it. Thank you so much! I was getting very frustrated because it seemed like a few different tutorials had you doing manual work or using the AWS tools on visual studio and I just couldn't get anything to deploy using code pipleline.
– HeWhoFreeks
Nov 14 '18 at 14:20
add a comment |
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.
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.
answered Nov 14 '18 at 6:28
Norm JohansonNorm Johanson
1,34966
1,34966
This did it. Thank you so much! I was getting very frustrated because it seemed like a few different tutorials had you doing manual work or using the AWS tools on visual studio and I just couldn't get anything to deploy using code pipleline.
– HeWhoFreeks
Nov 14 '18 at 14:20
add a comment |
This did it. Thank you so much! I was getting very frustrated because it seemed like a few different tutorials had you doing manual work or using the AWS tools on visual studio and I just couldn't get anything to deploy using code pipleline.
– HeWhoFreeks
Nov 14 '18 at 14:20
This did it. Thank you so much! I was getting very frustrated because it seemed like a few different tutorials had you doing manual work or using the AWS tools on visual studio and I just couldn't get anything to deploy using code pipleline.
– HeWhoFreeks
Nov 14 '18 at 14:20
This did it. Thank you so much! I was getting very frustrated because it seemed like a few different tutorials had you doing manual work or using the AWS tools on visual studio and I just couldn't get anything to deploy using code pipleline.
– HeWhoFreeks
Nov 14 '18 at 14:20
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53291534%2fhow-to-deploy-a-dotnet-core-app-using-aws-codepipeline-to-elasticbeanstalk%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown