Skip to content

Commit

Permalink
Workspace loader (eclipse-che#8838)
Browse files Browse the repository at this point in the history
Adding workspace loader application.
  • Loading branch information
Vitaliy Guliy authored and ashumilova committed Mar 5, 2018
0 parents commit 7698eaa
Show file tree
Hide file tree
Showing 24 changed files with 2,078 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Dockerfile
node_modules
target
dist
package-lock.json
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
dist/
package-lock.json
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright (c) 2018-2018 Red Hat, Inc
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html

# This is a Dockerfile allowing to build workspace loader by using a docker container.
# Build step: $ docker build -t eclipse-che-workspace-loader .
# It builds an archive file that can be used by doing later
# $ docker run --rm eclipse-che-workspace-loader | tar -C target/ -zxf -
FROM node:6.11.2

COPY package.json /workspace-loader/
RUN cd /workspace-loader && npm install

COPY . /workspace-loader/

RUN cd /workspace-loader && \
npm run build && \
npm run test && \
cd target && \
tar zcf /tmp/workspace-loader.tar.gz dist

CMD zcat /tmp/workspace-loader.tar.gz
24 changes: 24 additions & 0 deletions assembly.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--
Copyright (c) 2018-2018 Red Hat, Inc.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
Red Hat, Inc. - initial API and implementation
-->
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>workspace-loader-zip</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${project.basedir}/target/dist</directory>
<outputDirectory>/loader</outputDirectory>
</fileSet>
</fileSets>
</assembly>
44 changes: 44 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "che-workspace-loader",
"version": "1.0.0",
"description": "Eclipse Che Workspace Loader App",
"main": "index.js",
"scripts": {
"test": "jest",
"build": "webpack --config webpack.prod.js",
"start": "webpack-dev-server --open --config webpack.dev.js"
},
"author": "",
"license": "EPL-1.0",
"devDependencies": {
"@types/jest": "^22.1.3",
"clean-webpack-plugin": "^0.1.18",
"css-loader": "^0.28.9",
"extract-text-webpack-plugin": "^3.0.2",
"html-webpack-plugin": "^2.30.1",
"jest": "^22.4.2",
"style-loader": "^0.20.1",
"ts-loader": "^3.4.0",
"typescript": "^2.7.1",
"uglifyjs-webpack-plugin": "^1.1.8",
"webpack": "^3.10.0",
"webpack-dev-server": "^2.11.1",
"webpack-merge": "^4.1.1"
},
"dependencies": {},
"jest": {
"moduleFileExtensions": [
"ts",
"js"
],
"transform": {
"^.+\\.(ts)$": "<rootDir>/test/preprocessor.js"
},
"moduleNameMapper": {
"\\.(css|less)$": "<rootDir>/test/mock.js"
},
"testMatch": [
"**/test/*.(ts)"
]
}
}
177 changes: 177 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2018-2018 Red Hat, Inc.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
Red Hat, Inc. - initial API and implementation
-->
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>che-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>6.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>org.eclipse.che.workspace.loader</groupId>
<artifactId>che-workspace-loader</artifactId>
<version>6.2.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Che Workspace Loader :: Web App</name>
<inceptionYear>2018</inceptionYear>
<build>
<finalName>workspace-loader</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<tarLongFileMode>posix</tarLongFileMode>
<appendAssemblyId>false</appendAssemblyId>
<updateOnly>false</updateOnly>
<descriptors>
<descriptor>${project.basedir}/assembly.xml</descriptor>
</descriptors>
<finalName>workspace-loader</finalName>
</configuration>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>${basedir}/node_modules</directory>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${basedir}/dist</directory>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${basedir}</directory>
<includes>
<include>**/package-lock.json</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<!-- Docker build used by default. To use native build, use -Pnative -->
<id>docker</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>build-image</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- build workspace loader with maven in docker -->
<exec dir="${basedir}" executable="docker" failonerror="true">
<arg value="build" />
<arg value="-t" />
<arg value="eclipse-che-workspace-loader" />
<arg value="." />
</exec>
</target>
</configuration>
</execution>
<execution>
<id>unpack-docker-build</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- extract built workspace loader -->
<exec executable="bash">
<arg value="-c" />
<arg value="docker run --rm eclipse-che-workspace-loader | tar -C target/ -xf -" />
</exec>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>native</id>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>build-workspace-loader</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- install node modules -->
<exec dir="${basedir}" executable="npm" failonerror="true">
<arg value="install" />
</exec>
<!-- build workspace loader -->
<exec dir="${basedir}" executable="npm" failonerror="true">
<arg value="run" />
<arg value="build" />
</exec>
</target>
</configuration>
</execution>
<execution>
<id>test-workspace-loader</id>
<phase>test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- test workspace loader -->
<exec dir="${basedir}" executable="npm" failonerror="true">
<arg value="run" />
<arg value="test" />
</exec>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Loading

0 comments on commit 7698eaa

Please sign in to comment.