Skip to content

Commit cfea948

Browse files
author
Lane Erickson
committed
updating to include remote scm server under property remote
1 parent 6fc5413 commit cfea948

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<groupId>com.code54.mojo</groupId>
1313
<artifactId>buildversion-plugin</artifactId>
14-
<version>1.0.3</version>
14+
<version>1.0.5</version>
1515
<packaging>maven-plugin</packaging>
1616

1717
<name>buildversion-plugin</name>

src/main/clojure/buildversion_plugin/git.clj

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@
6868
commit-tstamp-str (.format (SimpleDateFormat. format-str)
6969
commit-tstamp)
7070

71+
remote-scm-server
72+
(try
73+
(join "/"
74+
(butlast
75+
(split
76+
(run-git-wait dir ["ls-remote" "--get-url"])
77+
#"/")))
78+
(catch java.lang.RuntimeException e ""))
79+
80+
7181
[short-hash long-hash] (split
7282
(run-git-wait dir
7383
["log" "-n" "1" "--format=%h %H"])
@@ -76,6 +86,7 @@
7686
versioning-properties {:build-tag "N/A"
7787
:build-version "N/A"
7888
:build-tag-delta "0"
89+
:remote remote-scm-server
7990
:build-tstamp commit-tstamp-str
8091
:build-commit long-hash
8192
:build-commit-abbrev short-hash }

src/test/bash/create-sample-git-project.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ cd $TARGET_DIR
1515
git init
1616
> README.txt
1717

18+
git remote add origin [email protected]:MasterRepo/oov.git
19+
1820
git add README.txt
1921
git ci -m "Initial commit. Before any tag"
2022

src/test/clojure/buildversion_plugin/test/git.clj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,15 @@
8989
{:build-version #"^1.0.0-SNAPSHOT-0.*"
9090
:build-tag #"^1.0.0-SNAPSHOT$"
9191
:build-tag-delta #"0"
92+
:remote #"[email protected]:MasterRepo"
9293
:build-tstamp #"\d+"
9394
:build-commit #"[a-f\d]+"
9495
})
9596

9697
(assert-for-commit "dev commit 5"
9798
{:build-version #"1.1.0-SNAPSHOT-3.*"
9899
:build-tag #"^1.1.0-SNAPSHOT$"
100+
:remote #"[email protected]:MasterRepo"
99101
:build-tag-delta #"3"
100102
:build-tstamp #"\d+"
101103
:build-commit #"[a-f\d]+"
@@ -104,6 +106,7 @@
104106
(assert-for-commit "dev commit 1"
105107
{:build-version #"^1.0.0-SNAPSHOT-1.*"
106108
:build-tag #"^1.0.0-SNAPSHOT"
109+
:remote #"[email protected]:MasterRepo"
107110
:build-tag-delta #"1"
108111
:build-tstamp #"\d+"
109112
:build-commit #"[a-f\d]+"
@@ -113,6 +116,7 @@
113116
(assert-for-commit "Initial commit. Before any tag"
114117
{:build-version #"N/A"
115118
:build-tag #"N/A"
119+
:remote #"[email protected]:MasterRepo"
116120
:build-tag-delta #"0"
117121
:build-tstamp #"\d+"
118122
:build-commit #"[a-f\d]+"

0 commit comments

Comments
 (0)