Unverified Commit cec13965 authored by femiadeyemi's avatar femiadeyemi Committed by GitHub
Browse files

add build and release process

Motivation:

Since this project will be a dependency for other projects we are
working on, we need a well managed artifact creation. Also, the
deployment and releases of this artifact is necessity for this project.
We will be using Apache maven which is a well established and
robust software project management tool.

Modification:

- create a custom assembly descriptor called `hmw.xml` which is used
    by maven-assembly-plugin for easy build distribution.
- add a javascript module bundler called `rollup` to optimise code for
    production and minifies JS, html and lit-html templates.
- add support for build, release and deploy processes in the `pom.xml`
    file.

Result:

- a new artifact can be created for a new version
- easily deploy artifact to the dcache nexus repositories

Pull-request: #7
Acked-by: Carsten Heidmann 
parent 882d1178
<assembly>
<id>helmholtz-marketplace-webapp</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<excludes>
<exclude>*:jar</exclude>
<exclude>archive-tmp</exclude>
</excludes>
</fileSet>
</fileSets>
</assembly>
This diff is collapsed.
......@@ -10,19 +10,25 @@
"test:coverage": "karma start --coverage",
"test:watch": "karma start --auto-watch=true --single-run=false",
"posttest": "node ci-analysis.js",
"start": "es-dev-server --app-index index.html --node-resolve --open --watch"
"build": "rimraf target && rollup -c rollup.config.js",
"start": "es-dev-server --app-index index.html --node-resolve --open --watch",
"start:build": "npm run build && es-dev-server --root-dir target --app-index index.html --open --compatibility none"
},
"devDependencies": {
"eslint": "^6.1.0",
"@open-wc/building-rollup": "^1.0.0",
"@open-wc/eslint-config": "^2.0.0",
"prettier": "^2.0.4",
"eslint-config-prettier": "^6.11.0",
"husky": "^1.0.0",
"lint-staged": "^8.0.0",
"@open-wc/testing": "^2.0.0",
"@open-wc/testing-karma": "^3.0.0",
"deepmerge": "^3.2.0",
"@open-wc/testing": "^2.0.0",
"es-dev-server": "^1.5.0",
"eslint": "^6.1.0",
"eslint-config-prettier": "^6.11.0",
"husky": "^1.0.0",
"lint-staged": "^8.0.0",
"prettier": "^2.0.4",
"rimraf": "^2.6.3",
"rollup": "^2.3.4",
"rollup-plugin-copy": "^3.3.0",
"sonarqube-scanner": "^2.6.0"
},
"eslintConfig": {
......
<?xml version="1.0" encoding="UTF-8"?>
<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">
......@@ -16,12 +17,67 @@
<url>https://www.helmholtz.de</url>
</organization>
<licenses>
<license>
<name>GNU Affero General Public License Version 3</name>
<url>http://www.gnu.org/licenses/agpl-3.0.txt</url>
<distribution>manual</distribution>
</license>
</licenses>
<distributionManagement>
<downloadUrl>https://download.dcache.org/nexus/content/repositories/releases/</downloadUrl>
<repository>
<uniqueVersion>false</uniqueVersion>
<id>hifis.release.repository</id>
<name>HIFIS release repository</name>
<url>https://download.dcache.org/nexus/content/repositories/releases/</url>
<layout>default</layout>
</repository>
<snapshotRepository>
<uniqueVersion>true</uniqueVersion>
<id>hifis.snapshot.repository</id>
<name>HIFIS snapshot repository</name>
<url>https://download.dcache.org/nexus/content/repositories/snapshots/</url>
<layout>default</layout>
</snapshotRepository>
</distributionManagement>
<issueManagement>
<system>GitHub</system>
<url>https://github.com/helmholtz-marketplace/helmholtz-marketplace-webapp/issues/</url>
</issueManagement>
<scm>
<url>https://github.com/helmholtz-marketplace/helmholtz-marketplace-webapp</url>
<connection>scm:git:https://github.com/helmholtz-marketplace/helmholtz-marketplace-webapp.git</connection>
<developerConnection>scm:git:ssh://git@github.com:helmholtz-marketplace/helmholtz-marketplace-webapp.git</developerConnection>
<tag>HEAD</tag>
</scm>
<repositories>
<repository>
<id>hifis.repository</id>
<url>https://download.dcache.org/nexus/content/groups/public</url>
</repository>
</repositories>
<properties>
<java.version>11</java.version>
<version.frontend-maven>1.9.1</version.frontend-maven>
<version.node>v12.16.1</version.node>
<version.npm>6.14.2</version.npm>
<version.maven-install-plugin>2.5.2</version.maven-install-plugin>
<version.maven-release-plugin>2.5.3</version.maven-release-plugin>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.9.1</version>
<version>${version.frontend-maven}</version>
<executions>
<execution>
......@@ -30,8 +86,8 @@
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v12.16.1</nodeVersion>
<npmVersion>6.14.2</npmVersion>
<nodeVersion>${version.node}</nodeVersion>
<npmVersion>${version.npm}</npmVersion>
</configuration>
</execution>
......@@ -46,6 +102,16 @@
</configuration>
</execution>
<execution>
<id>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
<execution>
<id>unit and integration tests</id>
<goals>
......@@ -55,7 +121,58 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>hmw.xml</descriptor>
</descriptors>
<finalName>${project.artifactId}-${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>${version.maven-install-plugin}</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>target/${project.artifactId}-${project.version}.jar</file>
<groupId>de.helmholtz.marketplace</groupId>
<artifactId>${project.artifactId}</artifactId>
<packaging>jar</packaging>
<pomFile>pom.xml</pomFile>
<version>${project.version}</version>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${version.maven-release-plugin}</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<tagNameFormat>v@{project.version}</tagNameFormat>
</configuration>
</plugin>
</plugins>
</build>
</project>
import merge from 'deepmerge';
import copy from 'rollup-plugin-copy';
import { createSpaConfig } from '@open-wc/building-rollup';
const baseConfig = createSpaConfig({
outputDir: 'target',
developmentMode: process.env.ROLLUP_WATCH === 'true',
injectServiceWorker: false,
});
export default merge(baseConfig, {
input: './index.html',
plugins: [
copy({
targets: [{ src: ['images', 'styles'], dest: 'target' }],
flatten: false,
}),
],
});
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment