Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to setup pipeline for .Net Core 3.1

Kyle_Davis March 16, 2020

Can someone suggest what to do to set up a pipeline for .Net Core 3.1. I've tried a couple of images that I found through "docker search" and on the Microsoft support site but the build is still failing. My current .yml code is below:

image: mcr.microsoft.com/dotnet/core/sdk:3.1

pipelines:
default:
- step:
caches:
- dotnetcore
script: # Modify the commands below to build your repository.
- zip applicationapi.zip
- export PROJECT_NAME=FitnessWebApplication
- export TEST_NAME=FitnessWebApplication.test
- dotnet restore
- dotnet build $PROJECT_NAME
#- dotnet test $TEST_NAME
- pipe: atlassian/heroku-deploy:1.1.2
variables:
HEROKU_API_KEY: 'X'
HEROKU_APP_NAME: 'fitnesswebapplicationapi'
ZIP_FILE: 'applicationapi.zip'

I've also tried the microsoft/dotnet and appsvc/dotnetcore images. csproj file is below:

 <ItemGroup> <PackageReference Include="AutoMapper" Version="9.0.0" /> <PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="7.0.0" /> <PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.7" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.0.0" /> <PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.0" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.0.0" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.0" /> <PackageReference Include="Microsoft.IdentityModel.Tokens" Version="5.6.0" /> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.1" /> <PackageReference Include="MongoDB.Bson" Version="2.10.0" /> <PackageReference Include="MongoDB.Driver" Version="2.10.0" /> <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.6.0" /> <PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.0" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.0" /> <PackageReference Include="Microsoft.AspNetCore.Routing" Version="2.2.2" /> </ItemGroup>

 

2 answers

1 vote
Lee Venkatsamy March 17, 2020

Hi Kyle, I'm not sure if you came right, but you can use this (https://hub.docker.com/_/microsoft-dotnet-core-sdk/) image: mcr.microsoft.com/dotnet/core/sdk:3.1

Kyle_Davis March 17, 2020

I've tried that image previously, cited it in op. image still doesn't work properly.

Lee Venkatsamy March 17, 2020

What's the error you're getting?

Kyle_Davis March 17, 2020

When I try to build, all that pings back is "something went wrong," not a useful error I know but that's all that Bitbucket is giving me. 

Lee Venkatsamy March 17, 2020

You should try to eliminate the heroku part and try only building your project first. 

Once you have a successful build, then add the extra commands you need.  

 

I'm not sure if this would help, but this is my yml file with just the basic build of a project. 

image: mcr.microsoft.com/dotnet/core/sdk:3.1

pipelines:
default:
-
step:
caches:
-
dotnetcore
script:
# Modify the commands below to build your repository.
-
dotnet build ZT.Web.Main/ZT.Web.Main.csproj
Like # people like this
Kyle_Davis March 17, 2020

@Lee Venkatsamy Do you know how I get assistance from an Atlassian Member?

Lee Venkatsamy March 17, 2020

Don't know bud.. Kinda dumb that we are paying for something, but don't receive support.

Like # people like this
Lee Venkatsamy March 17, 2020

Don't you have a console log similar to this? where you can see which line the error is occurring?  

2020-03-18 08_12_45-Clipboard.png

Kyle_Davis March 18, 2020

The ping back I'm getting is before that step. I do know what you're referencing bc of the other pipeline I made for the UI but the error message I get is before the build begins as if its a yml error. Yet no status code or anything. 

0 votes
Kyle_Davis March 18, 2020

Is it possible for an @Atlassian team member to assist here? 

Paresh_Bijarane March 18, 2020

Create a ticket using the link https://support.atlassian.com/contact/#/

Like Kyle_Davis likes this
Kyle_Davis March 19, 2020

@Paresh_Bijarane thank you 

Samuel Engelman May 15, 2020

Did you get this to work? I get an error bash: zip: command not found

jnyingi June 5, 2020

@Paresh_Bijarane What is the status of this issue?

Paresh_Bijarane June 5, 2020

@jnyingi I switched to Azure Pipeline considering limitations of Bitbucket for .Net.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events