TeamCity AutoIncrementer Plugin Modify Build Number - teamcity

I'm using the TeamCity AutoIncrementer Plugin: https://confluence.jetbrains.com/display/TW/Autoincrementer
I'm attempting to modify the config file at: [TeamCity Data Directory]/config/autoincrementer.properties
Within the config file it says:
# Autoincrementer plugin (pre 6.5 EAP).
#
# This file contains values for auto-incremented properties.
# Each auto-incremented property must start with 'autoinc_Test.' prefix.
# Value of the property must be a positive integer.
# To use auto-incremented property in a build you can add a reference to the property
# in build configuration settings, e.g: %autoinc_Test.build.number%. When plugin discovers such reference
# initial value for the referenced property will be written in this file.
# You can change properties values in this file manually at any time.
# Note that if you want to set a property to some value you need to put ! character
# before the value (after the equals sign).
My values look like:
autoinc.foo=1683367\:25
autoinc.bar=-1\:10
I believe the first number is the changelist from Perforce.
I want to change the last number for foo from 25 to 200 (this is the build number).
I've tried putting the exclamation character at autoinc.foo=!1683367:200 and at autoinc.foo=1683367:!200. In both cases TeamCity will overwrite this file and change it back to 26 on the next build.
1) How do I change the build number? Does this require a TeamCity restart?
2) How is this working at all if each autoinc requires 'autoinc_Test.' prefix?
I am using TeamCity 8.0.6.

The version we are using works by adding a ! after the = sign as per the comments in the file (e.g. autoinc.globalbuildnum=!1).
I noticed that the comments in the version we are using are different to those you have posted. We are using the plugin that is compatible with TeamCity 8.x+ which is currently at the link you posted. It was updated on 7th April 2015

Related

Jenkins Pipeline Jira Plugin sorted input parameter

My goal is to create a Jenkins Pipeline Input Step where the user can choose from a selection of JIRA versions. I am able to generate the dropdown list of available versions, but would like the order to be reversed.
The current dropdown is as follows:
REL-3
REL-2
REL-1
And my goal is for it to become:
REL-1
REL-2
REL-3
The order of the items makes the dropdown automatically selects REL-3, whereas it should default to REL-1 as it is the earliest version.
I am using the Jenkins JIRA Plugin with the JiraVersionParameterDefinition to generate the list of versions.
The Jenkins Pipeline code is the following:
#!/usr/bin/env groovy
def jiraVersionForReleaseFromUserInput() {
releases_list = [
$class: 'JiraVersionParameterDefinition',
jiraProjectKey: 'PROJECT_NAME',
jiraReleasePattern: 'REL-[0-9]+',
jiraShowRelease: 'false',
jiraShowArchived: 'false',
]
release = input message: 'Select JIRA Version to release', parameters: [releases_list]
RELEASE_NAME = release
}
My initial thought was the JiraVersionParameterDefinition would have an argument to sort themm but could not fine one. Then I tried using default fields such as sortReverseOrder, sortMode, and reverse_order but they weren't recognized. I have tried to create the list outside the input parameters to be able to sort it beforehand, but it isn't created at that point as when I print it the result is:
[$class:JiraVersionParameterDefinition, jiraProjectKey:PROJECT_NAME, jiraReleasePattern:REL-[0-9]+, jiraShowRelease:false, jiraShowArchived:false]
Am I missing a sorting parameter that is default on Jenkins Inputs? Is there a way to initialize the list before the input step? Is it possible to add a filter argument that can sort the resulting list?

Sonarqube6.7 lack of 'import unknown files' option

I want to scan a text file such as how much line in a .sh file. In sonarqube6.7 unknown files = true option is missing. I was in sonar-project.properties file to configure sonar.import_unknown_files = true also was not used. Does a higher version support unknown files?
The property sonar.import_unknown_files has no effect with SQ 6.7. By default, all the files are indexed (SONAR-8623). Then SQ keeps only the files on which a given Sensor (a plugin) saved something on it (SONAR-8631).
For your case, you need a custom plugin that:
declares a new language dealing with .sh files (similar to: https://github.com/SonarSource/sonar-custom-plugin-example/blob/master/src/main/java/org/sonarsource/plugins/example/languages/FooLanguage.java)
implements a Sensor implementing some logic to raise issues/metrics on your .sh files

Wireshark rpm packaging - setting the release number

I'm running the configure.ac on RHEL 7.2, I'm wondering if there's a way to set the Release number (which is defined om the spec file) as a variable like the Version number which is being generated by the configure.ac and it's written to the config.h file , I'd like to set a kind of BUILD_NUMBER variable somewhere, and it'll take the value of the exported variable during the execution.
The release number for an RPM package is set by the Release: tag in the spec-file. Some spec-files are generated, e.g., using autoconf to substitute values such as the release number in a template, e.g., mypackage.spec.in, to obtain mypackage.spec
A quick check of wireshark's source shows that it uses this scheme, but its template hardcodes the release number as 1. You could modify the configure script and template to add your own option.
For example, adapting the style of --with-XXX options used in the wireshark 2.0.1 configure.ac, you would add a chunk like this (untested):
AC_ARG_WITH([release],
AC_HELP_STRING( [--with-release=#<:#1/no/4/5#:>#],
[set release-number in package #<:#default=1#:>#]),
with_release="$withval", with_release="unspecified")
case "x$with_release" in
x[[1-9]]*)
RELEASE="$with_release"
;;
*)
AC_MSG_ERROR(release is not a number: $with_release)
;;
esac
AC_SUBST(RELEASE)
and use the RELEASE variable in packaging/rpm/SPECS/wireshark.spec.in, as you see the VERSION value used:
Release: #RELEASE#
Alternatively, if you are using the wireshark source without modifying it directly, your build script could
unpack the sources,
update the spec-file,
repack the tarball,
deploy the updated tarball to your build area
Either way, you would have to do some work.

Team city pass value between build steps with powershell

Im simply trying to pass value between build steps in TeamCity. Im currently using PowerShell.
My Powershell code looks like
$guid = [guid]::NewGuid().ToString()
echo "##teamcity[setParameter name='env.test' value='$guid']"
echo %env.test%
When I save this step and then run configuration all I get is following error
Warning: No enabled compatible agents for this build configuration.
Please register a build agent or tweak build configuration requirements.
Print screen of an error
When I remove usage of %env.test% (= last line) variable everything works fine, but the problem is of course that I cannot use this variable anywhere.
Any help is appreciated
You can check the list of undefined parameters if you press on lightbulb left to the Run button or if you go to the build configuration > Parameters page. You'll see there that env.test parameter "value is required". You need to define it (empty value can be used).

How do I put current date time (and other non-predefined) variables in info.plist of a Xcode project?

I am trying to put current date & time in the info string of my Xcode project's info.plist. There's no predefined variable for this as far as I can see. The best I can think of is to add this to my Run Script:
export MYDATETIME=`date`
And use this as info.plist's Get Info string"
1.0 ${MYDATETIME} Copyright 2011 by Me
That doesn't work since any variables set during Run Script phase don't survive the past the phase. Any way I can make the variable persistent thru the build process?
BTW. The goal is to have the date time stamp as part of the version string.

Resources