Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bitbucket pipelines .net deploy

I am trying to use new tool pipelines from bitbucket. I have multiple .NET console application (not Core app) than i want to build and download. I found this page that says that I can use mono to build my project. I use this .yml file to build it.

image: mono

pipelines:
  default:
    - step:
        script:
          - nuget restore
          - MONO_IOMAP=case xbuild /t:Build /p:Configuration="Release" /p:Platform="Any CPU" Solution.sln

Build was successful but now I am stuck with downloading my app (exe with all dlls). I found here that I can use bitbucket downloads. But how to download my deploy folder? Here I found that I can zip some files and then put it to bitbucket downloads. But how I can use this with mono, and how I can zip a whole folder, and then download it? I don't mind to use something else like mono.

like image 968
Pavol Avatar asked Oct 29 '22 11:10

Pavol


1 Answers

Mono is built on debian:wheezy, any linux commands you run in the script portion of the YML file can help you extract the file before BitBucket Pipelines pulls down the container. In the example you included there is a POST command at the end which deploys the artefact to Downloads in Bitbucket.

curl -v -u $BB_ACCESS -X POST https://api.bitbucket.org/2.0/repositories/$BITBUCKET_REPO_OWNER/$BITBUCKET_REPO_SLUG/downloads/ -F files=@aqua_lambda.zip

It explains the environment variables $BB_ACCESS further down, others are loaded in at runtime for you.

You'll need to find the file path mono compiles to and adjust the example's code to push to Bitbucket Downloads, or Amazon s3 is a good option too.

like image 77
timmah.faase Avatar answered Nov 09 '22 05:11

timmah.faase