From d41ff1a0e09bf8d5a2776d58fe0fc09aa725aa30 Mon Sep 17 00:00:00 2001 From: Tyler Jewell Date: Wed, 24 Aug 2016 13:02:02 -0700 Subject: [PATCH] Changes to support che-in-che (#2119) * Che server container editable * Add CHE_WORKSPACE_STORAGE variable * stack and template * fixed echo bug * Added profiler * Fix CHE_DATA_FOLDER issues * Add additional variables to be honored * ordering * Fix profile add * Revert change to ExtraVolumeProvider * fixed profile update --- che.sh | 313 +++++++++++++++--- dockerfiles/che-launcher/launcher.sh | 31 +- dockerfiles/che-launcher/launcher_cmds.sh | 1 - dockerfiles/che-launcher/launcher_funcs.sh | 15 +- .../src/main/resources/stacks.json | 84 +++++ .../src/main/resources/samples.json | 27 ++ 6 files changed, 402 insertions(+), 69 deletions(-) diff --git a/che.sh b/che.sh index aa93e98e2d9..0e506b14598 100755 --- a/che.sh +++ b/che.sh @@ -40,22 +40,33 @@ check_docker() { init_global_variables() { - CHE_LAUNCHER_IMAGE_NAME="codenvy/che-launcher" - CHE_SERVER_IMAGE_NAME="codenvy/che-server" - CHE_FILE_IMAGE_NAME="codenvy/che-file" - CHE_MOUNT_IMAGE_NAME="codenvy/che-mount" - CHE_TEST_IMAGE_NAME="codenvy/che-test" - - CHE_LAUNCHER_CONTAINER_NAME="che-launcher" - CHE_SERVER_CONTAINER_NAME="che-server" - CHE_FILE_CONTAINER_NAME="che-file" - CHE_MOUNT_CONTAINER_NAME="che-mount" - CHE_TEST_CONTAINER_NAME="che-test" - - # User configurable variables + DEFAULT_CHE_LAUNCHER_IMAGE_NAME="codenvy/che-launcher" + DEFAULT_CHE_SERVER_IMAGE_NAME="codenvy/che-server" + DEFAULT_CHE_FILE_IMAGE_NAME="codenvy/che-file" + DEFAULT_CHE_MOUNT_IMAGE_NAME="codenvy/che-mount" + DEFAULT_CHE_TEST_IMAGE_NAME="codenvy/che-test" + + DEFAULT_CHE_LAUNCHER_CONTAINER_NAME="che-launcher" + DEFAULT_CHE_SERVER_CONTAINER_NAME="che-server" + DEFAULT_CHE_FILE_CONTAINER_NAME="che-file" + DEFAULT_CHE_MOUNT_CONTAINER_NAME="che-mount" + DEFAULT_CHE_TEST_CONTAINER_NAME="che-test" + DEFAULT_CHE_VERSION="latest" DEFAULT_CHE_CLI_ACTION="help" + CHE_LAUNCHER_IMAGE_NAME=${CHE_LAUNCHER_IMAGE_NAME:-${DEFAULT_CHE_LAUNCHER_IMAGE_NAME}} + CHE_SERVER_IMAGE_NAME=${CHE_SERVER_IMAGE_NAME:-${DEFAULT_CHE_SERVER_IMAGE_NAME}} + CHE_FILE_IMAGE_NAME=${CHE_FILE_IMAGE_NAME:-${DEFAULT_CHE_FILE_IMAGE_NAME}} + CHE_MOUNT_IMAGE_NAME=${CHE_MOUNT_IMAGE_NAME:-${DEFAULT_CHE_MOUNT_IMAGE_NAME}} + CHE_TEST_IMAGE_NAME=${CHE_TEST_IMAGE_NAME:-${DEFAULT_CHE_TEST_IMAGE_NAME}} + + CHE_LAUNCHER_CONTAINER_NAME=${CHE_LAUNCHER_CONTAINER_NAME:-${DEFAULT_CHE_LAUNCHER_CONTAINER_NAME}} + CHE_SERVER_CONTAINER_NAME=${CHE_SERVER_CONTAINER_NAME:-${DEFAULT_CHE_SERVER_CONTAINER_NAME}} + CHE_FILE_CONTAINER_NAME=${CHE_FILE_CONTAINER_NAME:-${DEFAULT_CHE_FILE_CONTAINER_NAME}} + CHE_MOUNT_CONTAINER_NAME=${CHE_MOUNT_CONTAINER_NAME:-${DEFAULT_CHE_MOUNT_CONTAINER_NAME}} + CHE_TEST_CONTAINER_NAME=${CHE_TEST_CONTAINER_NAME:-${DEFAULT_CHE_TEST_CONTAINER_NAME}} + CHE_VERSION=${CHE_VERSION:-${DEFAULT_CHE_VERSION}} CHE_CLI_ACTION=${CHE_CLI_ACTION:-${DEFAULT_CHE_CLI_ACTION}} @@ -70,6 +81,13 @@ Usage: che [COMMAND] stop Stops Che server restart Restart Che server update Pulls specific version, respecting CHE_VERSION + profile add Add a profile to ~/.che/ + profile set Set this profile as the default for Che CLI + profile unset Removes the default profile - leaves it unset + profile rm Remove this profile from ~/.che/ + profile update Update profile in ~/.che/ + profile info Print the profile configuration + profile list List available profiles mount Synchronize workspace to a local directory init Initialize directory with Che configuration up Create workspace from source in current directory @@ -104,7 +122,7 @@ parse_command_line () { CHE_CLI_ACTION="help" else case $1 in - start|stop|restart|update|info|init|up|mount|test|help|-h|--help) + start|stop|restart|update|info|profile|init|up|mount|test|help|-h|--help) CHE_CLI_ACTION=$1 ;; *) @@ -205,7 +223,11 @@ has_docker_for_windows_client(){ } get_full_path() { - echo "$(cd "$(dirname "$1")"; pwd)/$(basename "$1")" + # "/some/path" => /some/path + OUTPUT_PATH=${1//\"} + + # create full directory path + echo "$(cd "$(dirname "${OUTPUT_PATH}")"; pwd)/$(basename "$1")" } convert_windows_to_posix() { @@ -226,11 +248,13 @@ get_clean_path() { } get_mount_path() { - FULL_PATH=$(get_full_path $1) - POSIX_PATH=$(convert_windows_to_posix $FULL_PATH) - echo $(get_clean_path $POSIX_PATH) -} + FULL_PATH=$(get_full_path "${1}") + + POSIX_PATH=$(convert_windows_to_posix "${FULL_PATH}") + CLEAN_PATH=$(get_clean_path "${POSIX_PATH}") + echo $CLEAN_PATH +} has_docker_for_windows_ip() { if [ "${GLOBAL_GET_DOCKER_HOST_IP}" = "10.0.75.2" ]; then @@ -255,27 +279,32 @@ get_list_of_che_system_environment_variables() { DOCKER_ENV="tmp" RETURN="" - CHE_VARIABLES=$(env | grep CHE_) - - if [ ! -z ${CHE_VARIABLES+x} ]; then - env | grep CHE_ >> $DOCKER_ENV - RETURN="--env-file=$DOCKER_ENV" - fi - - # Add in known proxy variables - if [ ! -z ${http_proxy+x} ]; then - echo "http_proxy=${http_proxy}" >> $DOCKER_ENV - RETURN="--env-file=$DOCKER_ENV" - fi - - if [ ! -z ${https_proxy+x} ]; then - echo "https_proxy=${https_proxy}" >> $DOCKER_ENV - RETURN="--env-file=$DOCKER_ENV" - fi - - if [ ! -z ${no_proxy+x} ]; then - echo "no_proxy=${no_proxy}" >> $DOCKER_ENV - RETURN="--env-file=$DOCKER_ENV" + if has_default_profile; then + cat ~/.che/${CHE_PROFILE} >> $DOCKER_ENV + RETURN=$DOCKER_ENV + else + CHE_VARIABLES=$(env | grep CHE_) + + if [ ! -z ${CHE_VARIABLES+x} ]; then + env | grep CHE_ >> $DOCKER_ENV + RETURN=$DOCKER_ENV + fi + + # Add in known proxy variables + if [ ! -z ${http_proxy+x} ]; then + echo "http_proxy=${http_proxy}" >> $DOCKER_ENV + RETURN=$DOCKER_ENV + fi + + if [ ! -z ${https_proxy+x} ]; then + echo "https_proxy=${https_proxy}" >> $DOCKER_ENV + RETURN=$DOCKER_ENV + fi + + if [ ! -z ${no_proxy+x} ]; then + echo "no_proxy=${no_proxy}" >> $DOCKER_ENV + RETURN=$DOCKER_ENV + fi fi echo $RETURN @@ -297,9 +326,10 @@ execute_che_launcher() { check_current_image_and_update_if_not_found ${CHE_LAUNCHER_IMAGE_NAME} info "ECLIPSE CHE: LAUNCHING LAUNCHER" + docker_exec run -t --rm --name "${CHE_LAUNCHER_CONTAINER_NAME}" \ -v /var/run/docker.sock:/var/run/docker.sock \ - $(get_list_of_che_system_environment_variables) \ + --env-file=$(get_list_of_che_system_environment_variables) \ "${CHE_LAUNCHER_IMAGE_NAME}":"${CHE_VERSION}" "${CHE_CLI_ACTION}" || true # Remove temporary file @@ -312,12 +342,12 @@ execute_che_file() { info "ECLIPSE CHE FILE: LAUNCHING CONTAINER" CURRENT_DIRECTORY=$(get_mount_path "${PWD}") + docker_exec run -it --rm --name "${CHE_FILE_CONTAINER_NAME}" \ -v /var/run/docker.sock:/var/run/docker.sock \ -v "$CURRENT_DIRECTORY":"$CURRENT_DIRECTORY" \ "${CHE_FILE_IMAGE_NAME}":"${CHE_VERSION}" \ "${CURRENT_DIRECTORY}" "${CHE_CLI_ACTION}" - # > /dev/null 2>&1 } update_che_image() { @@ -326,10 +356,8 @@ update_che_image() { fi info "ECLIPSE CHE: PULLING IMAGE $1:${CHE_VERSION}" - info "" docker pull $1:${CHE_VERSION} - info "" - info "ECLIPSE CHE: IMAGE $1:${CHE_VERSION} INSTALLED" + echo "" } mount_local_directory() { @@ -338,7 +366,7 @@ mount_local_directory() { return fi - MOUNT_PATH=$(get_mount_path $2) + MOUNT_PATH=$(get_mount_path "${2}") if [ ! -e "${MOUNT_PATH}" ]; then error "che mount: Path provided does not exist." @@ -380,7 +408,6 @@ execute_che_debug() { ;; --server|-server) print_che_cli_debug - info "" execute_che_launcher ;; --create|-create) @@ -390,7 +417,6 @@ execute_che_debug() { debug "Unknown debug flag passed: $2. Exiting." ;; esac - } execute_che_test() { @@ -406,6 +432,7 @@ print_che_cli_debug() { debug "---------------------------------------" debug "" debug "--------- PLATFORM INFO -------------" + debug "CHE CLI DEFAULT PROFILE = $(has_default_profile && echo $(get_default_profile) || echo "not set")" debug "DOCKER_INSTALL_TYPE = $(get_docker_install_type)" debug "DOCKER_HOST_IP = ${GLOBAL_GET_DOCKER_HOST_IP}" debug "IS_DOCKER_FOR_WINDOWS = $(is_docker_for_windows && echo "YES" || echo "NO")" @@ -418,7 +445,6 @@ print_che_cli_debug() { debug "---------------------------------------" debug "---------------------------------------" debug "---------------------------------------" - # Clenaup from any previous lingering tests } run_connectivity_tests() { @@ -488,6 +514,186 @@ run_connectivity_tests() { docker rm -f fakeagent > /dev/null } +execute_profile(){ + + if [ ! $# -ge 2 ]; then + error "" + error "che profile: Wrong number of arguments." + error "" + return + fi + + case ${2} in + add|rm|set|info|update) + if [ ! $# -eq 3 ]; then + error "" + error "che profile: Wrong number of arguments." + error "" + return + fi + ;; + unset|list) + if [ ! $# -eq 2 ]; then + error "" + error "che profile: Wrong number of arguments." + error "" + return + fi + ;; + esac + + case ${2} in + add) + if [ -f ~/.che/"${3}" ]; then + error "" + error "Profile ~/.che/${3} already exists. Nothing to do. Exiting." + error "" + return + fi + + test -d ~/.che || mkdir -p ~/.che + touch ~/.che/"${3}" + + echo "CHE_LAUNCHER_IMAGE_NAME=$CHE_LAUNCHER_IMAGE_NAME" > ~/.che/"${3}" + echo "CHE_SERVER_IMAGE_NAME=$CHE_SERVER_IMAGE_NAME" >> ~/.che/"${3}" + echo "CHE_FILE_IMAGE_NAME=$CHE_FILE_IMAGE_NAME" >> ~/.che/"${3}" + echo "CHE_MOUNT_IMAGE_NAME=$CHE_MOUNT_IMAGE_NAME" >> ~/.che/"${3}" + echo "CHE_TEST_IMAGE_NAME=$CHE_TEST_IMAGE_NAME" >> ~/.che/"${3}" + + echo "CHE_LAUNCHER_CONTAINER_NAME=$CHE_LAUNCHER_CONTAINER_NAME" >> ~/.che/"${3}" + echo "CHE_SERVER_CONTAINER_NAME=$CHE_SERVER_CONTAINER_NAME" >> ~/.che/"${3}" + echo "CHE_FILE_CONTAINER_NAME=$CHE_FILE_CONTAINER_NAME" >> ~/.che/"${3}" + echo "CHE_MOUNT_CONTAINER_NAME=$CHE_MOUNT_CONTAINER_NAME" >> ~/.che/"${3}" + echo "CHE_TEST_CONTAINER_NAME=$CHE_TEST_CONTAINER_NAME" >> ~/.che/"${3}" + + # Add all other variables to the profile + env | grep CHE_ >> ~/.che/"${3}" + + # Remove duplicates, if any + cat ~/.che/"${3}" | sort | uniq > ~/.che/tmp + mv -f ~/.che/tmp ~/.che/"${3}" + + + info "" + info "Added new Che CLI profile ~/.che/${3}." + info "" + ;; + update) + if [ ! -f ~/.che/"${3}" ]; then + error "" + error "Profile ~/.che/${3} does not exist. Nothing to update. Exiting." + error "" + return + fi + + execute_profile profile rm "${3}" + execute_profile profile add "${3}" + ;; + rm) + if [ ! -f ~/.che/"${3}" ]; then + error "" + error "Profile ~/.che/${3} does not exist. Nothing to do. Exiting." + error "" + return + fi + + rm ~/.che/"${3}" > /dev/null + + info "" + info "Removed Che CLI profile ~/.che/${3}." + info "" + ;; + info) + if [ ! -f ~/.che/"${3}" ]; then + error "" + error "Profile ~/.che/${3} does not exist. Nothing to do. Exiting." + error "" + return + fi + + + debug "---------------------------------------" + debug "--------- CHE CLI PROFILE INFO --------" + debug "---------------------------------------" + debug "" + debug "Profile ~/.che/${3} contains:" + while IFS= read line + do + # display $line or do somthing with $line + debug "$line" + done <~/.che/"${3}" + ;; + set) + if [ ! -f ~/.che/"${3}" ]; then + error "" + error "Profile ~/.che/${3} does not exist. Nothing to do. Exiting." + error "" + return + fi + + echo "CHE_PROFILE=${3}" > ~/.che/.profile + + info "" + info "Set active Che CLI profile to ~/.che/${3}." + info "" + ;; + unset) + if [ ! -f ~/.che/.profile ]; then + error "" + error "Default profile not set. Nothing to do. Exiting." + error "" + return + fi + + rm -rf ~/.che/.profile + + info "" + info "Unset the default Che CLI profile. No profile currently set." + info "" + ;; + list) + if [ -d ~/.che ]; then + info "" + info "Available Che CLI profiles:" + ls ~/.che/ + fi + ;; + esac +} + +has_default_profile() { + if [ -f ~/.che/.profile ]; then + return 0 + else + return 1 + fi +} + +get_default_profile() { + if [ has_default_profile ]; then + source ~/.che/.profile + echo "${CHE_PROFILE}" + else + echo "" + fi +} + +load_profile() { + if has_default_profile; then + + source ~/.che/.profile + + if [ ! -f ~/.che/"${CHE_PROFILE}" ]; then + error "" + error "Che CLI profile set in ~/.che/.profile to '${CHE_PROFILE}' but ~/.che/${CHE_PROFILE} does not exist." + error "" + return + fi + + source ~/.che/"${CHE_PROFILE}" + fi +} + # See: https://sipb.mit.edu/doc/safe-shell/ set -e set -u @@ -495,8 +701,10 @@ init_logging check_docker init_global_variables parse_command_line "$@" +load_profile if is_boot2docker; then + debug "" debug "Boot2docker detected - limited mounting" debug "Host OS -> Che folder mapping disabled" debug "Consider Docker for Mac or Windows to activate mounting" @@ -507,14 +715,19 @@ case ${CHE_CLI_ACTION} in start|stop|restart) execute_che_launcher ;; + profile) + execute_profile "$@" + ;; init|up) execute_che_file ;; update) update_che_image ${CHE_LAUNCHER_IMAGE_NAME} - update_che_image ${CHE_SERVER_IMAGE_NAME} update_che_image ${CHE_MOUNT_IMAGE_NAME} update_che_image ${CHE_FILE_IMAGE_NAME} + + # Delegate updating che-server to the launcher + execute_che_launcher ;; mount) mount_local_directory "$@" diff --git a/dockerfiles/che-launcher/launcher.sh b/dockerfiles/che-launcher/launcher.sh index c3a3e1182a4..fb023427515 100755 --- a/dockerfiles/che-launcher/launcher.sh +++ b/dockerfiles/che-launcher/launcher.sh @@ -22,10 +22,6 @@ init_logging() { init_global_variables() { - CHE_SERVER_CONTAINER_NAME="che-server" - CHE_SERVER_IMAGE_NAME="codenvy/che-server" - CHE_LAUNCHER_IMAGE_NAME="codenvy/che-launcher" - # Set variables that use docker as utilities to avoid over container execution ETH0_ADDRESS=$(docker run --rm --net host alpine /bin/sh -c "ifconfig eth0 2> /dev/null" | \ grep "inet addr:" | \ @@ -52,6 +48,8 @@ init_global_variables() { DOCKER_INSTALL_TYPE=$(get_docker_install_type) # User configurable variables + DEFAULT_CHE_SERVER_CONTAINER_NAME="che-server" + DEFAULT_CHE_SERVER_IMAGE_NAME="codenvy/che-server" DEFAULT_DOCKER_HOST_IP=$(get_docker_host_ip) DEFAULT_CHE_HOSTNAME=$(get_che_hostname) DEFAULT_CHE_PORT="8080" @@ -62,9 +60,12 @@ init_global_variables() { DEFAULT_CHE_DATA_FOLDER="/home/user/che" # Clean eventual user provided paths - CHE_CONF_FOLDER=${CHE_CONF_FOLDER:+$(get_clean_path ${CHE_CONF_FOLDER})} - CHE_DATA_FOLDER=${CHE_DATA_FOLDER:+$(get_clean_path ${CHE_DATA_FOLDER})} + CHE_CONF_FOLDER=${CHE_CONF_FOLDER:+$(get_converted_and_clean_path "${CHE_CONF_FOLDER}")} + CHE_DATA_FOLDER=${CHE_DATA_FOLDER:+$(get_converted_and_clean_path "${CHE_DATA_FOLDER}")} + CHE_LOCAL_BINARY=${CHE_LOCAL_BINARY:+$(get_converted_and_clean_path "${CHE_LOCAL_BINARY}")} + CHE_SERVER_IMAGE_NAME=${CHE_SERVER_IMAGE_NAME:-${DEFAULT_CHE_SERVER_IMAGE_NAME}} + CHE_SERVER_CONTAINER_NAME=${CHE_SERVER_CONTAINER_NAME:-${DEFAULT_CHE_SERVER_CONTAINER_NAME}} CHE_HOSTNAME=${CHE_HOSTNAME:-${DEFAULT_CHE_HOSTNAME}} CHE_PORT=${CHE_PORT:-${DEFAULT_CHE_PORT}} CHE_VERSION=${CHE_VERSION:-${DEFAULT_CHE_VERSION}} @@ -78,16 +79,14 @@ init_global_variables() { # - empty if CHE_CONF_FOLDER is not set # - -v ${CHE_CONF_FOLDER}:/conf -e "CHE_LOCAL_CONF_DIR=/conf" if CHE_CONF_FOLDER is set CHE_CONF_ARGS=${CHE_CONF_FOLDER:+-v "${CHE_CONF_FOLDER}":/conf -e "CHE_LOCAL_CONF_DIR=/conf"} - CHE_LOCAL_BINARY_ARGS=${CHE_LOCAL_BINARY:+-v ${CHE_LOCAL_BINARY}:/home/user/che} - if is_docker_for_mac || is_docker_for_windows; then - CHE_STORAGE_ARGS=${CHE_DATA_FOLDER:+-v "${CHE_DATA_FOLDER}/storage":/home/user/che/storage \ - -e "CHE_WORKSPACE_STORAGE=${CHE_DATA_FOLDER}/workspaces" \ - -e "CHE_WORKSPACE_STORAGE_CREATE_FOLDERS=false"} - else - CHE_STORAGE_ARGS=${CHE_DATA_FOLDER:+-v "${CHE_DATA_FOLDER}/storage":/home/user/che/storage \ - -v "${CHE_DATA_FOLDER}/workspaces":/home/user/che/workspaces} - fi + # CHE_LOCAL_BINARY is the path to a Che assembly that will be mounted into the Che server container + CHE_LOCAL_BINARY_ARGS=${CHE_LOCAL_BINARY:+-v "${CHE_LOCAL_BINARY}":/home/user/che} + + # CHE_STORAGE_ARGS is where Che JSON files and workspace / project files are saved + CHE_STORAGE_ARGS=${CHE_DATA_FOLDER:+-v "${CHE_DATA_FOLDER}"/storage:/home/user/che/storage \ + -e CHE_WORKSPACE_STORAGE="${CHE_DATA_FOLDER}"/workspaces \ + -e CHE_WORKSPACE_STORAGE_CREATE_FOLDERS=false} if [ "${CHE_LOG_LEVEL}" = "debug" ]; then CHE_DEBUG_OPTION="--debug --log_level:debug" @@ -97,7 +96,7 @@ init_global_variables() { USAGE=" Usage: - docker run -v /var/run/docker.sock:/var/run/docker.sock ${CHE_LAUNCHER_IMAGE_NAME} [COMMAND] + docker run --rm -t -v /var/run/docker.sock:/var/run/docker.sock eclipse/che [COMMAND] start Starts Che server stop Stops Che server restart Restart Che server diff --git a/dockerfiles/che-launcher/launcher_cmds.sh b/dockerfiles/che-launcher/launcher_cmds.sh index 9a3565482e8..bd45ef32baa 100644 --- a/dockerfiles/che-launcher/launcher_cmds.sh +++ b/dockerfiles/che-launcher/launcher_cmds.sh @@ -94,7 +94,6 @@ update_che_server() { info "ECLIPSE CHE: PULLING IMAGE ${CHE_SERVER_IMAGE_NAME}:${CHE_VERSION}" execute_command_with_progress extended docker pull ${CHE_SERVER_IMAGE_NAME}:${CHE_VERSION} - info "ECLIPSE CHE: IMAGE ${CHE_SERVER_IMAGE_NAME}:${CHE_VERSION} INSTALLED" } print_debug_info() { diff --git a/dockerfiles/che-launcher/launcher_funcs.sh b/dockerfiles/che-launcher/launcher_funcs.sh index d0cb21cec4f..ee8eb2e87c6 100644 --- a/dockerfiles/che-launcher/launcher_funcs.sh +++ b/dockerfiles/che-launcher/launcher_funcs.sh @@ -34,6 +34,12 @@ error_exit() { exit 1 } +convert_windows_to_posix() { + # "/some/path" => /some/path + OUTPUT_PATH=${1//\"} + echo "/"$(echo "$OUTPUT_PATH" | sed 's/\\/\//g' | sed 's/://') +} + get_clean_path() { INPUT_PATH=$1 # \some\path => /some/path @@ -47,6 +53,12 @@ get_clean_path() { echo ${OUTPUT_PATH} } +get_converted_and_clean_path() { + CONVERTED_PATH=$(convert_windows_to_posix "${1}") + CLEAN_PATH=$(get_clean_path "${CONVERTED_PATH}") + echo $CLEAN_PATH +} + get_che_launcher_container_id() { hostname } @@ -229,7 +241,7 @@ get_che_container_image_name() { } get_che_server_container_id() { - docker ps -qa -f "name=${CHE_SERVER_CONTAINER_NAME}" + docker ps -q -a -f "name=${CHE_SERVER_CONTAINER_NAME}" } wait_until_container_is_running() { @@ -278,7 +290,6 @@ execute_command_with_progress() { shift 2 pid="" - printf "\n" case "$progress" in extended) diff --git a/ide/che-core-ide-stacks/src/main/resources/stacks.json b/ide/che-core-ide-stacks/src/main/resources/stacks.json index 824d828d5b7..7345190f985 100644 --- a/ide/che-core-ide-stacks/src/main/resources/stacks.json +++ b/ide/che-core-ide-stacks/src/main/resources/stacks.json @@ -1,4 +1,88 @@ [ + { + "id": "che-in-che", + "creator": "ide", + "name": "Eclipse Che", + "description": "Utilities to build Che with Che. Alpine, JDK 8, maven, git, docker.", + "scope": "general", + "tags": [ + "Java", + "JDK", + "Maven", + "Tomcat", + "Subversion", + "Ubuntu", + "Git", + "Che", + "Docker" + ], + "components": [ + { + "name": "JDK", + "version": "1.8.0_92" + }, + { + "name": "Maven", + "version": "3.3.9" + }, + { + "name": "Tomcat", + "version": "8.0.29" + } + { + "name": "Docker", + "version": "1.12.0" + } + ], + "source": { + "type": "image", + "origin": "codenvy/alpine-jdk:nightly" + }, + "workspaceConfig": { + "environments": [ + { + "name": "default", + "recipe": null, + "machineConfigs": [ + { + "name": "default", + "limits": { + "ram": 1000 + }, + "source": { + "location": "stub", + "type": "dockerfile" + }, + "type": "docker", + "dev": true + } + ] + } + ], + "name": "Che in Che", + "defaultEnv": "default", + "description": null, + "commands": [ + { + "commandLine": "mvn clean install -f ${current.project.path}", + "name": "build", + "type": "mvn" + } + ] + }, + "acl": [ + { + "user": "*", + "actions": [ + "search" + ] + } + ], + "stackIcon": { + "name": "type-java.svg", + "mediaType": "image/svg+xml" + } + }, { "id": "java-default", "creator": "ide", diff --git a/ide/che-core-ide-templates/src/main/resources/samples.json b/ide/che-core-ide-templates/src/main/resources/samples.json index ee430a28778..6c8f0a98ad2 100644 --- a/ide/che-core-ide-templates/src/main/resources/samples.json +++ b/ide/che-core-ide-templates/src/main/resources/samples.json @@ -1,4 +1,31 @@ [ + { + "name": "che-in-che", + "displayName": "eclipse-che", + "path": "/che", + "description": "The Eclipse Che source code. Build Che-in-Che.", + "projectType": "maven", + "mixins": [], + "attributes": { + "language": [ + "java" + ] + }, + "modules": [], + "problems": [], + "source": { + "type": "git", + "location": "https://github.com/eclipse/che", + "parameters": {} + }, + "commands": [], + "links": [], + "category": "Samples", + "tags": [ + "maven", + "java" + ] + }, { "name": "blank-project", "displayName": "blank-project",