diff --git a/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ls.json.json b/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ls.json.json index 24fe484966..697c366805 100644 --- a/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ls.json.json +++ b/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ls.json.json @@ -5,5 +5,5 @@ "dependencies": [], "properties": { }, -"script" : "#\n# Copyright (c) 2012-2016 Codenvy, S.A.\n# All rights reserved. This program and the accompanying materials\n# are made available under the terms of the Eclipse Public License v1.0\n# which accompanies this distribution, and is available at\n# http://www.eclipse.org/legal/epl-v10.html\n#\n# Contributors:\n# Codenvy, S.A. - initial API and implementation\n#\n\nunset PACKAGES\nunset SUDO\ncommand -v tar >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" tar\"; }\ncommand -v curl >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" curl\"; }\ntest \"$(id -u)\" = 0 || SUDO=\"sudo\"\n\nAGENT_BINARIES_URI=https://codenvy.com/update/repository/public/download/org.eclipse.che.ls.json.binaries\nCHE_DIR=$HOME/che\nLS_DIR=${CHE_DIR}/ls-json\nLS_LAUNCHER=${LS_DIR}/launch.sh\n\nif [ -f /etc/centos-release ]; then\n FILE=\"/etc/centos-release\"\n LINUX_TYPE=$(cat $FILE | awk '{print $1}')\n elif [ -f /etc/redhat-release ]; then\n FILE=\"/etc/redhat-release\"\n LINUX_TYPE=$(cat $FILE | cut -c 1-8)\n else\n FILE=\"/etc/os-release\"\n LINUX_TYPE=$(cat $FILE | grep ^ID= | tr '[:upper:]' '[:lower:]')\n LINUX_VERSION=$(cat $FILE | grep ^VERSION_ID=)\nfi\n\nMACHINE_TYPE=$(uname -m)\n\nmkdir -p ${CHE_DIR}\nmkdir -p ${LS_DIR}\n\n########################\n### Install packages ###\n########################\n\n# Red Hat Enterprise Linux 7\n############################\nif echo ${LINUX_TYPE} | grep -qi \"rhel\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} yum -y install nodejs;\n }\n\n# Red Hat Enterprise Linux 6\n############################\nelif echo ${LINUX_TYPE} | grep -qi \"Red Hat\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} yum -y install nodejs;\n }\n\n\n# Ubuntu 14.04 16.04 / Linux Mint 17\n####################################\nelif echo ${LINUX_TYPE} | grep -qi \"ubuntu\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n {\n if test \"${SUDO}\" = \"\"; then\n curl -sL https://deb.nodesource.com/setup_6.x | bash -;\n else\n curl -sL https://deb.nodesource.com/setup_6.x | ${SUDO} -E bash -;\n fi\n };\n\n ${SUDO} apt-get update;\n ${SUDO} apt-get install -y nodejs;\n }\n\n\n# Debian 8\n##########\nelif echo ${LINUX_TYPE} | grep -qi \"debian\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n {\n if test \"${SUDO}\" = \"\"; then\n curl -sL https://deb.nodesource.com/setup_6.x | bash -;\n else\n curl -sL https://deb.nodesource.com/setup_6.x | ${SUDO} -E bash -;\n fi\n };\n\n ${SUDO} apt-get update;\n ${SUDO} apt-get install -y nodejs;\n }\n\n# Fedora 23\n###########\nelif echo ${LINUX_TYPE} | grep -qi \"fedora\"; then\n PACKAGES=${PACKAGES}\" procps-ng\"\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} dnf -y install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} dnf -y install nodejs;\n }\n\n\n# CentOS 7.1 & Oracle Linux 7.1\n###############################\nelif echo ${LINUX_TYPE} | grep -qi \"centos\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} yum -y install nodejs;\n }\n\n# openSUSE 13.2\n###############\nelif echo ${LINUX_TYPE} | grep -qi \"opensuse\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} zypper install -y ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n ${SUDO} zypper ar http://download.opensuse.org/repositories/devel:/languages:/nodejs/openSUSE_13.1/ Node.js\n ${SUDO} zypper in nodejs\n }\n\nelse\n >&2 echo \"Unrecognized Linux Type\"\n >&2 cat $FILE\n exit 1\nfi\n\n\n#####################\n### Install C# LS ###\n#####################\n\ncurl -s ${AGENT_BINARIES_URI} | tar xzf - -C ${LS_DIR}\n\ntouch ${LS_LAUNCHER}\nchmod +x ${LS_LAUNCHER}\necho \"nodejs ${LS_DIR}/vscode-json-server/server.js\" > ${LS_LAUNCHER}" +"script" : "#\n# Copyright (c) 2012-2016 Codenvy, S.A.\n# All rights reserved. This program and the accompanying materials\n# are made available under the terms of the Eclipse Public License v1.0\n# which accompanies this distribution, and is available at\n# http://www.eclipse.org/legal/epl-v10.html\n#\n# Contributors:\n# Codenvy, S.A. - initial API and implementation\n#\n\nunset PACKAGES\nunset SUDO\ncommand -v tar >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" tar\"; }\ncommand -v curl >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" curl\"; }\ntest \"$(id -u)\" = 0 || SUDO=\"sudo\"\n\nAGENT_BINARIES_URI=https://codenvy.com/update/repository/public/download/org.eclipse.che.ls.json.binaries\nCHE_DIR=$HOME/che\nLS_DIR=${CHE_DIR}/ls-json\nLS_LAUNCHER=${LS_DIR}/launch.sh\n\nif [ -f /etc/centos-release ]; then\n FILE=\"/etc/centos-release\"\n LINUX_TYPE=$(cat $FILE | awk '{print $1}')\n elif [ -f /etc/redhat-release ]; then\n FILE=\"/etc/redhat-release\"\n LINUX_TYPE=$(cat $FILE | cut -c 1-8)\n else\n FILE=\"/etc/os-release\"\n LINUX_TYPE=$(cat $FILE | grep ^ID= | tr '[:upper:]' '[:lower:]')\n LINUX_VERSION=$(cat $FILE | grep ^VERSION_ID=)\nfi\n\nMACHINE_TYPE=$(uname -m)\n\nmkdir -p ${CHE_DIR}\nmkdir -p ${LS_DIR}\n\n########################\n### Install packages ###\n########################\n\n# Red Hat Enterprise Linux 7\n############################\nif echo ${LINUX_TYPE} | grep -qi \"rhel\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} yum -y install nodejs;\n }\n\n# Red Hat Enterprise Linux 6\n############################\nelif echo ${LINUX_TYPE} | grep -qi \"Red Hat\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} yum -y install nodejs;\n }\n\n\n# Ubuntu 14.04 16.04 / Linux Mint 17\n####################################\nelif echo ${LINUX_TYPE} | grep -qi \"ubuntu\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n {\n if test \"${SUDO}\" = \"\"; then\n curl -sL https://deb.nodesource.com/setup_6.x | bash -;\n else\n curl -sL https://deb.nodesource.com/setup_6.x | ${SUDO} -E bash -;\n fi\n };\n\n ${SUDO} apt-get update;\n ${SUDO} apt-get install -y nodejs;\n }\n\n\n# Debian 8\n##########\nelif echo ${LINUX_TYPE} | grep -qi \"debian\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n {\n if test \"${SUDO}\" = \"\"; then\n curl -sL https://deb.nodesource.com/setup_6.x | bash -;\n else\n curl -sL https://deb.nodesource.com/setup_6.x | ${SUDO} -E bash -;\n fi\n };\n\n ${SUDO} apt-get update;\n ${SUDO} apt-get install -y nodejs;\n }\n\n# Fedora 23\n###########\nelif echo ${LINUX_TYPE} | grep -qi \"fedora\"; then\n command -v ps >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" procps-ng\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} dnf -y install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} dnf -y install nodejs;\n }\n\n\n# CentOS 7.1 & Oracle Linux 7.1\n###############################\nelif echo ${LINUX_TYPE} | grep -qi \"centos\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} yum -y install nodejs;\n }\n\n# openSUSE 13.2\n###############\nelif echo ${LINUX_TYPE} | grep -qi \"opensuse\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} zypper install -y ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n ${SUDO} zypper ar http://download.opensuse.org/repositories/devel:/languages:/nodejs/openSUSE_13.1/ Node.js\n ${SUDO} zypper in nodejs\n }\n\nelse\n >&2 echo \"Unrecognized Linux Type\"\n >&2 cat $FILE\n exit 1\nfi\n\n\n#####################\n### Install C# LS ###\n#####################\n\ncurl -s ${AGENT_BINARIES_URI} | tar xzf - -C ${LS_DIR}\n\ntouch ${LS_LAUNCHER}\nchmod +x ${LS_LAUNCHER}\necho \"nodejs ${LS_DIR}/vscode-json-server/server.js\" > ${LS_LAUNCHER}" } diff --git a/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ls.php.json b/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ls.php.json index 49f8994c3e..8ef2435522 100644 --- a/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ls.php.json +++ b/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ls.php.json @@ -4,5 +4,5 @@ "description": "PHP intellisense", "dependencies": [], "properties": {}, -"script" : "#\n# Copyright (c) 2012-2016 Codenvy, S.A.\n# All rights reserved. This program and the accompanying materials\n# are made available under the terms of the Eclipse Public License v1.0\n# which accompanies this distribution, and is available at\n# http://www.eclipse.org/legal/epl-v10.html\n#\n# Contributors:\n# Codenvy, S.A. - initial API and implementation\n#\n\nunset PACKAGES\nunset SUDO\ncommand -v tar >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" tar\"; }\ncommand -v curl >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" curl\"; }\ntest \"$(id -u)\" = 0 || SUDO=\"sudo\"\n\nAGENT_BINARIES_URI=https://codenvy.com/update/repository/public/download/org.eclipse.che.ls.php.binaries\nCHE_DIR=$HOME/che\nLS_DIR=${CHE_DIR}/ls-php\nLS_LAUNCHER=${LS_DIR}/launch.sh\n\nif [ -f /etc/centos-release ]; then\n FILE=\"/etc/centos-release\"\n LINUX_TYPE=$(cat $FILE | awk '{print $1}')\n elif [ -f /etc/redhat-release ]; then\n FILE=\"/etc/redhat-release\"\n LINUX_TYPE=$(cat $FILE | cut -c 1-8)\n else\n FILE=\"/etc/os-release\"\n LINUX_TYPE=$(cat $FILE | grep ^ID= | tr '[:upper:]' '[:lower:]')\n LINUX_VERSION=$(cat $FILE | grep ^VERSION_ID=)\nfi\n\nMACHINE_TYPE=$(uname -m)\n\nmkdir -p ${CHE_DIR}\nmkdir -p ${LS_DIR}\n\n########################\n### Install packages ###\n########################\n\n# Red Hat Enterprise Linux 7\n############################\nif echo ${LINUX_TYPE} | grep -qi \"rhel\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum install ${PACKAGES};\n }\n\n# Red Hat Enterprise Linux 6\n############################\nelif echo ${LINUX_TYPE} | grep -qi \"Red Hat\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum install ${PACKAGES};\n }\n\n# Ubuntu 14.04 16.04 / Linux Mint 17\n####################################\nelif echo ${LINUX_TYPE} | grep -qi \"ubuntu\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n\n# Debian 8\n##########\nelif echo ${LINUX_TYPE} | grep -qi \"debian\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n# Fedora 23\n###########\nelif echo ${LINUX_TYPE} | grep -qi \"fedora\"; then\n PACKAGES=${PACKAGES}\" procps-ng\"\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} dnf -y install ${PACKAGES};\n }\n\n\n# CentOS 7.1 & Oracle Linux 7.1\n###############################\nelif echo ${LINUX_TYPE} | grep -qi \"centos\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n\n# openSUSE 13.2\n###############\nelif echo ${LINUX_TYPE} | grep -qi \"opensuse\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} zypper install -y ${PACKAGES};\n }\n\nelse\n >&2 echo \"Unrecognized Linux Type\"\n >&2 cat /etc/os-release\n exit 1\nfi\n\n\n######################\n### Install PHP LS ###\n######################\n\ncurl -s ${AGENT_BINARIES_URI} | tar xzf - -C ${LS_DIR}\n\ntouch ${LS_LAUNCHER}\nchmod +x ${LS_LAUNCHER}\necho \"export LD_LIBRARY_PATH=${LS_DIR}/php7-minimal\" > ${LS_LAUNCHER}\necho \"${LS_DIR}/php7-minimal/php -c ${LS_DIR}/php7-minimal/php.ini ${LS_DIR}/php-language-server/bin/php-language-server.php\" >> ${LS_LAUNCHER}" +"script" : "#\n# Copyright (c) 2012-2016 Codenvy, S.A.\n# All rights reserved. This program and the accompanying materials\n# are made available under the terms of the Eclipse Public License v1.0\n# which accompanies this distribution, and is available at\n# http://www.eclipse.org/legal/epl-v10.html\n#\n# Contributors:\n# Codenvy, S.A. - initial API and implementation\n#\n\nunset PACKAGES\nunset SUDO\ncommand -v tar >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" tar\"; }\ncommand -v curl >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" curl\"; }\ntest \"$(id -u)\" = 0 || SUDO=\"sudo\"\n\nAGENT_BINARIES_URI=https://codenvy.com/update/repository/public/download/org.eclipse.che.ls.php.binaries\nCHE_DIR=$HOME/che\nLS_DIR=${CHE_DIR}/ls-php\nLS_LAUNCHER=${LS_DIR}/launch.sh\n\nif [ -f /etc/centos-release ]; then\n FILE=\"/etc/centos-release\"\n LINUX_TYPE=$(cat $FILE | awk '{print $1}')\n elif [ -f /etc/redhat-release ]; then\n FILE=\"/etc/redhat-release\"\n LINUX_TYPE=$(cat $FILE | cut -c 1-8)\n else\n FILE=\"/etc/os-release\"\n LINUX_TYPE=$(cat $FILE | grep ^ID= | tr '[:upper:]' '[:lower:]')\n LINUX_VERSION=$(cat $FILE | grep ^VERSION_ID=)\nfi\n\nMACHINE_TYPE=$(uname -m)\n\nmkdir -p ${CHE_DIR}\nmkdir -p ${LS_DIR}\n\n########################\n### Install packages ###\n########################\n\n# Red Hat Enterprise Linux 7\n############################\nif echo ${LINUX_TYPE} | grep -qi \"rhel\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum install ${PACKAGES};\n }\n\n# Red Hat Enterprise Linux 6\n############################\nelif echo ${LINUX_TYPE} | grep -qi \"Red Hat\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum install ${PACKAGES};\n }\n\n# Ubuntu 14.04 16.04 / Linux Mint 17\n####################################\nelif echo ${LINUX_TYPE} | grep -qi \"ubuntu\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n\n# Debian 8\n##########\nelif echo ${LINUX_TYPE} | grep -qi \"debian\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n# Fedora 23\n###########\nelif echo ${LINUX_TYPE} | grep -qi \"fedora\"; then\n command -v ps >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" procps-ng\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} dnf -y install ${PACKAGES};\n }\n\n\n# CentOS 7.1 & Oracle Linux 7.1\n###############################\nelif echo ${LINUX_TYPE} | grep -qi \"centos\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n\n# openSUSE 13.2\n###############\nelif echo ${LINUX_TYPE} | grep -qi \"opensuse\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} zypper install -y ${PACKAGES};\n }\n\nelse\n >&2 echo \"Unrecognized Linux Type\"\n >&2 cat /etc/os-release\n exit 1\nfi\n\n\n######################\n### Install PHP LS ###\n######################\n\ncurl -s ${AGENT_BINARIES_URI} | tar xzf - -C ${LS_DIR}\n\ntouch ${LS_LAUNCHER}\nchmod +x ${LS_LAUNCHER}\necho \"export LD_LIBRARY_PATH=${LS_DIR}/php7-minimal\" > ${LS_LAUNCHER}\necho \"${LS_DIR}/php7-minimal/php -c ${LS_DIR}/php7-minimal/php.ini ${LS_DIR}/php-language-server/bin/php-language-server.php\" >> ${LS_LAUNCHER}" } diff --git a/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ls.typescript.json b/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ls.typescript.json index a8922a5a8b..cf6e991197 100644 --- a/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ls.typescript.json +++ b/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ls.typescript.json @@ -5,5 +5,5 @@ "dependencies": [], "properties": { }, -"script" : "#\n# Copyright (c) 2012-2016 Codenvy, S.A.\n# All rights reserved. This program and the accompanying materials\n# are made available under the terms of the Eclipse Public License v1.0\n# which accompanies this distribution, and is available at\n# http://www.eclipse.org/legal/epl-v10.html\n#\n# Contributors:\n# Codenvy, S.A. - initial API and implementation\n#\n\nunset PACKAGES\nunset SUDO\ncommand -v tar >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" tar\"; }\ncommand -v curl >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" curl\"; }\ntest \"$(id -u)\" = 0 || SUDO=\"sudo\"\n\nAGENT_BINARIES_URI=https://codenvy.com/update/repository/public/download/org.eclipse.che.ls.typescript.binaries\nCHE_DIR=$HOME/che\nLS_DIR=${CHE_DIR}/ls-typescript\nLS_LAUNCHER=${LS_DIR}/launch.sh\n\nif [ -f /etc/centos-release ]; then\n FILE=\"/etc/centos-release\"\n LINUX_TYPE=$(cat $FILE | awk '{print $1}')\n elif [ -f /etc/redhat-release ]; then\n FILE=\"/etc/redhat-release\"\n LINUX_TYPE=$(cat $FILE | cut -c 1-8)\n else\n FILE=\"/etc/os-release\"\n LINUX_TYPE=$(cat $FILE | grep ^ID= | tr '[:upper:]' '[:lower:]')\n LINUX_VERSION=$(cat $FILE | grep ^VERSION_ID=)\nfi\n\nMACHINE_TYPE=$(uname -m)\n\nmkdir -p ${CHE_DIR}\nmkdir -p ${LS_DIR}\n\n########################\n### Install packages ###\n########################\n\n# Red Hat Enterprise Linux 7\n############################\nif echo ${LINUX_TYPE} | grep -qi \"rhel\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} yum -y install nodejs;\n }\n\n# Red Hat Enterprise Linux 6\n############################\nelif echo ${LINUX_TYPE} | grep -qi \"Red Hat\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} yum -y install nodejs;\n }\n\n\n# Ubuntu 14.04 16.04 / Linux Mint 17\n####################################\nelif echo ${LINUX_TYPE} | grep -qi \"ubuntu\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n {\n if test \"${SUDO}\" = \"\"; then\n curl -sL https://deb.nodesource.com/setup_6.x | bash -;\n else\n curl -sL https://deb.nodesource.com/setup_6.x | ${SUDO} -E bash -;\n fi\n };\n\n ${SUDO} apt-get update;\n ${SUDO} apt-get install -y nodejs;\n }\n\n\n# Debian 8\n##########\nelif echo ${LINUX_TYPE} | grep -qi \"debian\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n {\n if test \"${SUDO}\" = \"\"; then\n curl -sL https://deb.nodesource.com/setup_6.x | bash -;\n else\n curl -sL https://deb.nodesource.com/setup_6.x | ${SUDO} -E bash -;\n fi\n };\n\n ${SUDO} apt-get update;\n ${SUDO} apt-get install -y nodejs;\n }\n\n# Fedora 23\n###########\nelif echo ${LINUX_TYPE} | grep -qi \"fedora\"; then\n PACKAGES=${PACKAGES}\" procps-ng\"\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} dnf -y install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} dnf -y install nodejs;\n }\n\n\n# CentOS 7.1 & Oracle Linux 7.1\n###############################\nelif echo ${LINUX_TYPE} | grep -qi \"centos\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} yum -y install nodejs;\n }\n\n# openSUSE 13.2\n###############\nelif echo ${LINUX_TYPE} | grep -qi \"opensuse\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} zypper install -y ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n ${SUDO} zypper ar http://download.opensuse.org/repositories/devel:/languages:/nodejs/openSUSE_13.1/ Node.js\n ${SUDO} zypper in nodejs\n }\n\nelse\n >&2 echo \"Unrecognized Linux Type\"\n >&2 cat $FILE\n exit 1\nfi\n\n\n########################\n### Install JS-TS LS ###\n########################\n\ncurl -s ${AGENT_BINARIES_URI} | tar xzf - -C ${LS_DIR}\n\ntouch ${LS_LAUNCHER}\nchmod +x ${LS_LAUNCHER}\necho \"nodejs ${LS_DIR}/build/language-server-stdio.js\" > ${LS_LAUNCHER}" +"script" : "#\n# Copyright (c) 2012-2016 Codenvy, S.A.\n# All rights reserved. This program and the accompanying materials\n# are made available under the terms of the Eclipse Public License v1.0\n# which accompanies this distribution, and is available at\n# http://www.eclipse.org/legal/epl-v10.html\n#\n# Contributors:\n# Codenvy, S.A. - initial API and implementation\n#\n\nunset PACKAGES\nunset SUDO\ncommand -v tar >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" tar\"; }\ncommand -v curl >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" curl\"; }\ntest \"$(id -u)\" = 0 || SUDO=\"sudo\"\n\nAGENT_BINARIES_URI=https://codenvy.com/update/repository/public/download/org.eclipse.che.ls.typescript.binaries\nCHE_DIR=$HOME/che\nLS_DIR=${CHE_DIR}/ls-typescript\nLS_LAUNCHER=${LS_DIR}/launch.sh\n\nif [ -f /etc/centos-release ]; then\n FILE=\"/etc/centos-release\"\n LINUX_TYPE=$(cat $FILE | awk '{print $1}')\n elif [ -f /etc/redhat-release ]; then\n FILE=\"/etc/redhat-release\"\n LINUX_TYPE=$(cat $FILE | cut -c 1-8)\n else\n FILE=\"/etc/os-release\"\n LINUX_TYPE=$(cat $FILE | grep ^ID= | tr '[:upper:]' '[:lower:]')\n LINUX_VERSION=$(cat $FILE | grep ^VERSION_ID=)\nfi\n\nMACHINE_TYPE=$(uname -m)\n\nmkdir -p ${CHE_DIR}\nmkdir -p ${LS_DIR}\n\n########################\n### Install packages ###\n########################\n\n# Red Hat Enterprise Linux 7\n############################\nif echo ${LINUX_TYPE} | grep -qi \"rhel\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} yum -y install nodejs;\n }\n\n# Red Hat Enterprise Linux 6\n############################\nelif echo ${LINUX_TYPE} | grep -qi \"Red Hat\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} yum -y install nodejs;\n }\n\n\n# Ubuntu 14.04 16.04 / Linux Mint 17\n####################################\nelif echo ${LINUX_TYPE} | grep -qi \"ubuntu\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n {\n if test \"${SUDO}\" = \"\"; then\n curl -sL https://deb.nodesource.com/setup_6.x | bash -;\n else\n curl -sL https://deb.nodesource.com/setup_6.x | ${SUDO} -E bash -;\n fi\n };\n\n ${SUDO} apt-get update;\n ${SUDO} apt-get install -y nodejs;\n }\n\n\n# Debian 8\n##########\nelif echo ${LINUX_TYPE} | grep -qi \"debian\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n {\n if test \"${SUDO}\" = \"\"; then\n curl -sL https://deb.nodesource.com/setup_6.x | bash -;\n else\n curl -sL https://deb.nodesource.com/setup_6.x | ${SUDO} -E bash -;\n fi\n };\n\n ${SUDO} apt-get update;\n ${SUDO} apt-get install -y nodejs;\n }\n\n# Fedora 23\n###########\nelif echo ${LINUX_TYPE} | grep -qi \"fedora\"; then\n command -v ps >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" procps-ng\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} dnf -y install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} dnf -y install nodejs;\n }\n\n\n# CentOS 7.1 & Oracle Linux 7.1\n###############################\nelif echo ${LINUX_TYPE} | grep -qi \"centos\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} yum -y install nodejs;\n }\n\n# openSUSE 13.2\n###############\nelif echo ${LINUX_TYPE} | grep -qi \"opensuse\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} zypper install -y ${PACKAGES};\n }\n\n command -v nodejs >/dev/null 2>&1 || {\n ${SUDO} zypper ar http://download.opensuse.org/repositories/devel:/languages:/nodejs/openSUSE_13.1/ Node.js\n ${SUDO} zypper in nodejs\n }\n\nelse\n >&2 echo \"Unrecognized Linux Type\"\n >&2 cat $FILE\n exit 1\nfi\n\n\n########################\n### Install JS-TS LS ###\n########################\n\ncurl -s ${AGENT_BINARIES_URI} | tar xzf - -C ${LS_DIR}\n\ntouch ${LS_LAUNCHER}\nchmod +x ${LS_LAUNCHER}\necho \"nodejs ${LS_DIR}/build/language-server-stdio.js\" > ${LS_LAUNCHER}" } diff --git a/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ssh.json b/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ssh.json index bb09108fca..44444b466e 100644 --- a/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ssh.json +++ b/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ssh.json @@ -9,5 +9,5 @@ "port": "22/tcp" } }, -"script" : "#\n# Copyright (c) 2012-2016 Codenvy, S.A.\n# All rights reserved. This program and the accompanying materials\n# are made available under the terms of the Eclipse Public License v1.0\n# which accompanies this distribution, and is available at\n# http://www.eclipse.org/legal/epl-v10.html\n#\n# Contributors:\n# Codenvy, S.A. - initial API and implementation\n#\n\nunset SUDO\nunset PACKAGES\ntest \"$(id -u)\" = 0 || SUDO=\"sudo\"\n\nif [ -f /etc/centos-release ]; then\n FILE=\"/etc/centos-release\"\n LINUX_TYPE=$(cat $FILE | awk '{print $1}')\n elif [ -f /etc/redhat-release ]; then\n FILE=\"/etc/redhat-release\"\n LINUX_TYPE=$(cat $FILE | cut -c 1-8)\n else\n FILE=\"/etc/os-release\"\n LINUX_TYPE=$(cat $FILE | grep ^ID= | tr '[:upper:]' '[:lower:]')\n LINUX_VERSION=$(cat $FILE | grep ^VERSION_ID=)\nfi\n\n###############################\n### Install Needed packaged ###\n###############################\n\n# Red Hat Enterprise Linux 7 \n############################\nif echo ${LINUX_TYPE} | grep -qi \"rhel\"; then\n command -v sshd >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" openssh-server\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n ${SUDO} sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd\n\n# Red Hat Enterprise Linux 6 \n############################\nelif echo ${LINUX_TYPE} | grep -qi \"Red Hat\"; then\n command -v sshd >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" openssh-server\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n ${SUDO} sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd\n\n# Ubuntu 14.04 16.04 / Linux Mint 17 \n####################################\nelif echo ${LINUX_TYPE} | grep -qi \"ubuntu\"; then\n command -v sshd >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" openssh-server\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n ${SUDO} sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd\n\n# Debian 8\n##########\nelif echo ${LINUX_TYPE} | grep -qi \"debian\"; then\n command -v sshd >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" openssh-server\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n ${SUDO} sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd\n\n# Fedora 23\n###########\nelif echo ${LINUX_TYPE} | grep -qi \"fedora\"; then\n PACKAGES=${PACKAGES}\" procps-ng\"\n command -v sshd >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" openssh-server\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} dnf -y install ${PACKAGES};\n }\n ${SUDO} sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd\n\n# CentOS 7.1 & Oracle Linux 7.1\n###############################\nelif echo ${LINUX_TYPE} | grep -qi \"centos\"; then\n command -v sshd >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" openssh-server\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n ${SUDO} sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd\n\n# openSUSE 13.2\n###############\nelif echo ${LINUX_TYPE} | grep -qi \"opensuse\"; then\n command -v sshd >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" openSSH\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} zypper install -y ${PACKAGES};\n }\n ${SUDO} sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd\n\n# Alpine 3.3\n############$$\nelif echo ${LINUX_TYPE} | grep -qi \"alpine\"; then\n command -v sshd >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" openssh\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apk update;\n ${SUDO} apk add openssh ${PACKAGES};\n }\n\n# Centos 6.6, 6.7, 6.8\n############\nelif echo ${LINUX_TYPE} | grep -qi \"CentOS\"; then\n command -v sshd >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" openssh-server\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n ${SUDO} sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd\n\nelse\n >&2 echo \"Unrecognized Linux Type\"\n >&2 cat $FILE\n exit 1\nfi\n\ncommand -v pidof >/dev/null 2>&1 && {\n pidof sshd >/dev/null 2>&1 && exit\n} || {\n ps -fC sshd >/dev/null 2>&1 && exit\n}\n\n\n${SUDO} mkdir -p /var/run/sshd\n\nif echo ${LINUX_TYPE} | grep -qi \"CentOS\"; then\n ${SUDO} /usr/bin/ssh-keygen -q -P '' -t rsa -f ~/.ssh/id_rsa\nelse\n ${SUDO} /usr/bin/ssh-keygen -A\nfi\n\n${SUDO} /usr/sbin/sshd -D\n" +"script" : "#\n# Copyright (c) 2012-2016 Codenvy, S.A.\n# All rights reserved. This program and the accompanying materials\n# are made available under the terms of the Eclipse Public License v1.0\n# which accompanies this distribution, and is available at\n# http://www.eclipse.org/legal/epl-v10.html\n#\n# Contributors:\n# Codenvy, S.A. - initial API and implementation\n#\n\nunset SUDO\nunset PACKAGES\ntest \"$(id -u)\" = 0 || SUDO=\"sudo\"\n\nif [ -f /etc/centos-release ]; then\n FILE=\"/etc/centos-release\"\n LINUX_TYPE=$(cat $FILE | awk '{print $1}')\n elif [ -f /etc/redhat-release ]; then\n FILE=\"/etc/redhat-release\"\n LINUX_TYPE=$(cat $FILE | cut -c 1-8)\n else\n FILE=\"/etc/os-release\"\n LINUX_TYPE=$(cat $FILE | grep ^ID= | tr '[:upper:]' '[:lower:]')\n LINUX_VERSION=$(cat $FILE | grep ^VERSION_ID=)\nfi\n\n###############################\n### Install Needed packaged ###\n###############################\n\n# Red Hat Enterprise Linux 7 \n############################\nif echo ${LINUX_TYPE} | grep -qi \"rhel\"; then\n command -v sshd >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" openssh-server\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n ${SUDO} sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd\n\n# Red Hat Enterprise Linux 6 \n############################\nelif echo ${LINUX_TYPE} | grep -qi \"Red Hat\"; then\n command -v sshd >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" openssh-server\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n ${SUDO} sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd\n\n# Ubuntu 14.04 16.04 / Linux Mint 17 \n####################################\nelif echo ${LINUX_TYPE} | grep -qi \"ubuntu\"; then\n command -v sshd >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" openssh-server\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n ${SUDO} sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd\n\n# Debian 8\n##########\nelif echo ${LINUX_TYPE} | grep -qi \"debian\"; then\n command -v sshd >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" openssh-server\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n ${SUDO} sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd\n\n# Fedora 23\n###########\nelif echo ${LINUX_TYPE} | grep -qi \"fedora\"; then\n command -v ps >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" procps-ng\"; }\n command -v sshd >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" openssh-server\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} dnf -y install ${PACKAGES};\n }\n ${SUDO} sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd\n\n# CentOS 7.1 & Oracle Linux 7.1\n###############################\nelif echo ${LINUX_TYPE} | grep -qi \"centos\"; then\n command -v sshd >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" openssh-server\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n ${SUDO} sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd\n\n# openSUSE 13.2\n###############\nelif echo ${LINUX_TYPE} | grep -qi \"opensuse\"; then\n command -v sshd >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" openSSH\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} zypper install -y ${PACKAGES};\n }\n ${SUDO} sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd\n\n# Alpine 3.3\n############$$\nelif echo ${LINUX_TYPE} | grep -qi \"alpine\"; then\n command -v sshd >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" openssh\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apk update;\n ${SUDO} apk add openssh ${PACKAGES};\n }\n\n# Centos 6.6, 6.7, 6.8\n############\nelif echo ${LINUX_TYPE} | grep -qi \"CentOS\"; then\n command -v sshd >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" openssh-server\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n ${SUDO} sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd\n\nelse\n >&2 echo \"Unrecognized Linux Type\"\n >&2 cat $FILE\n exit 1\nfi\n\ncommand -v pidof >/dev/null 2>&1 && {\n pidof sshd >/dev/null 2>&1 && exit\n} || {\n ps -fC sshd >/dev/null 2>&1 && exit\n}\n\n\n${SUDO} mkdir -p /var/run/sshd\n\nif echo ${LINUX_TYPE} | grep -qi \"CentOS\"; then\n ${SUDO} /usr/bin/ssh-keygen -q -P '' -t rsa -f ~/.ssh/id_rsa\nelse\n ${SUDO} /usr/bin/ssh-keygen -A\nfi\n\n${SUDO} /usr/sbin/sshd -D\n" } diff --git a/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.terminal.json b/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.terminal.json index 47e88b32d3..c3ea14de83 100644 --- a/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.terminal.json +++ b/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.terminal.json @@ -1,14 +1,14 @@ { - "id": "org.eclipse.che.terminal", - "name": "Terminal", - "description": "Embedded web terminal", - "dependencies": [], - "properties": {}, - "servers": { - "terminal": { - "port": "4411/tcp", - "protocol": "http" - } - }, - "script": "#\n# Copyright (c) 2012-2016 Codenvy, S.A.\n# All rights reserved. This program and the accompanying materials\n# are made available under the terms of the Eclipse Public License v1.0\n# which accompanies this distribution, and is available at\n# http://www.eclipse.org/legal/epl-v10.html\n#\n# Contributors:\n# Codenvy, S.A. - initial API and implementation\n#\n\nunset PACKAGES\nunset SUDO\ncommand -v tar >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" tar\"; }\ncommand -v curl >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" curl\"; }\ntest \"$(id -u)\" = 0 || SUDO=\"sudo\"\n\nCHE_DIR=$HOME/che\nLOCAL_AGENT_BINARIES_URI='/mnt/che/terminal/websocket-terminal-${PREFIX}.tar.gz'\nDOWNLOAD_AGENT_BINARIES_URI='${WORKSPACE_MASTER_URI}/agent-binaries/${PREFIX}/terminal/websocket-terminal-${PREFIX}.tar.gz'\nTARGET_AGENT_BINARIES_URI='file://${CHE_DIR}/websocket-terminal-${PREFIX}.tar.gz'\n\nif [ -f /etc/centos-release ]; then\n FILE=\"/etc/centos-release\"\n LINUX_TYPE=$(cat $FILE | awk '{print $1}')\n elif [ -f /etc/redhat-release ]; then\n FILE=\"/etc/redhat-release\"\n LINUX_TYPE=$(cat $FILE | cut -c 1-8)\n else\n FILE=\"/etc/os-release\"\n LINUX_TYPE=$(cat $FILE | grep ^ID= | tr '[:upper:]' '[:lower:]')\n LINUX_VERSION=$(cat $FILE | grep ^VERSION_ID=)\nfi\nMACHINE_TYPE=$(uname -m)\nSHELL_INTERPRETER=\"/bin/sh\"\n\n\nmkdir -p ${CHE_DIR}\n\n########################\n### Install packages ###\n########################\n\n# Red Hat Enterprise Linux 7 \n############################\nif echo ${LINUX_TYPE} | grep -qi \"rhel\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum install ${PACKAGES};\n }\n\n# Ubuntu 14.04 16.04 / Linux Mint 17 \n####################################\nelif echo ${LINUX_TYPE} | grep -qi \"ubuntu\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n# Debian 8\n##########\nelif echo ${LINUX_TYPE} | grep -qi \"debian\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n# Fedora 23 \n###########\nelif echo ${LINUX_TYPE} | grep -qi \"fedora\"; then\n PACKAGES=${PACKAGES}\" procps-ng\"\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} dnf -y install ${PACKAGES};\n }\n\n# CentOS 7.1 & Oracle Linux 7.1\n###############################\nelif echo ${LINUX_TYPE} | grep -qi \"centos\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n\n# openSUSE 13.2\n###############\nelif echo ${LINUX_TYPE} | grep -qi \"opensuse\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} zypper install -y ${PACKAGES};\n }\n\n# Alpine 3.3\n############\nelif echo ${LINUX_TYPE} | grep -qi \"alpine\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apk update\n ${SUDO} apk add ${PACKAGES};\n }\n\n# Centos 6.6, 6.7, 6.8\n############\nelif echo ${LINUX_TYPE} | grep -qi \"CentOS\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n\n# Red Hat Enterprise Linux 6 \n############################\n\nelif echo ${LINUX_TYPE} | grep -qi \"Red Hat\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum install ${PACKAGES};\n }\n\nelse\n >&2 echo \"Unrecognized Linux Type\"\n >&2 cat $FILE\n exit 1\nfi\n\ncommand -v pidof >/dev/null 2>&1 && {\n pidof che-websocket-terminal >/dev/null 2>&1 && exit\n} || {\n ps -fC che-websocket-terminal >/dev/null 2>&1 && exit\n}\n\n\n########################\n### Install Terminal ###\n########################\nif echo ${MACHINE_TYPE} | grep -qi \"x86_64\"; then\n PREFIX=linux_amd64\nelif echo ${MACHINE_TYPE} | grep -qi \"arm5\"; then\n PREFIX=linux_arm7\nelif echo ${MACHINE_TYPE} | grep -qi \"arm6\"; then\n PREFIX=linux_arm7\nelif echo ${MACHINE_TYPE} | grep -qi \"arm7\"; then\n PREFIX=linux_arm7\nelif echo ${MACHINE_TYPE} | grep -qi \"armv7l\"; then\n PREFIX=linux_arm7\nelse\n >&2 echo \"Unrecognized Machine Type\"\n >&2 uname -a\n exit 1\nfi\n\n# Compute URI of workspace master\nWORKSPACE_MASTER_URI=$(echo $CHE_API | cut -d / -f 1-3)\n\n## Evaluate variables now that prefix is defined\neval \"LOCAL_AGENT_BINARIES_URI=${LOCAL_AGENT_BINARIES_URI}\"\neval \"DOWNLOAD_AGENT_BINARIES_URI=${DOWNLOAD_AGENT_BINARIES_URI}\"\neval \"TARGET_AGENT_BINARIES_URI=${TARGET_AGENT_BINARIES_URI}\"\n\nif [ -f \"${LOCAL_AGENT_BINARIES_URI}\" ]; then\n AGENT_BINARIES_URI=\"file://${LOCAL_AGENT_BINARIES_URI}\"\nelif [ -f $(echo \"${LOCAL_AGENT_BINARIES_URI}\" | sed \"s/-${PREFIX}//g\") ]; then\n AGENT_BINARIES_URI=\"file://\"$(echo \"${LOCAL_AGENT_BINARIES_URI}\" | sed \"s/-${PREFIX}//g\")\nelse\n echo \"Terminal Agent will be downloaded from Workspace Master\"\n AGENT_BINARIES_URI=${DOWNLOAD_AGENT_BINARIES_URI}\nfi\n\n\nif curl -o /dev/null --silent --head --fail $(echo ${AGENT_BINARIES_URI} | sed 's/\\${PREFIX}/'${PREFIX}'/g'); then\n curl -o $(echo ${TARGET_AGENT_BINARIES_URI} | sed 's/\\${PREFIX}/'${PREFIX}'/g' | sed 's/file:\\/\\///g') -s $(echo ${AGENT_BINARIES_URI} | sed 's/\\${PREFIX}/'${PREFIX}'/g')\nelif curl -o /dev/null --silent --head --fail $(echo ${AGENT_BINARIES_URI} | sed 's/-\\${PREFIX}//g'); then\n curl -o $(echo ${TARGET_AGENT_BINARIES_URI} | sed 's/\\${PREFIX}/'${PREFIX}'/g' | sed 's/file:\\/\\///g') -s $(echo ${AGENT_BINARIES_URI} | sed 's/-\\${PREFIX}//g')\nfi\n\ncurl -s $(echo ${TARGET_AGENT_BINARIES_URI} | sed 's/\\${PREFIX}/'${PREFIX}'/g') | tar xzf - -C ${CHE_DIR}\n\nif [ -f /bin/bash ]; then\n SHELL_INTERPRETER=\"/bin/bash\"\nfi\n\n#####################################################\n### terminal-agent run command will be added here ###\n#####################################################" +"id": "org.eclipse.che.terminal", +"name": "Terminal", +"description": "Embedded web terminal", +"dependencies": [], +"properties": {}, +"servers": { +"terminal": { +"port": "4411/tcp", +"protocol": "http" +} +}, +"script" : "#\n# Copyright (c) 2012-2016 Codenvy, S.A.\n# All rights reserved. This program and the accompanying materials\n# are made available under the terms of the Eclipse Public License v1.0\n# which accompanies this distribution, and is available at\n# http://www.eclipse.org/legal/epl-v10.html\n#\n# Contributors:\n# Codenvy, S.A. - initial API and implementation\n#\n\nunset PACKAGES\nunset SUDO\ncommand -v tar >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" tar\"; }\ncommand -v curl >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" curl\"; }\ntest \"$(id -u)\" = 0 || SUDO=\"sudo\"\n\nCHE_DIR=$HOME/che\nLOCAL_AGENT_BINARIES_URI='/mnt/che/terminal/websocket-terminal-${PREFIX}.tar.gz'\nDOWNLOAD_AGENT_BINARIES_URI='${WORKSPACE_MASTER_URI}/agent-binaries/${PREFIX}/terminal/websocket-terminal-${PREFIX}.tar.gz'\nTARGET_AGENT_BINARIES_URI='file://${CHE_DIR}/websocket-terminal-${PREFIX}.tar.gz'\n\nif [ -f /etc/centos-release ]; then\n FILE=\"/etc/centos-release\"\n LINUX_TYPE=$(cat $FILE | awk '{print $1}')\n elif [ -f /etc/redhat-release ]; then\n FILE=\"/etc/redhat-release\"\n LINUX_TYPE=$(cat $FILE | cut -c 1-8)\n else\n FILE=\"/etc/os-release\"\n LINUX_TYPE=$(cat $FILE | grep ^ID= | tr '[:upper:]' '[:lower:]')\n LINUX_VERSION=$(cat $FILE | grep ^VERSION_ID=)\nfi\nMACHINE_TYPE=$(uname -m)\nSHELL_INTERPRETER=\"/bin/sh\"\n\n\nmkdir -p ${CHE_DIR}\n\n########################\n### Install packages ###\n########################\n\n# Red Hat Enterprise Linux 7 \n############################\nif echo ${LINUX_TYPE} | grep -qi \"rhel\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum install ${PACKAGES};\n }\n\n# Ubuntu 14.04 16.04 / Linux Mint 17 \n####################################\nelif echo ${LINUX_TYPE} | grep -qi \"ubuntu\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n# Debian 8\n##########\nelif echo ${LINUX_TYPE} | grep -qi \"debian\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n# Fedora 23 \n###########\nelif echo ${LINUX_TYPE} | grep -qi \"fedora\"; then\n command -v ps >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" procps-ng\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} dnf -y install ${PACKAGES};\n }\n\n# CentOS 7.1 & Oracle Linux 7.1\n###############################\nelif echo ${LINUX_TYPE} | grep -qi \"centos\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n\n# openSUSE 13.2\n###############\nelif echo ${LINUX_TYPE} | grep -qi \"opensuse\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} zypper install -y ${PACKAGES};\n }\n\n# Alpine 3.3\n############\nelif echo ${LINUX_TYPE} | grep -qi \"alpine\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apk update\n ${SUDO} apk add ${PACKAGES};\n }\n\n# Centos 6.6, 6.7, 6.8\n############\nelif echo ${LINUX_TYPE} | grep -qi \"CentOS\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n\n# Red Hat Enterprise Linux 6 \n############################\n\nelif echo ${LINUX_TYPE} | grep -qi \"Red Hat\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum install ${PACKAGES};\n }\n\nelse\n >&2 echo \"Unrecognized Linux Type\"\n >&2 cat $FILE\n exit 1\nfi\n\ncommand -v pidof >/dev/null 2>&1 && {\n pidof che-websocket-terminal >/dev/null 2>&1 && exit\n} || {\n ps -fC che-websocket-terminal >/dev/null 2>&1 && exit\n}\n\n\n########################\n### Install Terminal ###\n########################\nif echo ${MACHINE_TYPE} | grep -qi \"x86_64\"; then\n PREFIX=linux_amd64\nelif echo ${MACHINE_TYPE} | grep -qi \"arm5\"; then\n PREFIX=linux_arm7\nelif echo ${MACHINE_TYPE} | grep -qi \"arm6\"; then\n PREFIX=linux_arm7\nelif echo ${MACHINE_TYPE} | grep -qi \"arm7\"; then\n PREFIX=linux_arm7\nelif echo ${MACHINE_TYPE} | grep -qi \"armv7l\"; then\n PREFIX=linux_arm7\nelse\n >&2 echo \"Unrecognized Machine Type\"\n >&2 uname -a\n exit 1\nfi\n\n# Compute URI of workspace master\nWORKSPACE_MASTER_URI=$(echo $CHE_API | cut -d / -f 1-3)\n\n## Evaluate variables now that prefix is defined\neval \"LOCAL_AGENT_BINARIES_URI=${LOCAL_AGENT_BINARIES_URI}\"\neval \"DOWNLOAD_AGENT_BINARIES_URI=${DOWNLOAD_AGENT_BINARIES_URI}\"\neval \"TARGET_AGENT_BINARIES_URI=${TARGET_AGENT_BINARIES_URI}\"\n\nif [ -f \"${LOCAL_AGENT_BINARIES_URI}\" ]; then\n AGENT_BINARIES_URI=\"file://${LOCAL_AGENT_BINARIES_URI}\"\nelif [ -f $(echo \"${LOCAL_AGENT_BINARIES_URI}\" | sed \"s/-${PREFIX}//g\") ]; then\n AGENT_BINARIES_URI=\"file://\"$(echo \"${LOCAL_AGENT_BINARIES_URI}\" | sed \"s/-${PREFIX}//g\")\nelse\n echo \"Terminal Agent will be downloaded from Workspace Master\"\n AGENT_BINARIES_URI=${DOWNLOAD_AGENT_BINARIES_URI}\nfi\n\n\nif curl -o /dev/null --silent --head --fail $(echo ${AGENT_BINARIES_URI} | sed 's/\\${PREFIX}/'${PREFIX}'/g'); then\n curl -o $(echo ${TARGET_AGENT_BINARIES_URI} | sed 's/\\${PREFIX}/'${PREFIX}'/g' | sed 's/file:\\/\\///g') -s $(echo ${AGENT_BINARIES_URI} | sed 's/\\${PREFIX}/'${PREFIX}'/g')\nelif curl -o /dev/null --silent --head --fail $(echo ${AGENT_BINARIES_URI} | sed 's/-\\${PREFIX}//g'); then\n curl -o $(echo ${TARGET_AGENT_BINARIES_URI} | sed 's/\\${PREFIX}/'${PREFIX}'/g' | sed 's/file:\\/\\///g') -s $(echo ${AGENT_BINARIES_URI} | sed 's/-\\${PREFIX}//g')\nfi\n\ncurl -s $(echo ${TARGET_AGENT_BINARIES_URI} | sed 's/\\${PREFIX}/'${PREFIX}'/g') | tar xzf - -C ${CHE_DIR}\n\nif [ -f /bin/bash ]; then\n SHELL_INTERPRETER=\"/bin/bash\"\nfi\n\n#####################################################\n### terminal-agent run command will be added here ###\n#####################################################" } diff --git a/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.unison.json b/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.unison.json index fec4de6811..b3ad437eaa 100644 --- a/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.unison.json +++ b/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.unison.json @@ -4,5 +4,5 @@ "description": "Unison File Synchronizer", "dependencies": [], "properties": {}, -"script" : "#\n# Copyright (c) 2012-2016 Codenvy, S.A.\n# All rights reserved. This program and the accompanying materials\n# are made available under the terms of the Eclipse Public License v1.0\n# which accompanies this distribution, and is available at\n# http://www.eclipse.org/legal/epl-v10.html\n#\n# Contributors:\n# Codenvy, S.A. - initial API and implementation\n#\n\nunset SUDO\nunset PACKAGES\ntest \"$(id -u)\" = 0 || SUDO=\"sudo\"\n\nif [ -f /etc/centos-release ]; then\n FILE=\"/etc/centos-release\"\n LINUX_TYPE=$(cat $FILE | awk '{print $1}')\n elif [ -f /etc/redhat-release ]; then\n FILE=\"/etc/redhat-release\"\n LINUX_TYPE=$(cat $FILE | cut -c 1-8)\n else\n FILE=\"/etc/os-release\"\n LINUX_TYPE=$(cat $FILE | grep ^ID= | tr '[:upper:]' '[:lower:]')\n LINUX_VERSION=$(cat $FILE | grep ^VERSION_ID=)\nfi\n\n###############################\n### Install Needed packaged ###\n###############################\n\n# Red Hat Enterprise Linux 7 \n############################\nif echo ${LINUX_TYPE} | grep -qi \"rhel\"; then\n command -v unison >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" unison\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n\n# Red Hat Enterprise Linux 6 \n############################\nelif echo ${LINUX_TYPE} | grep -qi \"Red Hat\"; then\n command -v unison >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" unison\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n\n# Ubuntu 14.04 16.04 / Linux Mint 17 \n####################################\nelif echo ${LINUX_TYPE} | grep -qi \"ubuntu\"; then\n command -v unison >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" unison\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n# Debian 8\n##########\nelif echo ${LINUX_TYPE} | grep -qi \"debian\"; then\n command -v unison >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" unison\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n# Fedora 23\n###########\nelif echo ${LINUX_TYPE} | grep -qi \"fedora\"; then\n PACKAGES=${PACKAGES}\" procps-ng\"\n command -v unison >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" unison\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} dnf -y install ${PACKAGES};\n }\n\n# CentOS 7.1 & Oracle Linux 7.1\n###############################\nelif echo ${LINUX_TYPE} | grep -qi \"centos\"; then\n command -v unison >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" unison\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n\n# openSUSE 13.2\n###############\nelif echo ${LINUX_TYPE} | grep -qi \"opensuse\"; then\n command -v unison >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" unison\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} zypper install -y ${PACKAGES};\n }\n\n# Alpine 3.3\n############$$\nelif echo ${LINUX_TYPE} | grep -qi \"alpine\"; then\n command -v unison >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" unison\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apk update;\n ${SUDO} apk add ${PACKAGES};\n }\n\nelse\n >&2 echo \"Unrecognized Linux Type\"\n >&2 cat /etc/os-release\n exit 1\nfi" +"script" : "#\n# Copyright (c) 2012-2016 Codenvy, S.A.\n# All rights reserved. This program and the accompanying materials\n# are made available under the terms of the Eclipse Public License v1.0\n# which accompanies this distribution, and is available at\n# http://www.eclipse.org/legal/epl-v10.html\n#\n# Contributors:\n# Codenvy, S.A. - initial API and implementation\n#\n\nunset SUDO\nunset PACKAGES\ntest \"$(id -u)\" = 0 || SUDO=\"sudo\"\n\nif [ -f /etc/centos-release ]; then\n FILE=\"/etc/centos-release\"\n LINUX_TYPE=$(cat $FILE | awk '{print $1}')\n elif [ -f /etc/redhat-release ]; then\n FILE=\"/etc/redhat-release\"\n LINUX_TYPE=$(cat $FILE | cut -c 1-8)\n else\n FILE=\"/etc/os-release\"\n LINUX_TYPE=$(cat $FILE | grep ^ID= | tr '[:upper:]' '[:lower:]')\n LINUX_VERSION=$(cat $FILE | grep ^VERSION_ID=)\nfi\n\n###############################\n### Install Needed packaged ###\n###############################\n\n# Red Hat Enterprise Linux 7 \n############################\nif echo ${LINUX_TYPE} | grep -qi \"rhel\"; then\n command -v unison >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" unison\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n\n# Red Hat Enterprise Linux 6 \n############################\nelif echo ${LINUX_TYPE} | grep -qi \"Red Hat\"; then\n command -v unison >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" unison\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n\n# Ubuntu 14.04 16.04 / Linux Mint 17 \n####################################\nelif echo ${LINUX_TYPE} | grep -qi \"ubuntu\"; then\n command -v unison >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" unison\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n# Debian 8\n##########\nelif echo ${LINUX_TYPE} | grep -qi \"debian\"; then\n command -v unison >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" unison\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n# Fedora 23\n###########\nelif echo ${LINUX_TYPE} | grep -qi \"fedora\"; then\n command -v ps >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" procps-ng\"; }\n command -v unison >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" unison\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} dnf -y install ${PACKAGES};\n }\n\n# CentOS 7.1 & Oracle Linux 7.1\n###############################\nelif echo ${LINUX_TYPE} | grep -qi \"centos\"; then\n command -v unison >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" unison\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n\n# openSUSE 13.2\n###############\nelif echo ${LINUX_TYPE} | grep -qi \"opensuse\"; then\n command -v unison >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" unison\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} zypper install -y ${PACKAGES};\n }\n\n# Alpine 3.3\n############$$\nelif echo ${LINUX_TYPE} | grep -qi \"alpine\"; then\n command -v unison >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" unison\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apk update;\n ${SUDO} apk add ${PACKAGES};\n }\n\nelse\n >&2 echo \"Unrecognized Linux Type\"\n >&2 cat /etc/os-release\n exit 1\nfi" } diff --git a/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ws-agent.json b/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ws-agent.json index 005d23c193..f20fa70460 100644 --- a/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ws-agent.json +++ b/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ws-agent.json @@ -15,5 +15,5 @@ } } }, -"script" : "#\n# Copyright (c) 2012-2016 Codenvy, S.A.\n# All rights reserved. This program and the accompanying materials\n# are made available under the terms of the Eclipse Public License v1.0\n# which accompanies this distribution, and is available at\n# http://www.eclipse.org/legal/epl-v10.html\n#\n# Contributors:\n# Codenvy, S.A. - initial API and implementation\n#\n\nunset PACKAGES\nunset SUDO\ncommand -v tar >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" tar\"; }\ncommand -v curl >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" curl\"; }\ntest \"$(id -u)\" = 0 || SUDO=\"sudo\"\n\nLOCAL_AGENT_BINARIES_URI=\"/mnt/che/ws-agent.tar.gz\"\nDOWNLOAD_AGENT_BINARIES_URI='${WORKSPACE_MASTER_URI}/agent-binaries/ws-agent.tar.gz'\n\nCHE_DIR=$HOME/che\n\nif [ -f /etc/centos-release ]; then\n FILE=\"/etc/centos-release\"\n LINUX_TYPE=$(cat $FILE | awk '{print $1}')\n elif [ -f /etc/redhat-release ]; then\n FILE=\"/etc/redhat-release\"\n LINUX_TYPE=$(cat $FILE | cut -c 1-8)\n else\n FILE=\"/etc/os-release\"\n LINUX_TYPE=$(cat $FILE | grep ^ID= | tr '[:upper:]' '[:lower:]')\n LINUX_VERSION=$(cat $FILE | grep ^VERSION_ID=)\nfi\nMACHINE_TYPE=$(uname -m)\n\nmkdir -p ${CHE_DIR}\n${SUDO} mkdir -p /projects\n${SUDO} sh -c \"chown -R $(id -u -n) /projects\"\n\n########################\n### Install packages ###\n########################\n\n# Red Hat Enterprise Linux 7\n############################\nif echo ${LINUX_TYPE} | grep -qi \"rhel\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum install ${PACKAGES};\n }\n\n# Ubuntu 14.04 16.04 / Linux Mint 17\n####################################\nelif echo ${LINUX_TYPE} | grep -qi \"ubuntu\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n# Debian 8\n##########\nelif echo ${LINUX_TYPE} | grep -qi \"debian\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n# Fedora 23\n###########\nelif echo ${LINUX_TYPE} | grep -qi \"fedora\"; then\n PACKAGES=${PACKAGES}\" procps-ng\"\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} dnf -y install ${PACKAGES};\n }\n\n# CentOS 7.1 & Oracle Linux 7.1\n###############################\nelif echo ${LINUX_TYPE} | grep -qi \"centos\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n\n# openSUSE 13.2\n###############\nelif echo ${LINUX_TYPE} | grep -qi \"opensuse\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} zypper install -y ${PACKAGES};\n }\n\n# Alpine 3.3\n############$$\nelif echo ${LINUX_TYPE} | grep -qi \"alpine\"; then\n\n # Setup OpenJDK8 (not using glibc) if missing\n INSTALL_JDK=false\n command -v ${JAVA_HOME}/bin/java >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" openjdk8\"; INSTALL_JDK=true;}\n\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apk update\n ${SUDO} apk add ${PACKAGES};\n }\n\n # Link OpenJDK to JAVA_HOME\n if [ ${INSTALL_JDK} = true ]; then\n export JAVA_HOME=${CHE_DIR}/jdk1.8\n ln -s /usr/lib/jvm/java-1.8-openjdk $JAVA_HOME\n fi\n\n# Centos 6.6, 6.7, 6.8\n############\nelif echo ${LINUX_TYPE} | grep -qi \"CentOS\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n\n# Red Hat Enterprise Linux 6 \n############################\nelif echo ${LINUX_TYPE} | grep -qi \"Red Hat\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum install ${PACKAGES};\n }\n\nelse\n >&2 echo \"Unrecognized Linux Type\"\n >&2 cat $FILE\n exit 1\nfi\n\n####################\n### Install java ###\n####################\ndownloadJava() {\n echo \"Downloading JDK 1.8.0_111\"\n JDK_URL=http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-x64.tar.gz\n curl -s -j -k -L -H \"Cookie: oraclelicense=accept-securebackup-cookie\" \"${JDK_URL}\" | tar -C ${CHE_DIR} -xzf -\n mv ${CHE_DIR}/jdk1.8.0_111 ${CHE_DIR}/jdk1.8\n\n export JAVA_HOME=${CHE_DIR}/jdk1.8\n}\n\ncommand -v ${JAVA_HOME}/bin/java >/dev/null 2>&1 || {\n downloadJava;\n} && {\n java_version=$(${JAVA_HOME}/bin/java -version 2>&1 | sed 's/.* version \"\\(.*\\)\\.\\(.*\\)\\..*\"/\\1\\2/; 1q')\n if [ \"${java_version}\" -lt \"18\" ]; then\n downloadJava;\n fi\n}\n\n########################\n### Install ws-agent ###\n########################\n\nrm -rf ${CHE_DIR}/ws-agent\nmkdir -p ${CHE_DIR}/ws-agent\n\n\n# Compute URI of workspace master\nWORKSPACE_MASTER_URI=$(echo $CHE_API | cut -d / -f 1-3)\n\n## Evaluate variables now that prefix is defined\neval \"DOWNLOAD_AGENT_BINARIES_URI=${DOWNLOAD_AGENT_BINARIES_URI}\"\n\n\nif [ -f \"${LOCAL_AGENT_BINARIES_URI}\" ]\nthen\n AGENT_BINARIES_URI=\"file://${LOCAL_AGENT_BINARIES_URI}\"\nelse\n echo \"Workspace Agent will be downloaded from Workspace Master\"\n AGENT_BINARIES_URI=${DOWNLOAD_AGENT_BINARIES_URI}\nfi\n\ncurl -s ${AGENT_BINARIES_URI} | tar xzf - -C ${CHE_DIR}/ws-agent\n\n###############################################\n### ws-agent run command will be added here ###\n### ~/che/ws-agent/bin/catalina.sh run ###\n###############################################" +"script" : "#\n# Copyright (c) 2012-2016 Codenvy, S.A.\n# All rights reserved. This program and the accompanying materials\n# are made available under the terms of the Eclipse Public License v1.0\n# which accompanies this distribution, and is available at\n# http://www.eclipse.org/legal/epl-v10.html\n#\n# Contributors:\n# Codenvy, S.A. - initial API and implementation\n#\n\nunset PACKAGES\nunset SUDO\ncommand -v tar >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" tar\"; }\ncommand -v curl >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" curl\"; }\ntest \"$(id -u)\" = 0 || SUDO=\"sudo\"\n\nLOCAL_AGENT_BINARIES_URI=\"/mnt/che/ws-agent.tar.gz\"\nDOWNLOAD_AGENT_BINARIES_URI='${WORKSPACE_MASTER_URI}/agent-binaries/ws-agent.tar.gz'\n\nCHE_DIR=$HOME/che\n\nif [ -f /etc/centos-release ]; then\n FILE=\"/etc/centos-release\"\n LINUX_TYPE=$(cat $FILE | awk '{print $1}')\n elif [ -f /etc/redhat-release ]; then\n FILE=\"/etc/redhat-release\"\n LINUX_TYPE=$(cat $FILE | cut -c 1-8)\n else\n FILE=\"/etc/os-release\"\n LINUX_TYPE=$(cat $FILE | grep ^ID= | tr '[:upper:]' '[:lower:]')\n LINUX_VERSION=$(cat $FILE | grep ^VERSION_ID=)\nfi\nMACHINE_TYPE=$(uname -m)\n\nmkdir -p ${CHE_DIR}\n${SUDO} mkdir -p /projects\n${SUDO} sh -c \"chown -R $(id -u -n) /projects\"\n\n########################\n### Install packages ###\n########################\n\n# Red Hat Enterprise Linux 7\n############################\nif echo ${LINUX_TYPE} | grep -qi \"rhel\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum install ${PACKAGES};\n }\n\n# Ubuntu 14.04 16.04 / Linux Mint 17\n####################################\nelif echo ${LINUX_TYPE} | grep -qi \"ubuntu\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n# Debian 8\n##########\nelif echo ${LINUX_TYPE} | grep -qi \"debian\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n# Fedora 23\n###########\nelif echo ${LINUX_TYPE} | grep -qi \"fedora\"; then\n command -v ps >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" procps-ng\"; }\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} dnf -y install ${PACKAGES};\n }\n\n# CentOS 7.1 & Oracle Linux 7.1\n###############################\nelif echo ${LINUX_TYPE} | grep -qi \"centos\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n\n# openSUSE 13.2\n###############\nelif echo ${LINUX_TYPE} | grep -qi \"opensuse\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} zypper install -y ${PACKAGES};\n }\n\n# Alpine 3.3\n############$$\nelif echo ${LINUX_TYPE} | grep -qi \"alpine\"; then\n\n # Setup OpenJDK8 (not using glibc) if missing\n INSTALL_JDK=false\n command -v ${JAVA_HOME}/bin/java >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" openjdk8\"; INSTALL_JDK=true;}\n\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apk update\n ${SUDO} apk add ${PACKAGES};\n }\n\n # Link OpenJDK to JAVA_HOME\n if [ ${INSTALL_JDK} = true ]; then\n export JAVA_HOME=${CHE_DIR}/jdk1.8\n ln -s /usr/lib/jvm/java-1.8-openjdk $JAVA_HOME\n fi\n\n# Centos 6.6, 6.7, 6.8\n############\nelif echo ${LINUX_TYPE} | grep -qi \"CentOS\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n\n# Red Hat Enterprise Linux 6 \n############################\nelif echo ${LINUX_TYPE} | grep -qi \"Red Hat\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum install ${PACKAGES};\n }\n\nelse\n >&2 echo \"Unrecognized Linux Type\"\n >&2 cat $FILE\n exit 1\nfi\n\n####################\n### Install java ###\n####################\ndownloadJava() {\n echo \"Downloading JDK 1.8.0_111\"\n JDK_URL=http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-x64.tar.gz\n curl -s -j -k -L -H \"Cookie: oraclelicense=accept-securebackup-cookie\" \"${JDK_URL}\" | tar -C ${CHE_DIR} -xzf -\n mv ${CHE_DIR}/jdk1.8.0_111 ${CHE_DIR}/jdk1.8\n\n export JAVA_HOME=${CHE_DIR}/jdk1.8\n}\n\ncommand -v ${JAVA_HOME}/bin/java >/dev/null 2>&1 || {\n downloadJava;\n} && {\n java_version=$(${JAVA_HOME}/bin/java -version 2>&1 | sed 's/.* version \"\\(.*\\)\\.\\(.*\\)\\..*\"/\\1\\2/; 1q')\n if [ \"${java_version}\" -lt \"18\" ]; then\n downloadJava;\n fi\n}\n\n########################\n### Install ws-agent ###\n########################\n\nrm -rf ${CHE_DIR}/ws-agent\nmkdir -p ${CHE_DIR}/ws-agent\n\n\n# Compute URI of workspace master\nWORKSPACE_MASTER_URI=$(echo $CHE_API | cut -d / -f 1-3)\n\n## Evaluate variables now that prefix is defined\neval \"DOWNLOAD_AGENT_BINARIES_URI=${DOWNLOAD_AGENT_BINARIES_URI}\"\n\n\nif [ -f \"${LOCAL_AGENT_BINARIES_URI}\" ]\nthen\n AGENT_BINARIES_URI=\"file://${LOCAL_AGENT_BINARIES_URI}\"\nelse\n echo \"Workspace Agent will be downloaded from Workspace Master\"\n AGENT_BINARIES_URI=${DOWNLOAD_AGENT_BINARIES_URI}\nfi\n\ncurl -s ${AGENT_BINARIES_URI} | tar xzf - -C ${CHE_DIR}/ws-agent\n\n###############################################\n### ws-agent run command will be added here ###\n### ~/che/ws-agent/bin/catalina.sh run ###\n###############################################" } diff --git a/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ls.json.script.sh b/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ls.json.script.sh index 4a45f2b0ea..7450c24421 100644 --- a/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ls.json.script.sh +++ b/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ls.json.script.sh @@ -112,7 +112,7 @@ elif echo ${LINUX_TYPE} | grep -qi "debian"; then # Fedora 23 ########### elif echo ${LINUX_TYPE} | grep -qi "fedora"; then - PACKAGES=${PACKAGES}" procps-ng" + command -v ps >/dev/null 2>&1 || { PACKAGES=${PACKAGES}" procps-ng"; } test "${PACKAGES}" = "" || { ${SUDO} dnf -y install ${PACKAGES}; } diff --git a/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ls.php.script.sh b/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ls.php.script.sh index 3e87919b29..fbef63557d 100644 --- a/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ls.php.script.sh +++ b/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ls.php.script.sh @@ -75,7 +75,7 @@ elif echo ${LINUX_TYPE} | grep -qi "debian"; then # Fedora 23 ########### elif echo ${LINUX_TYPE} | grep -qi "fedora"; then - PACKAGES=${PACKAGES}" procps-ng" + command -v ps >/dev/null 2>&1 || { PACKAGES=${PACKAGES}" procps-ng"; } test "${PACKAGES}" = "" || { ${SUDO} dnf -y install ${PACKAGES}; } diff --git a/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ls.typescript.script.sh b/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ls.typescript.script.sh index b10165e979..1219e43a98 100644 --- a/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ls.typescript.script.sh +++ b/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ls.typescript.script.sh @@ -112,7 +112,7 @@ elif echo ${LINUX_TYPE} | grep -qi "debian"; then # Fedora 23 ########### elif echo ${LINUX_TYPE} | grep -qi "fedora"; then - PACKAGES=${PACKAGES}" procps-ng" + command -v ps >/dev/null 2>&1 || { PACKAGES=${PACKAGES}" procps-ng"; } test "${PACKAGES}" = "" || { ${SUDO} dnf -y install ${PACKAGES}; } diff --git a/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ssh.script.sh b/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ssh.script.sh index ddf662ddec..7ff0cf9c70 100644 --- a/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ssh.script.sh +++ b/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ssh.script.sh @@ -70,7 +70,7 @@ elif echo ${LINUX_TYPE} | grep -qi "debian"; then # Fedora 23 ########### elif echo ${LINUX_TYPE} | grep -qi "fedora"; then - PACKAGES=${PACKAGES}" procps-ng" + command -v ps >/dev/null 2>&1 || { PACKAGES=${PACKAGES}" procps-ng"; } command -v sshd >/dev/null 2>&1 || { PACKAGES=${PACKAGES}" openssh-server"; } test "${PACKAGES}" = "" || { ${SUDO} dnf -y install ${PACKAGES}; diff --git a/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.terminal.script.sh b/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.terminal.script.sh index 00b8a57bfb..808ee71fac 100644 --- a/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.terminal.script.sh +++ b/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.terminal.script.sh @@ -67,7 +67,7 @@ elif echo ${LINUX_TYPE} | grep -qi "debian"; then # Fedora 23 ########### elif echo ${LINUX_TYPE} | grep -qi "fedora"; then - PACKAGES=${PACKAGES}" procps-ng" + command -v ps >/dev/null 2>&1 || { PACKAGES=${PACKAGES}" procps-ng"; } test "${PACKAGES}" = "" || { ${SUDO} dnf -y install ${PACKAGES}; } diff --git a/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.unison.script.sh b/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.unison.script.sh index 81f110ed3c..21f5e5110c 100644 --- a/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.unison.script.sh +++ b/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.unison.script.sh @@ -66,7 +66,7 @@ elif echo ${LINUX_TYPE} | grep -qi "debian"; then # Fedora 23 ########### elif echo ${LINUX_TYPE} | grep -qi "fedora"; then - PACKAGES=${PACKAGES}" procps-ng" + command -v ps >/dev/null 2>&1 || { PACKAGES=${PACKAGES}" procps-ng"; } command -v unison >/dev/null 2>&1 || { PACKAGES=${PACKAGES}" unison"; } test "${PACKAGES}" = "" || { ${SUDO} dnf -y install ${PACKAGES}; diff --git a/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ws-agent.script.sh b/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ws-agent.script.sh index 517191875a..d7b751ac2e 100644 --- a/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ws-agent.script.sh +++ b/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ws-agent.script.sh @@ -67,7 +67,7 @@ elif echo ${LINUX_TYPE} | grep -qi "debian"; then # Fedora 23 ########### elif echo ${LINUX_TYPE} | grep -qi "fedora"; then - PACKAGES=${PACKAGES}" procps-ng" + command -v ps >/dev/null 2>&1 || { PACKAGES=${PACKAGES}" procps-ng"; } test "${PACKAGES}" = "" || { ${SUDO} dnf -y install ${PACKAGES}; }