From eda117e463032d53e1f3bf3ddefaba25db74d5a7 Mon Sep 17 00:00:00 2001 From: Yevhen Vydolob Date: Mon, 25 Feb 2019 14:52:17 +0200 Subject: [PATCH 1/2] #12228 add devfile for dashboard Signed-off-by: Yevhen Vydolob --- dashboard/.devfile | 45 +++++++++++++++++++++ dockerfiles/dashboard-dev/Dockerfile | 23 +++++++++++ dockerfiles/dashboard-dev/README.md | 1 + dockerfiles/dashboard-dev/build.sh | 15 +++++++ dockerfiles/dashboard-dev/src/entrypoint.sh | 29 +++++++++++++ 5 files changed, 113 insertions(+) create mode 100644 dashboard/.devfile create mode 100644 dockerfiles/dashboard-dev/Dockerfile create mode 100644 dockerfiles/dashboard-dev/README.md create mode 100755 dockerfiles/dashboard-dev/build.sh create mode 100755 dockerfiles/dashboard-dev/src/entrypoint.sh diff --git a/dashboard/.devfile b/dashboard/.devfile new file mode 100644 index 00000000000..4ffb8aa7b4d --- /dev/null +++ b/dashboard/.devfile @@ -0,0 +1,45 @@ +specVersion: 0.0.1 +name: dashboard-in-che +projects: + - name: che + source: + type: git + location: 'https://github.com/eclipse/che.git' +tools: + - name: theia-editor + type: cheEditor + id: org.eclipse.che.editor.theia:master + - name: exec-plugin + type: chePlugin + id: che-machine-exec-plugin:0.0.1 + - name: dash-dev + type: dockerimage + image: 'eclipse/che-dashboard-dev:nightly' + endpoints: + - name: dashboard-dev-server + port: 3000 + attributes: + path: / + protocol: http + public: "true" + mountSources: true + memoryLimit: 3Gi +commands: + - name: dashboard_build + actions: + - type: exec + tool: dash-dev + command: cd /projects/che/dashboard && yarn + workdir: /projects/che/dashboard + - name: dashboard_test + actions: + - type: exec + tool: dash-dev + command: cd /projects/che/dashboard && yarn test + workdir: /projects/che/dashboard + - name: dashboard_dev_server + actions: + - type: exec + tool: dash-dev + command: cd /projects/che/dashboard && node_modules/.bin/gulp serve --server=${CHE_API_EXTERNAL%????} + workdir: /projects/che/dashboard diff --git a/dockerfiles/dashboard-dev/Dockerfile b/dockerfiles/dashboard-dev/Dockerfile new file mode 100644 index 00000000000..d515feb05c3 --- /dev/null +++ b/dockerfiles/dashboard-dev/Dockerfile @@ -0,0 +1,23 @@ +# Copyright (c) 2015-2018 Red Hat, Inc. +# This program and the accompanying materials are made +# available under the terms of the Eclipse Public License 2.0 +# which is available at https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# Red Hat, Inc. - initial API and implementation + +FROM node:8.15.0 + +RUN apt-get update && \ + apt-get install -y git \ + && apt-get -y clean \ + && rm -rf /var/lib/apt/lists/* \ + && echo fs.inotify.max_user_watches=524288 | tee -a /etc/sysctl.conf + +WORKDIR "/projects" + +ADD src/entrypoint.sh /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] +CMD tail -f /dev/null diff --git a/dockerfiles/dashboard-dev/README.md b/dockerfiles/dashboard-dev/README.md new file mode 100644 index 00000000000..1a11983a8b2 --- /dev/null +++ b/dockerfiles/dashboard-dev/README.md @@ -0,0 +1 @@ +# Docker file for dashboard dev file diff --git a/dockerfiles/dashboard-dev/build.sh b/dockerfiles/dashboard-dev/build.sh new file mode 100755 index 00000000000..46e29d4e095 --- /dev/null +++ b/dockerfiles/dashboard-dev/build.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# +# Copyright (c) 2019 Red Hat, Inc. +# This program and the accompanying materials are made +# available under the terms of the Eclipse Public License 2.0 +# which is available at https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# + +base_dir=$(cd "$(dirname "$0")"; pwd) +. "${base_dir}"/../build.include + +init --name:dashboard-dev "$@" +build diff --git a/dockerfiles/dashboard-dev/src/entrypoint.sh b/dockerfiles/dashboard-dev/src/entrypoint.sh new file mode 100755 index 00000000000..7ac4e2ea337 --- /dev/null +++ b/dockerfiles/dashboard-dev/src/entrypoint.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# +# Copyright (c) 2018-2018 Red Hat, Inc. +# This program and the accompanying materials are made +# available under the terms of the Eclipse Public License 2.0 +# which is available at https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# Red Hat, Inc. - initial API and implementation +# + +export USER_ID=$(id -u) +export GROUP_ID=$(id -g) +if ! grep -Fq "${USER_ID}" /etc/passwd; then + # current user is an arbitrary + # user (its uid is not in the + # container /etc/passwd). Let's fix that + cat ${HOME}/.passwd.template | \ + sed "s/\${USER_ID}/${USER_ID}/g" | \ + sed "s/\${GROUP_ID}/${GROUP_ID}/g" > /etc/passwd + + cat ${HOME}/.group.template | \ + sed "s/\${USER_ID}/${USER_ID}/g" | \ + sed "s/\${GROUP_ID}/${GROUP_ID}/g" > /etc/group +fi + +exec "$@" From 38925dd2929da4f04073c8062f86a4190fdeedc7 Mon Sep 17 00:00:00 2001 From: Yevhen Vydolob Date: Tue, 26 Feb 2019 10:45:04 +0200 Subject: [PATCH 2/2] #12228 fix license date Signed-off-by: Yevhen Vydolob --- dockerfiles/dashboard-dev/Dockerfile | 2 +- dockerfiles/dashboard-dev/src/entrypoint.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dockerfiles/dashboard-dev/Dockerfile b/dockerfiles/dashboard-dev/Dockerfile index d515feb05c3..f64847b9e4a 100644 --- a/dockerfiles/dashboard-dev/Dockerfile +++ b/dockerfiles/dashboard-dev/Dockerfile @@ -1,4 +1,4 @@ -# Copyright (c) 2015-2018 Red Hat, Inc. +# Copyright (c) 2019 Red Hat, Inc. # This program and the accompanying materials are made # available under the terms of the Eclipse Public License 2.0 # which is available at https://www.eclipse.org/legal/epl-2.0/ diff --git a/dockerfiles/dashboard-dev/src/entrypoint.sh b/dockerfiles/dashboard-dev/src/entrypoint.sh index 7ac4e2ea337..5963897959d 100755 --- a/dockerfiles/dashboard-dev/src/entrypoint.sh +++ b/dockerfiles/dashboard-dev/src/entrypoint.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2018-2018 Red Hat, Inc. +# Copyright (c) 2019 Red Hat, Inc. # This program and the accompanying materials are made # available under the terms of the Eclipse Public License 2.0 # which is available at https://www.eclipse.org/legal/epl-2.0/