Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dashboard: scripts refactored, unit tests enabled #12923

Merged
merged 1 commit into from
Mar 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dashboard/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Red Hat, Inc. - initial API and implementation

# This is a Dockerfile allowing to build dashboard by using a docker container.
# Build step: $ docker build -t eclipse-che-dashboard
# Build step: $ docker build -t eclipse-che-dashboard .
# It builds an archive file that can be used by doing later
# $ docker run --rm eclipse-che-dashboard | tar -C target/ -zxf -
FROM node:8.10.0
Expand All @@ -20,9 +20,9 @@ RUN apt-get update && \
&& rm -rf /var/lib/apt/lists/*
COPY package.json /dashboard/
COPY yarn.lock /dashboard/
RUN cd /dashboard && npm i yarn && npx yarn install --ignore-scripts
RUN cd /dashboard && npx yarn install
olexii4 marked this conversation as resolved.
Show resolved Hide resolved
COPY . /dashboard/
RUN cd /dashboard && npx yarn
RUN cd /dashboard && yarn build && yarn test
RUN cd /dashboard && cd target/ && tar zcf /tmp/dashboard.tar.gz dist/

CMD zcat /tmp/dashboard.tar.gz
2 changes: 1 addition & 1 deletion dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"node": ">=0.10.0"
},
"scripts": {
"postinstall": "yarn run typings && yarn run build",
"postinstall": "yarn run typings",
"typings": "typings install",
"build": "gulp build",
"test": "gulp test"
Expand Down
17 changes: 8 additions & 9 deletions dashboard/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -197,17 +197,17 @@
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>install-yarn</id>
<id>install-deps</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- install yarn -->
<exec dir="${basedir}" executable="npm" failonerror="true">
<arg value="install" />
<!-- install dependencies -->
<exec dir="${basedir}" executable="npx" failonerror="true">
<arg value="yarn" />
<arg value="install" />
</exec>
</target>
</configuration>
Expand All @@ -221,8 +221,8 @@
<configuration>
<target>
<!-- build user dashboard -->
<exec dir="${basedir}" executable="node_modules/yarn/bin/yarn" failonerror="true">
<arg value="install" />
<exec dir="${basedir}" executable="node_modules/.bin/yarn" failonerror="true">
<arg value="build" />
</exec>
<!-- Change base HREF of the application that will be hosted on /dashboard -->
<replace file="${basedir}/target/dist/index.html">
Expand All @@ -233,16 +233,15 @@
</configuration>
</execution>
<execution>
<id>compilation</id>
<id>test-dashboard</id>
<phase>test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target unless="skipTests">
<!-- Run unit tests -->
<exec dir="${basedir}" executable="node_modules/yarn/bin/yarn" failonerror="true">
<arg value="run" />
<exec dir="${basedir}" executable="node_modules/.bin/yarn" failonerror="true">
<arg value="test" />
</exec>
</target>
Expand Down