Skip to content

Commit 4f65ba9

Browse files
committed
Add git and use sh on Alpine
1 parent d103764 commit 4f65ba9

File tree

2 files changed

+41
-38
lines changed

2 files changed

+41
-38
lines changed

azure-pipelines.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ resources:
1717
image: andrewarnott/linux-buildagent
1818
- container: bionic
1919
image: microsoft/dotnet:2.1-sdk-bionic
20+
- container: alpine38
21+
image: mcr.microsoft.com/dotnet/core/sdk:2.2.105-alpine3.8
2022
- container: alpine39
2123
image: mcr.microsoft.com/dotnet/core/sdk:2.2.105-alpine3.9
2224

@@ -140,12 +142,22 @@ jobs:
140142
steps:
141143
- template: azure-pipelines/xplattest-pipeline.yml
142144

145+
- job: Alpine_3_8
146+
dependsOn: Windows
147+
pool:
148+
vmImage: Ubuntu 16.04 # not a bug. we always use this pool, but use containers for the specific version
149+
container: alpine38
150+
steps:
151+
- script: apk update && apk add git
152+
- template: azure-pipelines/xplattest-pipeline.yml
153+
143154
- job: Alpine_3_9
144155
dependsOn: Windows
145156
pool:
146157
vmImage: Ubuntu 16.04 # not a bug. we always use this pool, but use containers for the specific version
147158
container: alpine39
148159
steps:
160+
- script: apk update && apk add git
149161
- template: azure-pipelines/xplattest-pipeline.yml
150162

151163
- job: macOS

azure-pipelines/xplattest-pipeline.yml

Lines changed: 29 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,47 +10,38 @@ steps:
1010
artifactName: deployables
1111
downloadPath: $(System.DefaultWorkingDirectory)
1212

13-
- task: Bash@3
13+
- script: |
14+
git config --global user.name ci
15+
git config --global user.email [email protected]
1416
displayName: Set up git username and email address
15-
inputs:
16-
targetType: inline
17-
script: |
18-
git config --global user.name ci
19-
git config --global user.email [email protected]
2017

21-
- task: Bash@3
18+
- script: >
19+
PkgFileName=$(ls deployables/Nerdbank.GitVersioning.*nupkg)
20+
21+
NBGV_NuGetPackageVersion=$([[ $PkgFileName =~ Nerdbank.GitVersioning\.(.*)\.nupkg ]] && echo "${BASH_REMATCH[1]}")
22+
23+
echo "<configuration><packageSources><clear /><add key='local' value='deployables' /></packageSources></configuration>" > nuget.config &&
24+
dotnet new classlib -o lib &&
25+
cd lib &&
26+
echo '{"version":"42.42"}' > version.json &&
27+
git init &&
28+
git add lib.csproj version.json Class1.cs &&
29+
dotnet add package nerdbank.gitversioning -v $NBGV_NuGetPackageVersion &&
30+
git commit -m "Initial commit" &&
31+
dotnet pack -c debug &&
32+
if ! ls bin/debug/lib.42.42.1*.nupkg 1> /dev/null 2>&1; then exit 1; fi
2233
displayName: Consume NB.GV from .NET Core build
23-
inputs:
24-
failOnStderr: true
25-
targetType: inline
26-
script: >
27-
PkgFileName=$(ls deployables/Nerdbank.GitVersioning.*nupkg)
28-
29-
NBGV_NuGetPackageVersion=$([[ $PkgFileName =~ Nerdbank.GitVersioning\.(.*)\.nupkg ]] && echo "${BASH_REMATCH[1]}")
30-
31-
echo "<configuration><packageSources><clear /><add key='local' value='deployables' /></packageSources></configuration>" > nuget.config &&
32-
dotnet new classlib -o lib &&
33-
cd lib &&
34-
echo '{"version":"42.42"}' > version.json &&
35-
git init &&
36-
git add lib.csproj version.json Class1.cs &&
37-
dotnet add package nerdbank.gitversioning -v $NBGV_NuGetPackageVersion &&
38-
git commit -m "Initial commit" &&
39-
dotnet pack -c debug &&
40-
if ! ls bin/debug/lib.42.42.1*.nupkg 1> /dev/null 2>&1; then exit 1; fi
41-
42-
- task: Bash@3
43-
displayName: Use nbgv dotnet CLI tool
44-
inputs:
45-
failOnStderr: true
46-
targetType: inline
47-
script: >
48-
echo DOTNET_ROOT=$DOTNET_ROOT
34+
failOnStderr: true
35+
36+
- script: >
37+
echo DOTNET_ROOT=$DOTNET_ROOT
4938
50-
PkgFileName=$(ls deployables/Nerdbank.GitVersioning.*nupkg)
39+
PkgFileName=$(ls deployables/Nerdbank.GitVersioning.*nupkg)
5140
52-
NBGV_NuGetPackageVersion=$([[ $PkgFileName =~ Nerdbank.GitVersioning\.(.*)\.nupkg ]] && echo "${BASH_REMATCH[1]}")
41+
NBGV_NuGetPackageVersion=$([[ $PkgFileName =~ Nerdbank.GitVersioning\.(.*)\.nupkg ]] && echo "${BASH_REMATCH[1]}")
5342
54-
dotnet tool install nbgv --tool-path . --version $NBGV_NuGetPackageVersion --add-source deployables &&
55-
./nbgv get-version -f json -p lib &&
56-
./nbgv get-version -f json -p lib | grep 42.42.1
43+
dotnet tool install nbgv --tool-path . --version $NBGV_NuGetPackageVersion --add-source deployables &&
44+
./nbgv get-version -f json -p lib &&
45+
./nbgv get-version -f json -p lib | grep 42.42.1
46+
displayName: Use nbgv dotnet CLI tool
47+
failOnStderr: true

0 commit comments

Comments
 (0)