Update teamcity pipeline in a branch - teamcity

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?

Related

Problem with branch specification (The build was triggered in the branch XXX which does not correspond to any branch monitored by the build VCS roots)

good day. i try to ask same question on teamcity support forum but with no luck, so i try to find solution here
i have 4 (actual more, but other configuration not important for the situation):
'verify' - configuration that run test, check that all migration can be applied to database (run in docker) etc. this configuration triggered by gitlab (integration with teamcity feature)
'build' - configuration that build all application components and push docker images to hub
'deploy to test' - use corresponded artifacts from 'build' configuration and perform deploy images to test server
'deploy to staging' - same as 'deploy to test' but use staging server
'deploy to production' - same as 'deploy to production' but use production server
we have several stream in out repository with corresponded rules:
develop
feature/* - feature task that should be build then corresponded merge request to develop was initiated. merged to develop
release/* - release that should be deployed to staging server at each commit. merged to develop and master
hotfix/* - hotfix that should be deployed to staging server at each commit. merged into develop and master
master - stable branch, should be deployed to production on commit.
so, i create following VCS root:
default branch: refs/heads/develop
branch specification:
+:refs/heads/(*)
+:refs/heads/master
+:refs/heads/release/*
+:refs/heads/feature/*
+:refs/heads/hotfix/*
+:refs/(merge-requests/*)
after that i setup branch filters (for VCS Trigger) for each branch configuration:
verify - none
build:
+:refs/heads/release/*
+:refs/heads/hotfix/*
+:refs/heads/develop
+:refs/heads/master
deploy to staging:
+:refs/heads/master
+:refs/heads/release/*
+:refs/heads/hotfix/*
deploy to test:
+:refs/heads/develop
deploy to production:
+:refs/heads/master
so this is my setup, now my problems:
then gitlab trigger teamcity (on merge request) the verify configuration started. but i see following message (for example):
The build was triggered in the branch feature/VTS-610 which does not correspond to any branch monitored by the build VCS roots (the branch is either closed or excluded / not matched by any branch specification). Because of that default branch revisions were set to this build.
same message i can see if merge request initiated for hotfix branch (of course with another branch name, ie hotfix/VTS-654).
after hotfix branch merged (we create two merge-request: one to master and one to develop), i can see that deploy to staging was triggered, but deploy to test does not.
I had the same problem, the root cause in my case was the predefined build parameter teamcity.build.branch (see Build Branch Parameters)
The parameter was set in the build configuration of the failing build under "Parameters / Configuration Parameters". As I had no use for this parameter anymore, it was safe to just delete it. I was then able to run the build configuration with any branch that is accepted in the Branch Filter under Version Control Settings.

How to configure Azure-DevOps release pipeline task to kick off automated UI test scripts on xcode in MacBook?

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.

How to append git short hash into Octopus release from TeamCity

Using an OctopusDeploy: Create Release runner in TeamCity, I can create a release with the build.number fairly easily.
I'd like to add a suffix of the git commit short hash.
Here is how I solved it - scraped from various internet sources
In my CI Build, I added
A parameter named system.GitHashShort
Created a Powershell runner which executes this
$hash = "%build.vcs.number%"
$shortHash = $hash.substring(0,7)
Write-Host "##teamcity[setParameter name='system.GitHashShort' value='$shortHash']"
In my Deploy build configuration which is a snapshot dependency on CI Build
For the OctopusDeploy: Create Release runner, set the release number to be
%build.number%-%dep.MyAwesomeApp.system.GitHashShort%
This then gives builds of a format like 8.3.422.34-deadbee

Configuring gitlab with TeamCity

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 →

Using TeamCity to build local project in order to test setings

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.

Resources