Skip to content

Commit 5f10abe

Browse files
authored
Merge pull request #16 from hcavalle/parameterize-pom-version
Parameterize pom version
2 parents 7ec9708 + 1167490 commit 5f10abe

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,7 @@ Thumbs.db
4747
*.iml
4848

4949
target/
50+
51+
# vagrant files #
52+
################
53+
.vagrant/*
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
COMPOSE_JAR_NAME=/home/vagrant/marathon/target/docker-compose-executor_0.0.1.jar
1+
PROJECT_HOME_DIR='/home/vagrant/marathon/'
2+
PROJECT_VERSION=`mvn -f $PROJECT_HOME_DIR/pom.xml org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | sed -n -e '/^\[.*\]/ !{ /^[0-9]/ { p; q } }'`
3+
COMPOSE_JAR_NAME=/home/vagrant/marathon/target/docker-compose-executor_$PROJECT_VERSION.jar
24
java -jar ${COMPOSE_JAR_NAME}

examples/vagrant/provision-dev-cluster.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
#
15+
1516
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
1617
echo deb https://apt.dockerproject.org/repo ubuntu-trusty main > /etc/apt/sources.list.d/docker.list
1718
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E56151BF
@@ -70,6 +71,8 @@ update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
7071
readonly IP_ADDRESS=192.168.33.7
7172
readonly MESOS_VERSION=0.28.2-2.0.27
7273
readonly MARATHON_VERSION=1.1.2-1.0.482
74+
readonly PROJECT_HOME_DIR='/home/vagrant/marathon'
75+
readonly PROJECT_VERSION=`mvn -f $PROJECT_HOME_DIR/pom.xml org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | sed -n -e '/^\[.*\]/ !{ /^[0-9]/ { p; q } }'`
7376

7477

7578
function install_mesos {
@@ -84,10 +87,13 @@ function install_docker_compose {
8487
pip install docker-compose
8588
}
8689

90+
function get_pom_version {
91+
mvn -f ${PROJECT_HOME_DIR}/pom.xml org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | sed -n -e '/^\[.*\]/ !{ /^[0-9]/ { p; q } }'
92+
}
8793

8894
function build_docker_compose_executor {
8995
mvn -f /home/vagrant/marathon/pom.xml clean package -U
90-
chmod 777 /home/vagrant/marathon/target/docker-compose-executor_0.0.1.jar
96+
chmod 777 /home/vagrant/marathon/target/docker-compose-executor_${PROJECT_VERSION}.jar
9197
}
9298

9399
function install_cluster_config {

0 commit comments

Comments
 (0)