add gh-pages deployment steps

This commit is contained in:
Eyck Jentzsch 2021-11-27 16:48:09 +01:00
parent 86c30ad948
commit 6a591f2dbc
5 changed files with 191 additions and 42 deletions

View File

@ -12,7 +12,8 @@
<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
<stringAttribute key="M2_USER_SETTINGS" value=""/>
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="true"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/AdoptOpenJDK 8 [1.8.0_232]"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${project_loc:com.minres.scviewer.parent}"/>
</launchConfiguration>

View File

@ -29,6 +29,8 @@
<tycho-version>1.5.0</tycho-version>
<groovy-eclipse-compiler-version>3.6.0-03</groovy-eclipse-compiler-version>
<groovy-eclipse-batch-version>3.0.3-01</groovy-eclipse-batch-version>
<!-- <software.download.area>${user.home}/deployment-work/${DEPLOY_WORK_DIRECTORY}</software.download.area> -->
<software.download.area>${project.build.directory}/../</software.download.area>
</properties>
<build>

View File

@ -3,3 +3,4 @@
/artifacts.jar
/content.jar
/target/
/gh-pages/

View File

@ -0,0 +1,104 @@
<?xml version="1.0"?>
<project name="project">
<target name="getMajorMinorVersion">
<script language="javascript">
<![CDATA[
// getting the value
buildnumber = project.getProperty("unqualifiedVersion");
index = buildnumber.lastIndexOf(".");
counter = buildnumber.substring(0, index);
project.setProperty("majorMinorVersion",counter);
]]>
</script>
</target>
<target name="test_getMajorMinor" depends="getMajorMinorVersion">
<echo message="majorMinorVersion: ${majorMinorVersion}"/>
</target>
<!--
site.label The name/title/label of the created composite site
unqualifiedVersion The version without any qualifier replacement
buildQualifier The build qualifier
-->
<target name="compute.child.repository.data" depends="getMajorMinorVersion">
<property name="full.version" value="${unqualifiedVersion}" />
<property name="software.download.area" location="${user.home}/p2.repositories" />
<property name="updates.dir" value="updates" />
<property name="site.composite.name" value="${site.label} ${majorMinorVersion}" />
<property name="main.site.composite.name" value="${site.label} All Versions" />
<!--
<property name="main.composite.repository.directory" location="${software.download.area}/${updates.dir}" />
-->
<property name="main.composite.repository.directory" location="${software.download.area}" />
<property name="composite.repository.directory" value="${main.composite.repository.directory}/${majorMinorVersion}" />
<property name="child.repository" value="${full.version}" />
<property name="child.repository.directory" value="${composite.repository.directory}/${child.repository}/" />
</target>
<target name="p2.composite.add" depends="compute.child.repository.data">
<property name="source.repository" location="${project.build.directory}/repository"/>
<echo message=" " />
<echo message="Source repository path: ${source.repository}" />
<echo message="Copying to ${child.repository.directory}..." />
<mkdir dir="${child.repository.directory}"/>
<copy todir="${child.repository.directory}" overwrite="true">
<fileset dir="${source.repository}" />
</copy>
<add.composite.repository.internal
composite.repository.location="${composite.repository.directory}"
composite.repository.name="${site.composite.name}"
composite.repository.child="${child.repository}"
/>
<add.composite.repository.internal
composite.repository.location="${main.composite.repository.directory}"
composite.repository.name="${main.site.composite.name}"
composite.repository.child="${majorMinorVersion}"
/>
</target>
<!-- = = = = = = = = = = = = = = = = =
macrodef: add.composite.repository.internal
= = = = = = = = = = = = = = = = = -->
<macrodef name="add.composite.repository.internal">
<attribute name="composite.repository.location" />
<attribute name="composite.repository.name" />
<attribute name="composite.repository.child" />
<sequential>
<echo message=" " />
<echo message="Composite repository : @{composite.repository.location}" />
<echo message="Composite name : @{composite.repository.name}" />
<echo message="Adding child repository : @{composite.repository.child}" />
<p2.composite.repository>
<repository compressed="false" location="@{composite.repository.location}" name="@{composite.repository.name}" />
<add>
<repository location="@{composite.repository.child}" />
</add>
</p2.composite.repository>
<echo file="@{composite.repository.location}/p2.index">version=1
metadata.repository.factory.order=compositeContent.xml,\!
artifact.repository.factory.order=compositeArtifacts.xml,\!
</echo>
</sequential>
</macrodef>
</project>

View File

@ -23,6 +23,7 @@
</plugin>
</plugins>
</build>
<profiles>
<profile>
<!-- Activate this profile to perform the release to Bintray -->
@ -33,37 +34,77 @@
<build>
<plugins>
<plugin>
<groupId>com.carrotgarden.maven</groupId>
<artifactId>bintray-maven-plugin</artifactId>
<version>1.5.20191113165555</version>
<configuration>
<skip>false</skip>
<!-- Bintray organization name. -->
<subject>minres</subject>
<!-- Bintray target repository. -->
<repository>eclipse</repository>
<!-- Bintray package name -->
<bintrayPackage>SCViewer</bintrayPackage>
<!-- Bintray package version number -->
<bintrayVersion>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}</bintrayVersion>
<!-- remove any preexisting files -->
<performDestroy>true</performDestroy>
<!-- information used when creating the package -->
<packageVcsUrl>https://git.minres.com/VP-Tools/SCViewer.git</packageVcsUrl>
<packageLicenses>EPL-1.0</packageLicenses>
<!-- Local folder content to sync to the remote repo. -->
<sourceFolder>${project.build.directory}/repository</sourceFolder>
<!-- Remote folder for local content upload, relative path. -->
<targetFolder>SCViewer/${parsedVersion.majorVersion}.${parsedVersion.minorVersion}</targetFolder>
<!-- Bintray credentials in settings.xml. -->
<serverId>bintray-minres-deploy</serverId>
</configuration>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<!-- Activate "bintray:upload" during "package" -->
<execution>
<phase>package</phase>
<goals>
<goal>upload</goal>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>bash</executable>
<!-- optional -->
<workingDirectory>${software.download.area}</workingDirectory>
<arguments>
<argument>-c</argument>
<argument>if [ -d gh-pages ]; then cd gh-pages; git pull; else git clone --branch gh-pages https://git.minres.com/VP-Tools/SCViewer.git gh-pages; fi</argument>
</arguments>
<environmentVariables>
<LANG>en_US</LANG>
</environmentVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-eclipserun-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<!-- IMPORTANT: DO NOT split the arg line -->
<appArgLine>-application org.eclipse.ant.core.antRunner -buildfile packaging-p2-composite.ant p2.composite.add -Dsite.label="SCViewer Software Repository" -Dproject.build.directory=${project.build.directory} -DunqualifiedVersion=${unqualifiedVersion} -Dsoftware.download.area="${software.download.area}/gh-pages/repository"</appArgLine>
<repositories>
<repository>
<id>2020-03</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/2020-03/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<artifactId>org.eclipse.ant.core</artifactId>
<type>eclipse-plugin</type>
</dependency>
<dependency>
<artifactId>org.apache.ant</artifactId>
<type>eclipse-plugin</type>
</dependency>
<dependency>
<artifactId>org.eclipse.equinox.p2.repository.tools</artifactId>
<type>eclipse-plugin</type>
</dependency>
<dependency>
<artifactId>org.eclipse.equinox.p2.core.feature</artifactId>
<type>eclipse-feature</type>
</dependency>
<dependency>
<artifactId>org.eclipse.equinox.p2.extras.feature</artifactId>
<type>eclipse-feature</type>
</dependency>
<dependency>
<artifactId>org.eclipse.equinox.ds</artifactId>
<type>eclipse-plugin</type>
</dependency>
</dependencies>
</configuration>
<executions>
<execution>
<id>add-p2-composite-repository</id>
<phase>package</phase>
<goals>
<goal>eclipse-run</goal>
</goals>
</execution>
</executions>