Skip to content

Commit

Permalink
Skip nodejs/yarn when skipping compile during package builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse White committed Oct 24, 2019
1 parent 1318419 commit 33f198b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
15 changes: 15 additions & 0 deletions core/web-assets/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
<artifactId>org.opennms.core.web-assets</artifactId>
<name>OpenNMS Web UI Assets (JavaScript &amp; CSS)</name>
<packaging>bundle</packaging>

<properties>
<skipNodeJSBuild>false</skipNodeJSBuild>
</properties>

<build>
<pluginManagement>
<plugins>
Expand Down Expand Up @@ -56,6 +61,7 @@
</goals>
<phase>generate-resources</phase>
<configuration>
<skip>${skipNodeJSBuild}</skip>
<nodeVersion>${nodeVersion}</nodeVersion>
<yarnVersion>${yarnVersion}</yarnVersion>
</configuration>
Expand All @@ -67,6 +73,7 @@
</goals>
<phase>generate-resources</phase>
<configuration>
<skip>${skipNodeJSBuild}</skip>
<arguments>--prefer-offline --non-interactive --frozen-lockfile --no-progress</arguments>
</configuration>
</execution>
Expand All @@ -77,6 +84,7 @@
</goals>
<phase>compile</phase>
<configuration>
<skip>${skipNodeJSBuild}</skip>
<arguments>--prefer-offline --non-interactive --frozen-lockfile --no-progress release</arguments>
</configuration>
</execution>
Expand Down Expand Up @@ -149,6 +157,13 @@
</plugins>
</build>
</profile>
<profile>
<!-- When building the packages in assemble only mode don't install or run Node.js -->
<id>skipCompile</id>
<properties>
<skipNodeJSBuild>true</skipNodeJSBuild>
</properties>
</profile>
</profiles>
<dependencies>
<dependency>
Expand Down
4 changes: 4 additions & 0 deletions makerpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ function main()

echo "=== Copying Source to Source Directory ==="
run rsync -aqr --exclude=.git --exclude=.svn --exclude=target --delete --delete-excluded "$TOPDIR/" "$WORKDIR/tmp/$PACKAGE_NAME-$VERSION-$RELEASE/"
if $ASSEMBLY_ONLY; then
# Include any existing target/ directory from the core/web-assets project so that webpack does not need to run again
run rsync -aqr --delete --delete-excluded "$TOPDIR/core/web-assets/" "$WORKDIR/tmp/$PACKAGE_NAME-$VERSION-$RELEASE/core/web-assets/"
fi

echo "=== Creating a tar.gz Archive of the Source in $WORKDIR/tmp/$PACKAGE_NAME-$VERSION-$RELEASE ==="
run tar zcf "$WORKDIR/SOURCES/${PACKAGE_NAME}-source-$VERSION-$RELEASE.tar.gz" -C "$WORKDIR/tmp" "${PACKAGE_NAME}-$VERSION-$RELEASE"
Expand Down
1 change: 1 addition & 0 deletions tools/packages/minion/create-minion-assembly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ PROJECTS=""
if [ $SKIP_COMPILE -eq 1 ]; then
echo "=== Compiling Assemblies ==="
PROJECTS="${ASSEMBLY_PROJECTS}"
OPTS_PROFILES="${OPTS_PROFILES} -PskipCompile"
else
echo "=== Compiling Projects + Assemblies ==="
PROJECTS="${COMPILE_PROJECTS},${ASSEMBLY_PROJECTS}"
Expand Down
2 changes: 1 addition & 1 deletion tools/packages/opennms/opennms.spec
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ if [ "%{skip_compile}" = 1 ]; then
OPTS_UPDATE_POLICY="-DupdatePolicy=always"
fi
TOPDIR=`pwd`
"$TOPDIR"/compile.pl -N $OPTS_SKIP_TESTS $OPTS_SETTINGS_XML $OPTS_ENABLE_SNAPSHOTS $OPTS_UPDATE_POLICY -Dinstall.version="%{version}-%{release}" -Ddist.name="%{name}-%{version}-%{release}.%{_arch}" -Dopennms.home="%{instprefix}" install --builder smart --threads ${CCI_MAXCPU:-2}
"$TOPDIR"/compile.pl -N $OPTS_SKIP_TESTS $OPTS_SETTINGS_XML $OPTS_ENABLE_SNAPSHOTS $OPTS_UPDATE_POLICY -PskipCompile -Dinstall.version="%{version}-%{release}" -Ddist.name="%{name}-%{version}-%{release}.%{_arch}" -Dopennms.home="%{instprefix}" install --builder smart --threads ${CCI_MAXCPU:-2}
else
echo "=== RUNNING COMPILE ==="
./compile.pl $OPTS_SKIP_TESTS $OPTS_SETTINGS_XML $OPTS_ENABLE_SNAPSHOTS $OPTS_UPDATE_POLICY -Dbuild=all -Dinstall.version="%{version}-%{release}" -Ddist.name="%{name}-%{version}-%{release}.%{_arch}" \
Expand Down
1 change: 1 addition & 0 deletions tools/packages/sentinel/create-sentinel-assembly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ PROJECTS=""
if [ $SKIP_COMPILE -eq 1 ]; then
echo "=== Compiling Assemblies ==="
PROJECTS="${ASSEMBLY_PROJECTS}"
OPTS_PROFILES="${OPTS_PROFILES} -PskipCompile"
else
echo "=== Compiling Projects + Assemblies ==="
PROJECTS="${COMPILE_PROJECTS},${ASSEMBLY_PROJECTS}"
Expand Down

0 comments on commit 33f198b

Please sign in to comment.