Where does gitlab-runner download job artifacts zip file? - gitlab

I have build, test and deploy jobs in gitlab-ci file. The artifact created at the test job and should be passed to deploy job. I see that the artifacts downloading in the console (See the image) but I can't find it at the specified path. So where does the gitlab-runner save the artifacts. How to use them in subsequent jobs?
The deploy job is dependent upon test job via dependencies tag.image showing artifacts downloading

Artifacts are downloaded to your build main directory, the same directory that your code is being cloned to

Related

Where to save a reusable static jar to be used from an Azure DevOps pipeline?

I have an Azure DevOps pipeline
The pipeline has a "command line" task that runs a java command on a jar file
The jar file is a static one that represents a tool to be used in the build process.
The jar file is not created as part of the build pipeline. It's just a jar with one version and it doesn't change with each build
Where is the best place to save this jar file and how to download it to the agent during the build pipeline execution ?
Since the jar file is static one and not created as part of the build pipeline, you can save the jar file to Azure Artifacts Feed -> Universal Package.
To upload the jar file to Azure Artifacts Universal Package, you can use Universal Packages Task - Publish command in Pipeline or Azure CLI command: az artifacts universal publish (work in pipeline or local machine).
Then you can use the task: Universal Packages Task - Download command to download the Universal Package during the build pipeline execution.

Azure deployment from Azure DevOps failing to find zip package

I am setting up a build and release pipeline for our Azure mobile app using Azure DevOps. I have completed the build and all works fine. I have a build task defined that creates the required zip file for deploying to Azure and this succeeds and the zip file is created at the root of the folder. But the deployment fails stating that the zip file cannot be found.
Here is my build task that creates the zip file.
And here is the output from the build step showing that it has successfully created the zip file.
But the deployment fails as it can't find the zip file.
You need to publish the .zip file from your build using the Publish Build Artifacts task. That will make it available as an artifact to be linked into a release definition to be deployed.

How to get the outbuild build directory in VSTS after a YARN BUILD

I created a build definition using yarn custom extensions.
The build works fine:
But, apparently the yarn build task does not generate any output
What am I missing here to be able to generate a build output that I can deploy to azure?
Update 1:
I was able to configure the copy, but its copying the entire folder even with node_modules to the drop. There should be a build folder only
The task "Publish Artifact" publishes the build artifacts that exist on the agent in folder "a".
If you don't copy the output to folder "a", the publish task will not publish anything and you will get the message:
Directory '...\a' is empty. Nothing will be added to build...
Before the Publish Artifact task, you need to add the Copy Files task, in this task you should copy the Yarn output to the folder "a" in the agent, after it the publish will success.

How to output npm build error log files from linux hosted agents in vsts?

Trying to use the Linux build agents on vsts to build an angular application. For some reason it fails on the agent and I would like to get the full details in the log files. Any examples on how to get that sent to the output from the hosted build agents in vsts using a vsts build task?
To get the log files from Hosted agent, you just need to add Copy Files task and Publish Build Artifacts task in your build definition. Detail steps as below:
Add Copy Files task after the task you failed
After the task you failed (as the failed log you showed), add Copy Files task with below settings:
Add Publish Build Artifacts task after Copy Files task
The Publish Build Artifacts task settings as below:
Queue the build agent again
After the build finished, download the build artifacts to get the log files:

How can I have teamcity run a .bat file on each successful build?

I have a teamcity (4.something) install that creates .wsp file for deployment to sharepoint. Currently I have to copy the wsp out of the build artifacts directory and into a little deploy folder I have created. In the folder I run a .bat that deploys the new .wsp to our test server.
What steps can I take to automate this?
Either copy the .bat into the artifacts folder and update the paths etc or copy from the artifacts folder into the 'deploy' folder and run the .bat from there.
I am a neophyte when it comes to the intricacies (or basics!) of MSBuild and the like... so hand holding is appreciated!
In more recent versions of TeamCity...
In the build definition you can identify artifacts which can be copied/zipped. Artifacts can then be downloaded manually or referenced from another build (Artifact Dependency).
You can setup a 'build configuration' to do your deployment directly from artifacts produced by your ci build.
Create a build to do your deployment
Build Step
Run: Executable with parameters
Command executable: .bat file (make sure it as part of the ci build artifacts generated)
Command parameters: whatever parameters your patch files needs
Dependencies
Add New Artifact dependency
Depend on: select the ci build you want to deploy
GetArtifacts from: Last successful build
Artifact rules: +:**/*.*
So, given artifacts (like your batch file) are in the CI build... You now have a 'deploy' build. When you run it (manually or setup a Build Trigger) it will copy all the CI build artifacts to it's working directory (Artifact Dependency) and then run your batch file to do the deployment.
Pretty slick.
note: just make sure that the account running the TeamCity BuildAgent has permissions to do all the deployment stuff.
Hope this helps somebody as it took me a while to sort this out ;)
I've done this by creating a nant task, and then having TeamCity execute the nant task. It's more of a pain than it should be. You should be able to do the same as a post-build event with MSBuild.

Resources