File tree Expand file tree Collapse file tree 4 files changed +55
-0
lines changed Expand file tree Collapse file tree 4 files changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ FROM gittools/libgit2sharp-mono
2
+
3
+ MAINTAINER GitTools Maintainers <
[email protected] >
4
+ ARG GitVersionZip
5
+
6
+ # Add GitVersion
7
+
8
+ ADD ./releaseArtifacts/$GitVersionZip .
9
+ RUN apt-get install unzip
10
+ RUN unzip -d /usr/lib/GitVersion/ $GitVersionZip
11
+ RUN rm $GitVersionZip
12
+ WORKDIR /usr/lib/GitVersion/
13
+
14
+ # Libgit2 can't resolve relative paths, patch to absolute path
15
+ RUN sed -i 's|lib/linux/x86_64|/usr/lib/GitVersion/lib/linux/x86_64|g' /usr/lib/GitVersion/LibGit2Sharp.dll.config
16
+
17
+ RUN mkdir /repo
18
+ VOLUME /repo
19
+
20
+ ENTRYPOINT ["mono" , "./GitVersion.exe" , "/repo" ]
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ Task("DownloadGitHubReleaseArtifacts")
71
71
if ( ! artifactLookup . ContainsKey ( "NuGetExeBuild" ) ) { throw new Exception ( "NuGetExeBuild artifact missing" ) ; }
72
72
if ( ! artifactLookup . ContainsKey ( "GemBuild" ) ) { throw new Exception ( "GemBuild artifact missing" ) ; }
73
73
if ( ! artifactLookup . ContainsKey ( "GitVersionTfsTaskBuild" ) ) { throw new Exception ( "GitVersionTfsTaskBuild artifact missing" ) ; }
74
+ if ( ! artifactLookup . ContainsKey ( "zip" ) ) { throw new Exception ( "zip artifact missing" ) ; }
74
75
} ) ;
75
76
76
77
Task ( "Publish-NuGetPackage" )
@@ -174,13 +175,30 @@ Task("Publish-VstsTask")
174
175
}
175
176
} ) ;
176
177
178
+
179
+ Task ( "Publish-DockerImage" )
180
+ . IsDependentOn ( "DownloadGitHubReleaseArtifacts" )
181
+ . Does ( ( ) =>
182
+ {
183
+ var returnCode = StartProcess ( "docker" , new ProcessSettings
184
+ {
185
+ Arguments = "docker build . --build-arg GitVersionZip=" + artifactLookup [ "zip" ] + " --tag latest --tag " + tag
186
+ } ) ;
187
+
188
+ if ( returnCode != 0 ) {
189
+ Information ( "Publish-DockerImage Task failed, but continuing with next Task..." ) ;
190
+ publishingError = true ;
191
+ }
192
+ } ) ;
193
+
177
194
Task ( "Deploy" )
178
195
. IsDependentOn ( "Publish-NuGetPackage" )
179
196
. IsDependentOn ( "Publish-NuGetCommandLine" )
180
197
. IsDependentOn ( "Publish-MsBuildTask" )
181
198
. IsDependentOn ( "Publish-Chocolatey" )
182
199
// .IsDependentOn("Publish-Gem")
183
200
. IsDependentOn ( "Publish-VstsTask" )
201
+ . IsDependentOn ( "Publish-DockerImage" )
184
202
. Finally ( ( ) =>
185
203
{
186
204
if ( publishingError )
Original file line number Diff line number Diff line change
1
+ FROM ubuntu:16.04
2
+
3
+ MAINTAINER GitTools Maintainers <
[email protected] >
4
+
5
+ # Wheezy doesn't support glibc 2.15 which libgit2sharp requires
6
+ # So we are going to install mono on ubuntu instead
7
+ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
8
+ RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list
9
+ RUN apt-get update
10
+ RUN apt-get install mono-complete libcurl3 tzdata unzip curl -y
11
+ RUN cp /usr/share/zoneinfo/GMT /etc/localtime
Original file line number Diff line number Diff line change
1
+ # Docker Base
2
+ We need a custom docker base image because mono is too old to support libgit2sharp
3
+
4
+ ## To build/publish
5
+ docker build . --tag gittools/libgit2sharp-mono
6
+ docker push gittools/libgit2sharp-mono
You can’t perform that action at this time.
0 commit comments