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"/> <booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
<stringAttribute key="M2_USER_SETTINGS" value=""/> <stringAttribute key="M2_USER_SETTINGS" value=""/>
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="true"/> <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"/> <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}"/> <stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${project_loc:com.minres.scviewer.parent}"/>
</launchConfiguration> </launchConfiguration>

View File

@ -29,6 +29,8 @@
<tycho-version>1.5.0</tycho-version> <tycho-version>1.5.0</tycho-version>
<groovy-eclipse-compiler-version>3.6.0-03</groovy-eclipse-compiler-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> <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> </properties>
<build> <build>

View File

@ -3,3 +3,4 @@
/artifacts.jar /artifacts.jar
/content.jar /content.jar
/target/ /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

@ -10,19 +10,20 @@
<version>2.15.0</version> <version>2.15.0</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<build> <build>
<plugins> <plugins>
<!-- make sure that zipped p2 repositories have the fully qualified version --> <!-- make sure that zipped p2 repositories have the fully qualified version -->
<plugin> <plugin>
<groupId>org.eclipse.tycho</groupId> <groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-repository-plugin</artifactId> <artifactId>tycho-p2-repository-plugin</artifactId>
<version>${tycho-version}</version> <version>${tycho-version}</version>
<configuration> <configuration>
<finalName>${project.artifactId}-${qualifiedVersion}</finalName> <finalName>${project.artifactId}-${qualifiedVersion}</finalName>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<profiles> <profiles>
<profile> <profile>
<!-- Activate this profile to perform the release to Bintray --> <!-- Activate this profile to perform the release to Bintray -->
@ -33,38 +34,78 @@
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>com.carrotgarden.maven</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>bintray-maven-plugin</artifactId> <artifactId>exec-maven-plugin</artifactId>
<version>1.5.20191113165555</version> <version>3.0.0</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>
<executions> <executions>
<!-- Activate "bintray:upload" during "package" -->
<execution> <execution>
<phase>package</phase> <phase>package</phase>
<goals> <goals>
<goal>upload</goal> <goal>exec</goal>
</goals> </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> </execution>
</executions> </executions>
</plugin> </plugin>