|
3 | 3 | set -euo pipefail |
4 | 4 | set -x |
5 | 5 |
|
6 | | -# if the version of the Scanner is "DEV", we build the version deployed in repox using the current assembly version and the build number (CI_BUILD_NUMBER) |
7 | | -get_version() { |
8 | | - if [ "DEV" == "$1" ]; then |
9 | | - local assemblyInfoFile=../AssemblyInfo.Shared.cs |
10 | | - local version=`sed -n "s|\[assembly: AssemblyVersion(\"\([0-9.]*\)\")\]|\1|p" $assemblyInfoFile | sed 's/\r//'` |
11 | | - |
12 | | - if [ -z $version ]; then |
13 | | - echo "Failed to find assembly version in $assemblyInfoFile" |
14 | | - exit 1 |
15 | | - fi |
16 | | - |
17 | | - output="${version}.${CI_BUILD_NUMBER}" |
18 | | - else |
19 | | - output=$1 |
20 | | - fi |
21 | | -} |
22 | | - |
23 | | -cd its |
| 6 | +# use the version deployed in repox using the current assembly version and the build number (CI_BUILD_NUMBER) |
| 7 | +version=`sed -n "s|\[assembly: AssemblyVersion(\"\([0-9.]*\)\")\]|\1|p" AssemblyInfo.Shared.cs | sed 's/\r//'` |
24 | 8 |
|
25 | | -get_version $SCANNER_VERSION |
26 | | -if [ "DEV" == "$SCANNER_VERSION" ]; then |
27 | | - #store version for artifact promotion |
28 | | - echo "ARTIFACT=org/sonarsource/scanner/msbuild/sonar-scanner-msbuild/$output" > ../artifact.properties |
| 9 | +if [ -z $version ]; then |
| 10 | + echo "Failed to find assembly version" |
| 11 | +exit 1 |
29 | 12 | fi |
30 | | -SCANNER_VERSION=$output |
| 13 | + |
| 14 | +SCANNER_VERSION="${version}.${CI_BUILD_NUMBER}" |
31 | 15 |
|
32 | | -get_version $SCANNER_PAYLOAD_VERSION |
33 | | -SCANNER_PAYLOAD_VERSION=$output |
| 16 | +#store version for artifact promotion |
| 17 | +echo "ARTIFACT=org/sonarsource/scanner/msbuild/sonar-scanner-msbuild/$SCANNER_VERSION" > artifact.properties |
34 | 18 |
|
35 | | -# default versions of csharp and vbnet plugin are defined in the pom file |
36 | | -mvn -B -e verify -Dsonar.runtimeVersion=$SQ_VERSION -DscannerForMSBuild.version=$SCANNER_VERSION -DscannerForMSBuildPayload.version=$SCANNER_PAYLOAD_VERSION -Dmsbuild.path=$MSBUILD_PATH |
| 19 | +cd its |
| 20 | +mvn -B -e verify -Dsonar.runtimeVersion=$SQ_VERSION -DscannerForMSBuild.version=$SCANNER_VERSION -Dmsbuild.path=$MSBUILD_PATH |
0 commit comments