Artifacts for ASP.NET MVC project in GITLAB - asp.net-mvc

I have a asp.net mvc project, which is already there in GitLab repository.
I have configured a specific windows runner for my project.
I have installed visual studio in the runner machine.
Now I am able to build my code whenever pipeline runs.
I want to create an artifact package and use to deploy to my azure app service in next stage in pipelne.
How to create the artifact after build, and where these artifacts getting stored (runner machine or git repo)?
Also It would be great if someone can help with script to web deploy (instaed of FTP) the app service in deploy stage
Thanks in advance.
Regards,
Naresh Ede.

I have written the YAML file like below to build and generate artifacts.
The solution build was successful when i'm seeing the log, but getting a warning at generating artifacts
stages:
- build
solution-build:
stage: build
script:
- MSBuild.exe 'my-awesome-app.sln' /p:OutputPath="c:\Builds\awesome-
project"
artifacts:
paths:
- artifacts/
Job Log:
Uploading artifacts...
108 Runtime platform arch=386 os=windows pid=19556 revision=577f813d version=12.5.0
109 WARNING: binaries/: no matching files
110 ERROR: No files to upload

Related

Azure DevOps PipeLine MSBuild does not produce web folder like local command

Fairly new to Azure DevOps and PipeLines, but we are stumped by the fact executing an MSBuild command locally or through publish in VS2019 gives us a complete ready to publish folder, while the same command in Azure DevOps pipeline seems to be doing nothing but build.
Local command:
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild" Webshop\Mvc.csproj /p:PublishUrl="c:\Publish\Mvc" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=FileSystem /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:SolutionDir="." /p:PrecompileBeforePublish=true
MSBuild task:
steps:
- task: MSBuild#1
displayName: 'Build solution'
inputs:
solution: '$/MVC_Projects/<more here>/Webshop/Mvc.csproj'
msbuildVersion: 16.0
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArguments: '/p:DeployOnBuild=true /p:DeployTarget=WebPublish /p:PublishUrl="$(build.artifactstagingdirectory)\publish" /p:WebPublishMethod=FileSystem /p:AutoParameterizationWebConfigConnectionStrings=false /p:PrecompileBeforePublish=true'
We tried playing with the parameters, but that does not seem to have much effect (or we don't know which parameters to tweek). The most we got was adding an /p:DeployTarget=Package and /p:OutDir="$(build.artifactstagingdirectory)\bin" would copy the bin folder. This was still without the .compiled files we were expecting though.
The project is an ASP.NET MVC Framework 4.8 application. The code does build properly and without errors. The logs do not hint with any warning or tasks not being able to be completed, so no clues there. We require the output folder for the full website and not just the DLL's to make our migration to DevOps easier. Having the folder allows other deployment processes to remain the same.
This might not be best practice, but it is practical for us at this moment in time.
Question 1. Why is MSBuild doing something else locally than in the DevOps Pipeline? Is it perhaps picking up configuration files we are unaware of ?
Question 2. What settings (or perhaps other task) would we need to set up to get the same local publish folder appear in the $(build.artifactstagingdirectory) folder in DevOps ?
Any insight, direction or solution is appreciated.
SOLUTION
After many checks and trials in the build parameters and pipeline setup, it was a DevOps server installation issue. The DevOps server had a full version of 2022 installed and only a partial version of 2019. Although the builds did not give any error or warning, the artifacts were not created without the 'ASP.NET and web components' for Visual Studio 2019 being installed. After that component was installed, the builds ran just fine and as expected.
Lesson learned is to double check local development installation with server installation with relation to installed (individual) components when results vary, even if there are no errors.

Implement Dart workflow in Travis CI to deploy in Firebase

I'm new to both Firebase and Travis CI. Done some home work with Dart for sometime.
I'm trying to implement Travis CI for building my Angular Dart Project and deploying to Firebase.
It is going through the build and test fine, and while deploying i'm getting the below message.
Error: Specified public directory does not exist, can't deploy hosting
I have chosen build/web as my public directory while creating the firebase.json file. Seems like build directory is a different one in Travis CI.
What is the build directory?
Can i see some build files done in Travis CI for my project?
If so how?
Below is my GitHut Repository which i'm trying to automate the workflow.
Git Hub: https://github.com/Harikrishnadhas/siththargnaanaalayam
And Travis CI Build page shows the error here.
Travis CI : https://travis-ci.org/Harikrishnadhas/siththargnaanaalayam/builds/255561107
Kindly help!
Please find the answer to my question below
https://github.com/travis-ci/travis-ci/issues/8131
Currently Travis Doesn't build the dart project, hence script for same has to be added.

How to make the Jenkins build output as downloadable from Jenkins server machine itself?

I am new to Jenkins. i have configured the Jenkins "Free Style" project and executing a power shell a script to get an executable application(Exe) as output. i have searched for some of the plugins to make the Jenkins output (exe) as downloadable from the Jenkins server machine itself as an artifact link(download link). But i found the Jenkins plugins to copy the archive files, upload to ftp and some other plugins.
So, Could anyone please suggest me is there any option or plugin available to make the each Jenkins build output file as downloadable from the Jenkins server machine by keeping it in a server machine some other place?
A simple option would be to copy the artifact to the userContent directory in Jenkins. This is found under $JENKINS_HOME.
Once artifact is there, you can have a static link to it in the form of
http://<jenkins-host>:<port>/userContent/<your-artifact.exe>
I hope this helps.

How to deploy delphi exe output to artifactory using jenkins

I use a script in Jenkins to build delphi projects and I want to deploy their .exe outputs to Artifactory server but I dont know how. Is there any plugin to deploy exe files to Artifactory?
Is it a good idea to deploy them to Artifactory?
The best would be using the Jenkins Artifactory plugin.
The plugin allows your build jobs to deploy artifacts automatically to Artifactory and have them linked to the build job that created them.
The support for generic (freestyle) builds is probably the most suitable one for deploying the .exe files. As part of the support for generic builds, you will be able to defined patterns for selecting which files would be deployed and to where.

Package multiple publish profiles .pubxml after a successful build in Jenkins CI

I'm using Jenkins for Continuous Integration.
Right now I have a job with this command in Jenkins in the command line arguments for a build step:
This is the command:
"%WORKSPACE%\OEVizion\ITVizion.OEVizion.Web\ITVizion.OEVizion.Web.csproj" /p:DeployOnBuild=true /p:PublishProfile="IT Vizion - Web Deploy Package for a given domain.pubxml"
It works just fine, that is, the web deploy package (.zip) is created in the specified folder defined in the .pubxml file.
However what I'd like to do is to generate a .zip web deploy package for each of the .pubxml files that I have (right now 3) for this specific ITVizion.OEVizion.Web.csproj in a single shot\command.
With this I'd have multiple .zip packages with different settings ready to be deployed to different servers every time a commit is pushed to the repository and the project builds successfully.
Is this possible? How should I approach this?
The best practice is to build only once and then publish multiples times from the same build. Here is a screenshot of how to set that up:
After posting the question I saw the way to go about this: Add multiple build steps. One for each .pubxml file. That way the build process will run 3 times for the 3 publish profiles and you'll end up with 3 web deploy .zip packages at the end of the Job execution in Jenkins. Nice.

Resources