I'm using GitLab CE 9.2.1 df00a75 and TeamCity 2017.1.1 (build 46654) and I need to build next:
When developer open merge request TeamCity should run ESlint and Jest tests and return to gitlab success or failure status.
When I accept merge request TeamCity should build project and deliver it.
What I achieved for now - tests run when open merge request and when I accept merge request tests also runs.
Part of VCS Root config. I think my problem is here →
Related
We have a build that runs SonarQube from Jenkins using a bash script, and we want to get the results of the tests back in the Jenkins pipeline so we can prevent merges on fail. We are using v2 of Jenkins, but it is an old version that doesn't support the SonarQube Jenkins plugin, and upgrading Jenkins isn't something we can accomplish in our sprint.
Is there is a way to get the results to gate our pipeline with what we have? At the moment this is how we're running SonarQube from Jenkins in OpenShift.
dotnet build
~/.dotnet/tools/coverlet "./bin/Debug/netcoreapp3.1/AppTests.dll" --target "dotnet" --targetargs 'test . --no-build --logger "trx;LogFileName=TestResults.trx" --logger "xunit;LogFileName=TestResults.xml" --results-directory ../BuildReports/UnitTests' -f opencover -o ./BuildReports/Coverage/coverage
dotnet build-server shutdown
~/.dotnet/tools/dotnet-sonarscanner begin /k:${APP_NAME} /n:${APP_NAME} /d:sonar.host.url=${SONAR_URL} /d:sonar.cs.opencover.reportsPaths="./BuildReports/Coverage/coverage.opencover.xml" /d:sonar.exclusions="**/Migrations/*" /d:sonar.coverage.exclusions="**Tests*.cs","**/Migrations/*","**/Program.cs" /d:sonar.cpd.exclusions="**/Migrations/*" /d:sonar.cs.vstest.reportsPaths="./BuildReports/UnitTests/TestResults.trx" /d:sonar.cs.nunit.reportsPaths="./BuildReports/UnitTests/TestResults.xml"
dotnet build -v n
~/.dotnet/tools/dotnet-sonarscanner end
dotnet build-server shutdown
Install the Build Breaker plugin on the SonarQube server. And enable it for the project you are scanning -- to do this go to Project Settings on the SonarQube server. You may need server level and project level Administrative rights for doing this.
Now the Sonar Scanner will check for the quality gate status after doing the code analysis. In case the quality gate fails, the scanner returns with a non-zero status code that can be used to mark the build as “failed”.
https://github.com/adnovum/sonar-build-breaker#sonarqube-build-breaker-plugin
In case you don't have control over what gets installed on the SonarQube server, then you may write a bash script to use the curl command to hit web API of your SonarQube server to first find if the analysis report has been processed by the SonarQube server and then the quality gate status of the code analysis just concluded.
For the documentation of the web API, see http://<sonarqube-server-host>/web_api.
I have an existing teamcity pipeline which is running fine.
We use teamcity dsl to define the same.
I want to replace this with a new pipeline. I am experimenting with this pipeline in my own branch. When I try and push my change, I see this error
[Retrieve settings, revision: f16566918ecccbe079d02bd3c3689575408a0957] Read build settings from revision f16566918ecccbe079d02bd3c3689575408a0957
[10:01:05] [Read build settings from revision f16566918ecccbe079d02bd3c3689575408a0957] Failed to load build configuration settings from VCS: build configuration config is not found, use current settings from TeamCity server
Internal teamcity experts are asking me to do my development on a test teamcity environment we have.
Is this the only option?
Is there a way I can force teamcity to pick a new dsl based pipeline defined in a branch?
I have setup the Build pipeline in Azure-DevOps to generate build of xcode automation project. For that, I have used Microsoft hosted MacOS agent on my macbook. Now, i want to setup release pipeline to kick off automated test scripts from TFS/Azure-DevOps Server on the same macBook? Not sure what are the configuration I need to use in release pipeline task. If someone has done this, could you please help me step-by-step?
Did you mean you want the automated test from azure devops to run against your local macBook.
If this is your intention. You may need to setup a self-hosted macOS agent on you local macBook.
Please check here to create a self-hosted agent.
And in the release pipeline, associate your release pipeline to the build artifacts from your build pipeline. Make sure the build artifacts include your test code.If not you may need to add a publish artifact task in your build pipeline to include your test code in the build artifacts which will be downloaded and used in release pipeline.
In your stage create an agent job with the agent pool set to your agent pool with your self-host agent. And add a xcode task to run your test. When you run the release pipeline the test will run on your local macBook.
Here is documents about how to build, test and deploy with xcode. Hope you find above helpful.
I am using TeamCity build server for my CI process. I have a scenario, where i need to compare my previous and current build log and check for warnings in the code ad if the warnings count in the current is greater than the previous build, we have to fail the build.
I have two build steps namely:
For MS build
A powershell script to compare the builds ( previous build and current build)
I understand we can get the build information using the TeamCity API which is http:// /httpAuth/downloadBuildLog.html?BuildId=<< current build id >>
Is there anyway to get the build log while the build is in running state, and pass on to my second step ?
I want to experiment with my project output on the TeamCity. I dont want to use git or any other version control system.
Is there a way to turn off the VCS in teamcity and make it build and execute local projects.
Just install TeamCity on your machine, up to 20 build configurations it's free. VCS roots are completely optional, you can just build solutions from a local path - VCS roots are just a means to getting your code locally from a repo so you can build / interact with it.