Skip to content

Instantly share code, notes, and snippets.

@jburditt
Last active March 14, 2018 22:59
Show Gist options
  • Save jburditt/4bca6d1ae12c3116770364d43d623a16 to your computer and use it in GitHub Desktop.
Save jburditt/4bca6d1ae12c3116770364d43d623a16 to your computer and use it in GitHub Desktop.
.NET Core to Pipelines Build
{
"manifestVersion": 1,
"deployments": {
"aspNetCoreWeb": [
{
"name": "app",
"parameters": {
"appBundle": ".",
"iisPath": "/",
"iisWebSite": "Default Web Site"
}
}
]
}
}
image: microsoft/dotnet:sdk
pipelines:
branches:
master:
- step:
caches:
- dotnetcore
script:
- apt-get update
# INSTALL ZIP
- apt-get install -y zip openssl curl
# INSTALL AWS CLI
- apt-get install -y python-dev
- curl -O https://bootstrap.pypa.io/get-pip.py
- python get-pip.py
- pip install awscli
# NUGET API AND MYGET RESTORE
- dotnet restore -s "https://www.nuget.org/api/v2/"
# BUILD PROJECT AND TESTS
- dotnet build $PROJECT_NAME
#- dotnet test $TEST_PROJECT_NAME
# PUBLISH
- dotnet publish $PROJECT_NAME/$PROJECT_NAME.csproj -o site -c Qa -r win10-x64
# ZIP PROJECT AND MANIFEST
- cd $PROJECT_NAME/site
- zip ../../source.zip * ../../aws-windows-deployment-manifest.json
- cd ../..
# UPLOAD TO S3
- aws s3 cp "source.zip" s3://<PATH_TO_BUCKET>-$PROJECT_NAME-$BITBUCKET_BUILD_NUMBER.zip
- aws elasticbeanstalk create-application-version --application-name "$APPLICATION_NAME" --region us-west-2 --version-label "QA-$PROJECT_NAME-$BITBUCKET_BUILD_NUMBER-$BITBUCKET_COMMIT" --source-bundle S3Bucket=<S3BUCKET>,S3Key=<S3KEY>/AWS-$PROJECT_NAME-$BITBUCKET_BUILD_NUMBER.zip
- aws elasticbeanstalk update-environment --application-name "$APPLICATION_NAME" --region us-west-2 --environment-name $APPLICATION_ENVIRONMENT --version-label "QA-$PROJECT_NAME-$BITBUCKET_BUILD_NUMBER-$BITBUCKET_COMMIT"
# UPDATE VARIABLES
#- aws elasticbeanstalk describe-configuration-settings --application-name $APPLICATION_NAME --region us-west-2 --environment-name $APPLICATION_ENVIRONMENT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment