File tree Expand file tree Collapse file tree 3 files changed +32
-4
lines changed Expand file tree Collapse file tree 3 files changed +32
-4
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ ARG GitVersionZip
6
6
# Add GitVersion
7
7
8
8
ADD ./releaseArtifacts/$GitVersionZip .
9
- RUN apt-get install unzip
10
9
RUN unzip -d /usr/lib/GitVersion/ $GitVersionZip
11
10
RUN rm $GitVersionZip
12
11
WORKDIR /usr/lib/GitVersion/
Original file line number Diff line number Diff line change @@ -182,11 +182,40 @@ Task("Publish-DockerImage")
182
182
{
183
183
var returnCode = StartProcess ( "docker" , new ProcessSettings
184
184
{
185
- Arguments = "docker build . --build-arg GitVersionZip=" + artifactLookup [ "zip" ] + " --tag latest --tag " + tag
185
+ Arguments = "build . --build-arg GitVersionZip=" + artifactLookup [ "zip" ] + " --tag gittools/gitversion"
186
186
} ) ;
187
+ if ( returnCode != 0 ) {
188
+ Information ( "Publish-DockerImage Task failed to build image, but continuing with next Task..." ) ;
189
+ publishingError = true ;
190
+ }
191
+
192
+ // Login to dockerhub
193
+ returnCode = StartProcess ( "docker" , new ProcessSettings
194
+ {
195
+ Arguments = "login -u=\" " + EnvironmentVariable ( "DOCKER_USERNAME" ) + "\" -p=\" " + EnvironmentVariable ( "DOCKER_PASSWORD" ) + "\" "
196
+ } ) ;
197
+ if ( returnCode != 0 ) {
198
+ Information ( "Publish-DockerImage Task failed to login, but continuing with next Task..." ) ;
199
+ publishingError = true ;
200
+ }
187
201
202
+ // Publish Tag
203
+ returnCode = StartProcess ( "docker" , new ProcessSettings
204
+ {
205
+ Arguments = "push gittools/gitversion:" + tag
206
+ } ) ;
207
+ if ( returnCode != 0 ) {
208
+ Information ( "Publish-DockerImage Task failed push version tag, but continuing with next Task..." ) ;
209
+ publishingError = true ;
210
+ }
211
+
212
+ // Publish latest
213
+ returnCode = StartProcess ( "docker" , new ProcessSettings
214
+ {
215
+ Arguments = "push gittools/gitversion:latest"
216
+ } ) ;
188
217
if ( returnCode != 0 ) {
189
- Information ( "Publish-DockerImage Task failed, but continuing with next Task..." ) ;
218
+ Information ( "Publish-DockerImage Task failed latest tag , but continuing with next Task..." ) ;
190
219
publishingError = true ;
191
220
}
192
221
} ) ;
Original file line number Diff line number Diff line change 7
7
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
8
8
RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list
9
9
RUN apt-get update
10
- RUN apt-get install mono-complete libcurl3 tzdata unzip curl -y
10
+ RUN apt-get install mono-complete libcurl3 tzdata unzip curl git-all -y
11
11
RUN cp /usr/share/zoneinfo/GMT /etc/localtime
You can’t perform that action at this time.
0 commit comments