Skip to content

Commit

Permalink
Got a successful deploy locally
Browse files Browse the repository at this point in the history
Signed-off-by: Tom George <[email protected]>
  • Loading branch information
tomgeorge committed Jan 6, 2020
1 parent 10d9955 commit 691e051
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 22 deletions.
12 changes: 5 additions & 7 deletions backend-base/pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.che.incubator.workspace-telemetry</groupId>
<artifactId>parent</artifactId>
<version>0.0.155</version>
<version>0.0.158</version>
</parent>
<distributionManagement>
<repository>
Expand All @@ -14,7 +12,7 @@
</repository>
</distributionManagement>
<artifactId>backend-base</artifactId>
<version>0.0.155</version>
<version>0.0.158</version>
<properties>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.parameters>true</maven.compiler.parameters>
Expand Down Expand Up @@ -215,8 +213,8 @@
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
Expand Down
11 changes: 4 additions & 7 deletions javascript/pom.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.che.incubator.workspace-telemetry</groupId>
<artifactId>parent</artifactId>
<version>0.0.155</version>
<version>0.0.158</version>
</parent>
<distributionManagement>
<repository>
Expand All @@ -13,13 +12,13 @@
</repository>
</distributionManagement>
<artifactId>javascript</artifactId>
<version>0.0.155</version>
<version>0.0.158</version>
<packaging>pom</packaging>
<dependencies>
<dependency>
<groupId>org.eclipse.che.incubator.workspace-telemetry</groupId>
<artifactId>backend-base</artifactId>
<version>0.0.3</version>
<version>0.0.158</version>
<classifier>resources</classifier>
<type>zip</type>
</dependency>
Expand Down Expand Up @@ -78,12 +77,10 @@
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.6</version>

<configuration>
<workingDirectory>${project.basedir}/src/typescript</workingDirectory>
<installDirectory>${project.build.directory}</installDirectory>
</configuration>

<executions>
<execution>
<id>install node and yarn</id>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.che.incubator.workspace-telemetry</groupId>
<artifactId>parent</artifactId>
<version>0.0.155</version>
<version>0.0.158</version>
<packaging>pom</packaging>
<modules>
<module>backend-base</module>
Expand All @@ -18,7 +18,7 @@
<artifactId>backend-base</artifactId>
<classifier>resources</classifier>
<type>zip</type>
<version>0.0.3</version>
<version>0.0.158</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
25 changes: 19 additions & 6 deletions update-versions.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/bin/bash

# Set parent, backend-base, and javascript versions:
# CURRENT_MAJOR
# CURRENT_MINOR
# CURRENT_PATCH
# NEW_VERSION_STRING
PARENT_CURRENT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
BACKEND_BASE_CURRENT_VERSION=$(mvn help:evaluate -pl backend-base -Dexpression=project.version -q -DforceStdout)
JAVASCRIPT_CURRENT_VERSION=$(mvn help:evaluate -pl javascript -Dexpression=project.version -q -DforceStdout)
Expand All @@ -7,23 +13,30 @@ PARENT_CURRENT_MINOR=$(echo $PARENT_CURRENT_VERSION | cut -d . -f2)
PARENT_CURRENT_PATCH=$(echo $PARENT_CURRENT_VERSION | cut -d . -f3)
PARENT_NEW_PATCH=$((PARENT_CURRENT_PATCH+1))
PARENT_NEW_VERSION_STRING="$PARENT_CURRENT_MAJOR.$PARENT_CURRENT_MINOR.$PARENT_NEW_PATCH"
xq --arg NEW_VERSION_STRING "$PARENT_NEW_VERSION_STRING" -x '.project.version=$NEW_VERSION_STRING' pom.xml > new-pom.xml
mv new-pom.xml pom.xml
BACKEND_BASE_CURRENT_MAJOR=$(echo $BACKEND_BASE_CURRENT_VERSION | cut -d . -f1)
BACKEND_BASE_CURRENT_MINOR=$(echo $BACKEND_BASE_CURRENT_VERSION | cut -d . -f2)
BACKEND_BASE_CURRENT_PATCH=$(echo $BACKEND_BASE_CURRENT_VERSION | cut -d . -f3)
BACKEND_BASE_NEW_PATCH=$((BACKEND_BASE_CURRENT_PATCH+1))
BACKEND_BASE_NEW_VERSION_STRING="$BACKEND_BASE_CURRENT_MAJOR.$BACKEND_BASE_CURRENT_MINOR.$BACKEND_BASE_NEW_PATCH"
xq --arg NEW_VERSION_STRING "$BACKEND_BASE_NEW_VERSION_STRING" -x '.project.version=$NEW_VERSION_STRING' backend-base/pom.xml > backend-base/new-pom.xml
mv backend-base/new-pom.xml backend-base/pom.xml
xq --arg PARENT_VERSION "$PARENT_NEW_VERSION_STRING" -x '.project.parent.version=$PARENT_VERSION' backend-base/pom.xml > backend-base/new-pom.xml
mv backend-base/new-pom.xml backend-base/pom.xml
JAVASCRIPT_CURRENT_MAJOR=$(echo $JAVASCRIPT_CURRENT_VERSION | cut -d . -f1)
JAVASCRIPT_CURRENT_MINOR=$(echo $JAVASCRIPT_CURRENT_VERSION | cut -d . -f2)
JAVASCRIPT_CURRENT_PATCH=$(echo $JAVASCRIPT_CURRENT_VERSION | cut -d . -f3)
JAVASCRIPT_NEW_PATCH=$((JAVASCRIPT_CURRENT_PATCH+1))
JAVASCRIPT_NEW_VERSION_STRING="$JAVASCRIPT_CURRENT_MAJOR.$JAVASCRIPT_CURRENT_MINOR.$JAVASCRIPT_NEW_PATCH"


# Run xq (jq for XML) on each pom, replacing the old version strings with the new ones
xq --arg NEW_VERSION_STRING "$PARENT_NEW_VERSION_STRING" -x '.project.version=$NEW_VERSION_STRING' pom.xml > new-pom.xml
mv new-pom.xml pom.xml
xq --arg RESOURCES_VERSION "$BACKEND_BASE_NEW_VERSION_STRING" -x '(.project.dependencyManagement.dependencies[] | select(.artifactId == "backend-base" and .classifier=="resources") | .version) |=$RESOURCES_VERSION' pom.xml > new-pom.xml
mv new-pom.xml pom.xml
xq --arg NEW_VERSION_STRING "$BACKEND_BASE_NEW_VERSION_STRING" -x '.project.version=$NEW_VERSION_STRING' backend-base/pom.xml > backend-base/new-pom.xml
mv backend-base/new-pom.xml backend-base/pom.xml
xq --arg PARENT_VERSION "$PARENT_NEW_VERSION_STRING" -x '.project.parent.version=$PARENT_VERSION' backend-base/pom.xml > backend-base/new-pom.xml
mv backend-base/new-pom.xml backend-base/pom.xml
xq --arg NEW_VERSION_STRING "$JAVASCRIPT_NEW_VERSION_STRING" -x '.project.version=$NEW_VERSION_STRING' javascript/pom.xml > javascript/new-pom.xml
mv javascript/new-pom.xml javascript/pom.xml
xq --arg PARENT_VERSION "$PARENT_NEW_VERSION_STRING" -x '.project.parent.version=$PARENT_VERSION' javascript/pom.xml > javascript/new-pom.xml
mv javascript/new-pom.xml javascript/pom.xml
xq --arg RESOURCES_VERSION "$BACKEND_BASE_NEW_VERSION_STRING" -x '(.project.dependencies[] | select(.artifactId == "backend-base" and .classifier=="resources") | .version) |=$RESOURCES_VERSION' javascript/pom.xml > javascript/new-pom.xml
mv javascript/new-pom.xml javascript/pom.xml

0 comments on commit 691e051

Please sign in to comment.