From df7fcba7a06242c72effc5ab120128d430067cf4 Mon Sep 17 00:00:00 2001 From: Florent Benoit Date: Mon, 1 Jul 2019 10:52:21 +0200 Subject: [PATCH] Remove Docker CLI and images parts of the CLI Fix #13649 move init files used by keycloak and postgres to their folders Change-Id: I66dbb2d6df1f3c062e981a6a513c36be8aa1d39a Signed-off-by: Florent Benoit --- dockerfiles/action/.require | 1 - dockerfiles/action/Dockerfile | 16 - dockerfiles/action/README.md | 21 - dockerfiles/action/build.sh | 15 - dockerfiles/base/Dockerfile | 40 - dockerfiles/base/build.sh | 15 - .../base/scripts/base/commands/cmd_abuild.sh | 51 - .../base/scripts/base/commands/cmd_action.sh | 45 - .../scripts/base/commands/cmd_agenerate.sh | 115 -- .../scripts/base/commands/cmd_archetype.sh | 185 --- .../base/scripts/base/commands/cmd_arun.sh | 44 - .../base/scripts/base/commands/cmd_astop.sh | 44 - .../base/scripts/base/commands/cmd_backup.sh | 79 - .../base/scripts/base/commands/cmd_config.sh | 207 --- .../base/scripts/base/commands/cmd_destroy.sh | 99 -- .../base/scripts/base/commands/cmd_dir.sh | 47 - .../scripts/base/commands/cmd_download.sh | 53 - .../base/scripts/base/commands/cmd_help.sh | 30 - .../base/scripts/base/commands/cmd_info.sh | 194 --- .../base/scripts/base/commands/cmd_init.sh | 172 --- .../base/scripts/base/commands/cmd_offline.sh | 155 -- .../base/scripts/base/commands/cmd_restart.sh | 48 - .../base/scripts/base/commands/cmd_restore.sh | 76 - .../base/scripts/base/commands/cmd_rmi.sh | 55 - .../base/scripts/base/commands/cmd_ssh.sh | 41 - .../base/scripts/base/commands/cmd_start.sh | 325 ---- .../base/scripts/base/commands/cmd_stop.sh | 77 - .../base/scripts/base/commands/cmd_sync.sh | 67 - .../base/scripts/base/commands/cmd_test.sh | 39 - .../base/scripts/base/commands/cmd_upgrade.sh | 79 - .../base/scripts/base/commands/cmd_version.sh | 75 - dockerfiles/base/scripts/base/library.sh | 351 ----- dockerfiles/base/scripts/base/startup.sh | 32 - .../base/scripts/base/startup_01_init.sh | 359 ----- .../scripts/base/startup_02_pre_docker.sh | 717 --------- .../scripts/base/startup_03_pre_networking.sh | 267 ---- .../scripts/base/startup_04_pre_cli_init.sh | 413 ------ .../base/scripts/base/startup_05_pre_exec.sh | 89 -- dockerfiles/base/scripts/entrypoint.sh | 13 - dockerfiles/bats/Dockerfile | 28 - dockerfiles/bats/build.sh | 15 - dockerfiles/cli/.dockerignore | 1 - dockerfiles/cli/.gitignore | 1 - dockerfiles/cli/.require | 4 - dockerfiles/cli/Dockerfile | 19 - dockerfiles/cli/build.sh | 29 - dockerfiles/cli/images.template | 6 - dockerfiles/cli/scripts/post_init.sh | 15 - dockerfiles/cli/scripts/pre_init.sh | 30 - dockerfiles/cli/test.sh | 59 - .../cli/tests/cli_prompts_usage_tests.bats | 49 - .../cli/tests/cmd_backup_restore_tests.bats | 128 -- dockerfiles/cli/tests/cmd_config_tests.bats | 41 - dockerfiles/cli/tests/cmd_info_tests.bats | 34 - .../cli/tests/cmd_init_destroy_tests.bats | 123 -- dockerfiles/cli/tests/cmd_offline_tests.bats | 68 - .../tests/cmd_start_stop_restart_tests.bats | 89 -- .../cli/tests/override_image_tests.bats | 43 - .../startup_03_pre_networking_tests.bats | 93 -- dockerfiles/cli/tests/test_base.sh | 157 -- dockerfiles/cli/version/4.7.2/images | 4 - dockerfiles/cli/version/4.7.2/images-stacks | 22 - dockerfiles/cli/version/5.0.0-M5/images | 4 - .../cli/version/5.0.0-M5/images-stacks | 22 - dockerfiles/cli/version/5.0.0-M6/images | 4 - .../cli/version/5.0.0-M6/images-stacks | 22 - dockerfiles/cli/version/5.0.0-M7/images | 4 - .../cli/version/5.0.0-M7/images-stacks | 22 - dockerfiles/cli/version/5.0.0-M8/images | 4 - .../cli/version/5.0.0-M8/images-stacks | 22 - dockerfiles/cli/version/5.0.0/images | 4 - dockerfiles/cli/version/5.0.0/images-stacks | 22 - dockerfiles/cli/version/5.0.1/images | 4 - dockerfiles/cli/version/5.0.1/images-stacks | 22 - dockerfiles/cli/version/5.1.0/images | 4 - dockerfiles/cli/version/5.1.0/images-stacks | 22 - dockerfiles/cli/version/5.1.1/images | 4 - dockerfiles/cli/version/5.1.1/images-stacks | 22 - dockerfiles/cli/version/5.10.0/images | 3 - dockerfiles/cli/version/5.10.0/images-stacks | 24 - dockerfiles/cli/version/5.11.0/images | 4 - dockerfiles/cli/version/5.11.0/images-stacks | 24 - dockerfiles/cli/version/5.11.1/images | 4 - dockerfiles/cli/version/5.11.1/images-stacks | 24 - dockerfiles/cli/version/5.11.2/images | 4 - dockerfiles/cli/version/5.11.2/images-stacks | 24 - dockerfiles/cli/version/5.12.0/images | 4 - dockerfiles/cli/version/5.12.0/images-stacks | 24 - dockerfiles/cli/version/5.13.0/images | 4 - dockerfiles/cli/version/5.13.0/images-stacks | 24 - dockerfiles/cli/version/5.14.0/images | 4 - dockerfiles/cli/version/5.14.0/images-stacks | 24 - dockerfiles/cli/version/5.15.0/images | 4 - dockerfiles/cli/version/5.15.0/images-stacks | 24 - dockerfiles/cli/version/5.16.0/images | 4 - dockerfiles/cli/version/5.16.0/images-stacks | 24 - dockerfiles/cli/version/5.17.0/images | 4 - dockerfiles/cli/version/5.17.0/images-stacks | 24 - dockerfiles/cli/version/5.18.0/images | 4 - dockerfiles/cli/version/5.18.0/images-stacks | 24 - dockerfiles/cli/version/5.18.1/images | 4 - dockerfiles/cli/version/5.18.1/images-stacks | 24 - dockerfiles/cli/version/5.19.0/images | 7 - dockerfiles/cli/version/5.19.0/images-stacks | 23 - dockerfiles/cli/version/5.2.0/images | 2 - dockerfiles/cli/version/5.2.0/images-stacks | 22 - dockerfiles/cli/version/5.2.1/images | 2 - dockerfiles/cli/version/5.2.1/images-stacks | 22 - dockerfiles/cli/version/5.2.2/images | 2 - dockerfiles/cli/version/5.2.2/images-stacks | 22 - dockerfiles/cli/version/5.20.0/images | 7 - dockerfiles/cli/version/5.20.0/images-stacks | 23 - dockerfiles/cli/version/5.20.1/images | 7 - dockerfiles/cli/version/5.20.1/images-stacks | 23 - dockerfiles/cli/version/5.21.0/images | 7 - dockerfiles/cli/version/5.21.0/images-stacks | 23 - dockerfiles/cli/version/5.22.0/images | 7 - dockerfiles/cli/version/5.22.0/images-stacks | 23 - dockerfiles/cli/version/5.3.0/images | 3 - dockerfiles/cli/version/5.3.0/images-stacks | 24 - dockerfiles/cli/version/5.3.1/images | 3 - dockerfiles/cli/version/5.3.1/images-stacks | 24 - dockerfiles/cli/version/5.4.0/images | 3 - dockerfiles/cli/version/5.4.0/images-stacks | 24 - dockerfiles/cli/version/5.4.1/images | 3 - dockerfiles/cli/version/5.4.1/images-stacks | 24 - dockerfiles/cli/version/5.5.0/images | 3 - dockerfiles/cli/version/5.5.0/images-stacks | 24 - dockerfiles/cli/version/5.6.0/images | 3 - dockerfiles/cli/version/5.6.0/images-stacks | 24 - dockerfiles/cli/version/5.7.0/images | 3 - dockerfiles/cli/version/5.7.0/images-stacks | 24 - dockerfiles/cli/version/5.7.1/images | 3 - dockerfiles/cli/version/5.7.1/images-stacks | 24 - dockerfiles/cli/version/5.7.2/images | 3 - dockerfiles/cli/version/5.7.2/images-stacks | 24 - dockerfiles/cli/version/5.8.0/images | 3 - dockerfiles/cli/version/5.8.0/images-stacks | 24 - dockerfiles/cli/version/5.8.1/images | 3 - dockerfiles/cli/version/5.8.1/images-stacks | 24 - dockerfiles/cli/version/5.9.0/images | 3 - dockerfiles/cli/version/5.9.0/images-stacks | 24 - dockerfiles/cli/version/5.9.1/images | 3 - dockerfiles/cli/version/5.9.1/images-stacks | 24 - dockerfiles/cli/version/6.0.0-M1/images | 7 - .../cli/version/6.0.0-M1/images-stacks | 23 - dockerfiles/cli/version/6.0.0-M2/images | 6 - .../cli/version/6.0.0-M2/images-stacks | 23 - dockerfiles/cli/version/6.0.0-M3/images | 6 - .../cli/version/6.0.0-M3/images-stacks | 23 - dockerfiles/cli/version/6.0.0-M4/images | 6 - .../cli/version/6.0.0-M4/images-stacks | 23 - dockerfiles/cli/version/6.0.0/images | 6 - dockerfiles/cli/version/6.0.0/images-stacks | 23 - dockerfiles/cli/version/6.1.0/images | 6 - dockerfiles/cli/version/6.1.0/images-stacks | 23 - dockerfiles/cli/version/6.10.0/images | 6 - dockerfiles/cli/version/6.10.0/images-stacks | 23 - dockerfiles/cli/version/6.11.0/images | 6 - dockerfiles/cli/version/6.11.0/images-stacks | 23 - dockerfiles/cli/version/6.12.0/images | 6 - .../cli/version/6.12.0/images-bootstrap | 2 - dockerfiles/cli/version/6.12.0/images-stacks | 23 - .../cli/version/6.12.0/images-utilities | 4 - dockerfiles/cli/version/6.13.0/images | 6 - .../cli/version/6.13.0/images-bootstrap | 2 - dockerfiles/cli/version/6.13.0/images-stacks | 23 - .../cli/version/6.13.0/images-utilities | 4 - dockerfiles/cli/version/6.14.0/images | 6 - .../cli/version/6.14.0/images-bootstrap | 2 - dockerfiles/cli/version/6.14.0/images-stacks | 23 - .../cli/version/6.14.0/images-utilities | 4 - dockerfiles/cli/version/6.15.0/images | 6 - .../cli/version/6.15.0/images-bootstrap | 2 - dockerfiles/cli/version/6.15.0/images-stacks | 23 - .../cli/version/6.15.0/images-utilities | 4 - dockerfiles/cli/version/6.16.0/images | 6 - .../cli/version/6.16.0/images-bootstrap | 2 - dockerfiles/cli/version/6.16.0/images-stacks | 23 - .../cli/version/6.16.0/images-utilities | 4 - dockerfiles/cli/version/6.17.0/images | 6 - .../cli/version/6.17.0/images-bootstrap | 2 - dockerfiles/cli/version/6.17.0/images-stacks | 23 - .../cli/version/6.17.0/images-utilities | 4 - dockerfiles/cli/version/6.18.0/images | 6 - .../cli/version/6.18.0/images-bootstrap | 2 - dockerfiles/cli/version/6.18.0/images-stacks | 23 - .../cli/version/6.18.0/images-utilities | 4 - dockerfiles/cli/version/6.19.0/images | 6 - .../cli/version/6.19.0/images-bootstrap | 2 - dockerfiles/cli/version/6.19.0/images-stacks | 23 - .../cli/version/6.19.0/images-utilities | 4 - dockerfiles/cli/version/6.2.0/images | 6 - dockerfiles/cli/version/6.2.0/images-stacks | 23 - dockerfiles/cli/version/6.3.0/images | 6 - dockerfiles/cli/version/6.3.0/images-stacks | 23 - dockerfiles/cli/version/6.4.0/images | 6 - dockerfiles/cli/version/6.4.0/images-stacks | 23 - dockerfiles/cli/version/6.4.1/images | 6 - dockerfiles/cli/version/6.4.1/images-stacks | 23 - dockerfiles/cli/version/6.5.0/images | 6 - dockerfiles/cli/version/6.5.0/images-stacks | 23 - dockerfiles/cli/version/6.5.1/images | 6 - dockerfiles/cli/version/6.5.1/images-stacks | 23 - dockerfiles/cli/version/6.5.2/images | 6 - dockerfiles/cli/version/6.5.2/images-stacks | 23 - dockerfiles/cli/version/6.5.3/images | 6 - dockerfiles/cli/version/6.5.3/images-stacks | 23 - dockerfiles/cli/version/6.6.0/images | 6 - dockerfiles/cli/version/6.6.0/images-stacks | 23 - dockerfiles/cli/version/6.6.1/images | 6 - dockerfiles/cli/version/6.6.1/images-stacks | 23 - dockerfiles/cli/version/6.7.0/images | 6 - dockerfiles/cli/version/6.7.0/images-stacks | 23 - dockerfiles/cli/version/6.8.0/images | 6 - dockerfiles/cli/version/6.8.0/images-stacks | 23 - dockerfiles/cli/version/6.9.0/images | 6 - dockerfiles/cli/version/6.9.0/images-stacks | 23 - dockerfiles/cli/version/7.0.0-RC-1.0/images | 6 - .../cli/version/7.0.0-RC-1.0/images-bootstrap | 2 - .../cli/version/7.0.0-RC-1.0/images-stacks | 23 - .../cli/version/7.0.0-RC-1.0/images-utilities | 4 - dockerfiles/cli/version/7.0.0-RC-2.0/images | 6 - .../cli/version/7.0.0-RC-2.0/images-bootstrap | 2 - .../cli/version/7.0.0-RC-2.0/images-stacks | 23 - .../cli/version/7.0.0-RC-2.0/images-utilities | 4 - dockerfiles/cli/version/7.0.0-beta-1.0/images | 6 - .../version/7.0.0-beta-1.0/images-bootstrap | 2 - .../cli/version/7.0.0-beta-1.0/images-stacks | 23 - .../version/7.0.0-beta-1.0/images-utilities | 4 - dockerfiles/cli/version/7.0.0-beta-2.0/images | 6 - .../version/7.0.0-beta-2.0/images-bootstrap | 2 - .../cli/version/7.0.0-beta-2.0/images-stacks | 23 - .../version/7.0.0-beta-2.0/images-utilities | 4 - dockerfiles/cli/version/7.0.0-beta-3.0/images | 6 - .../version/7.0.0-beta-3.0/images-bootstrap | 2 - .../cli/version/7.0.0-beta-3.0/images-stacks | 23 - .../version/7.0.0-beta-3.0/images-utilities | 4 - dockerfiles/cli/version/7.0.0-beta-4.0/images | 6 - .../version/7.0.0-beta-4.0/images-bootstrap | 2 - .../cli/version/7.0.0-beta-4.0/images-stacks | 23 - .../version/7.0.0-beta-4.0/images-utilities | 4 - dockerfiles/cli/version/7.0.0-beta-5.0/images | 6 - .../version/7.0.0-beta-5.0/images-bootstrap | 2 - .../cli/version/7.0.0-beta-5.0/images-stacks | 23 - .../version/7.0.0-beta-5.0/images-utilities | 4 - dockerfiles/cli/version/7.0.0/images | 6 - .../cli/version/7.0.0/images-bootstrap | 2 - dockerfiles/cli/version/7.0.0/images-stacks | 23 - .../cli/version/7.0.0/images-utilities | 4 - dockerfiles/cli/version/latest.ver | 1 - dockerfiles/cli/version/latest/images | 6 - .../cli/version/latest/images-bootstrap | 2 - dockerfiles/cli/version/latest/images-stacks | 23 - .../cli/version/latest/images-utilities | 4 - dockerfiles/cli/version/nightly/images | 6 - .../cli/version/nightly/images-bootstrap | 2 - dockerfiles/cli/version/nightly/images-stacks | 23 - .../cli/version/nightly/images-utilities | 4 - dockerfiles/cli/version/rc/images | 6 - dockerfiles/cli/version/rc/images-bootstrap | 2 - dockerfiles/cli/version/rc/images-stacks | 23 - dockerfiles/cli/version/rc/images-utilities | 4 - dockerfiles/dir/.require | 1 - dockerfiles/dir/Dockerfile | 16 - dockerfiles/dir/README.md | 33 - dockerfiles/dir/build.sh | 15 - dockerfiles/init/Dockerfile | 38 - dockerfiles/init/build.sh | 15 - dockerfiles/init/entrypoint.sh | 23 - dockerfiles/init/manifests/che.env | 668 --------- dockerfiles/init/manifests/che.pp | 74 - .../init/modules/base/manifests/init.pp | 30 - .../init/modules/che/manifests/init.pp | 33 - .../init/modules/che/templates/che.env.erb | 101 -- .../init/modules/che/templates/che.sh.erb | 247 ---- .../init/modules/compose/manifests/init.pp | 17 - .../compose/templates/docker-compose.yml.erb | 194 --- .../init/modules/keycloak/manifests/init.pp | 32 - .../init/modules/postgres/manifests/init.pp | 22 - .../lib/puppet/parser/functions/getValue.rb | 12 - .../init/modules/traefik/manifests/init.pp | 12 - .../traefik/templates/traefik.toml.erb | 91 -- dockerfiles/ip/Dockerfile | 17 - dockerfiles/ip/build.sh | 19 - dockerfiles/ip/run.sh | 21 - dockerfiles/ip/src/entrypoint.sh | 18 - dockerfiles/ip/src/library.sh | 153 -- dockerfiles/ip/test.sh | 33 - .../tests/ip-results/centos-native.expected | 1 - .../tests/ip-results/centos-native.interface | 1 - .../ip/tests/ip-results/centos-native.output | 69 - .../ip/tests/ip-results/centos-native.uname | 1 - .../ip-results/fedora-multiple-ips.expected | 1 - .../ip-results/fedora-multiple-ips.interface | 1 - .../ip-results/fedora-multiple-ips.output | 20 - .../ip-results/fedora-multiple-ips.uname | 1 - .../tests/ip-results/fedora-native.expected | 1 - .../tests/ip-results/fedora-native.interface | 1 - .../ip/tests/ip-results/fedora-native.output | 18 - .../ip/tests/ip-results/fedora-native.uname | 1 - .../ip-results/macos-docker-for-mac.expected | 1 - .../ip-results/macos-docker-for-mac.interface | 1 - .../ip-results/macos-docker-for-mac.output | 44 - .../ip-results/macos-docker-for-mac.uname | 1 - .../ip-results/ubuntu-native-wlan.expected | 1 - .../ip-results/ubuntu-native-wlan.interface | 1 - .../ip-results/ubuntu-native-wlan.output | 28 - .../tests/ip-results/ubuntu-native-wlan.uname | 1 - .../tests/ip-results/ubuntu-native.expected | 1 - .../tests/ip-results/ubuntu-native.interface | 1 - .../ip/tests/ip-results/ubuntu-native.output | 30 - .../ip/tests/ip-results/ubuntu-native.uname | 1 - .../ip-results/ubuntu-only-docker.expected | 1 - .../ip-results/ubuntu-only-docker.interface | 1 - .../ip-results/ubuntu-only-docker.output | 18 - .../tests/ip-results/ubuntu-only-docker.uname | 1 - .../ip-results/windows10-boot2docker.expected | 1 - .../windows10-boot2docker.interface | 1 - .../ip-results/windows10-boot2docker.output | 36 - .../ip-results/windows10-boot2docker.uname | 1 - .../windows10-docker-for-windows.expected | 1 - .../windows10-docker-for-windows.interface | 1 - .../windows10-docker-for-windows.output | 46 - .../windows10-docker-for-windows.uname | 1 - dockerfiles/ip/tests/library_tests.bats | 141 -- dockerfiles/keycloak/build.sh | 10 - .../templates => keycloak}/che-realm.json.erb | 0 .../che-users-0.json.erb | 0 .../account/messages/messages_en.properties | 0 .../che/account/resources/css/che-account.css | 0 .../che/account/template.ftl | 0 .../che/account/theme.properties | 0 .../che/email/html/email-verification.ftl | 0 .../che/email/html/event-login_error.ftl | 0 .../che/email/html/event-remove_totp.ftl | 0 .../che/email/html/event-update_password.ftl | 0 .../che/email/html/event-update_totp.ftl | 0 .../che/email/html/executeActions.ftl | 0 .../che/email/html/footer.ftl | 0 .../che/email/html/header.ftl | 0 .../che/email/html/identity-provider-link.ftl | 0 .../che/email/html/password-reset.ftl | 0 .../che/email/messages/messages_en.properties | 0 .../che/email/text/email-verification.ftl | 0 .../che/email/text/event-login_error.ftl | 0 .../che/email/text/event-remove_totp.ftl | 0 .../che/email/text/event-update_password.ftl | 0 .../che/email/text/event-update_totp.ftl | 0 .../che/email/text/executeActions.ftl | 0 .../che/email/text/footer.ftl | 0 .../che/email/text/header.ftl | 0 .../che/email/text/identity-provider-link.ftl | 0 .../che/email/text/password-reset.ftl | 0 .../che/email/theme.properties | 0 .../che/login/login-reset-password.ftl | 0 .../che/login/login-update-password.ftl | 0 .../files => keycloak}/che/login/login.ftl | 0 .../files => keycloak}/che/login/logo.ftl | 0 .../che/login/messages/messages_en.properties | 0 .../files => keycloak}/che/login/register.ftl | 0 .../che/login/resources/css/che-login.css | 0 .../che/login/resources/img/che-logo.svg | 0 .../che/login/resources/img/favicon.ico | Bin .../che/login/theme.properties | 0 .../master-realm.json.erb | 0 .../master-users-0.json.erb | 0 dockerfiles/lib/.babelrc | 3 - dockerfiles/lib/.dockerignore | 1 - dockerfiles/lib/.gitignore | 6 - dockerfiles/lib/Dockerfile | 34 - dockerfiles/lib/Dockerfile.dev | 32 - dockerfiles/lib/README.md | 8 - dockerfiles/lib/build.sh | 67 - dockerfiles/lib/dto-pom.xml | 124 -- dockerfiles/lib/package.json | 33 - .../lib/runtime-dependencies/package.json | 12 - .../exec-agent/exec-agent-service-client.ts | 99 -- .../process-ack-event-promise-subscriber.ts | 60 - .../process-log-output-subscriber.ts | 37 - ...ess-terminated-event-promise-subscriber.ts | 50 - .../lib/src/api/wsmaster/auth/auth-data.ts | 210 --- .../api/wsmaster/permissions/dto/domaindto.ts | 24 - .../wsmaster/permissions/dto/permissiondto.ts | 24 - .../api/wsmaster/permissions/permissions.ts | 100 -- .../lib/src/api/wsmaster/project/project.ts | 142 -- dockerfiles/lib/src/api/wsmaster/ssh/ssh.ts | 55 - .../system-stop-event-promise-subscriber.ts | 72 - .../lib/src/api/wsmaster/system/system.ts | 144 -- dockerfiles/lib/src/api/wsmaster/user/user.ts | 82 - .../workspace-log-output-subscriber.ts | 31 - ...orkspace-start-event-promise-subscriber.ts | 70 - ...workspace-stop-event-promise-subscriber.ts | 70 - .../src/api/wsmaster/workspace/workspace.ts | 298 ---- .../lib/src/api/wsmaster/wsmaster-location.ts | 52 - dockerfiles/lib/src/index.ts | 119 -- .../lib/src/internal/action/che-action.ts | 97 -- .../internal/action/impl/add-user-action.ts | 79 - .../impl/create-start-workspace-action.ts | 69 - .../action/impl/execute-command-action.ts | 84 -- .../internal/action/impl/get-ssh-action.ts | 110 -- .../action/impl/graceful-stop-action.ts | 61 - .../action/impl/list-workspaces-action.ts | 75 - .../action/impl/remove-user-action.ts | 61 - .../action/impl/workspace-ssh-action.ts | 138 -- .../internal/dir/che-dir-constant.properties | 38 - dockerfiles/lib/src/internal/dir/che-dir.ts | 1316 ----------------- .../dir/chefile-struct/che-file-struct.ts | 157 -- dockerfiles/lib/src/internal/test/che-test.ts | 86 -- .../impl/post-flight-check-test.properties | 16 - .../test/impl/post-flight-check-test.ts | 87 -- .../lib/src/spi/ascii/ascii-array-info.ts | 22 - dockerfiles/lib/src/spi/ascii/ascii-array.ts | 92 -- .../lib/src/spi/ascii/ascii-form-entry.ts | 64 - .../lib/src/spi/ascii/ascii-form-info.ts | 33 - dockerfiles/lib/src/spi/ascii/ascii-form.ts | 56 - dockerfiles/lib/src/spi/ascii/ascii-format.ts | 81 - .../lib/src/spi/ascii/ascii-formatter.ts | 55 - .../lib/src/spi/ascii/csv-formatter.ts | 82 - .../src/spi/ascii/default-ascii-array.spec.ts | 185 --- .../lib/src/spi/ascii/default-ascii-array.ts | 528 ------- .../src/spi/ascii/default-ascii-form.spec.ts | 52 - .../lib/src/spi/ascii/default-ascii-form.ts | 180 --- .../lib/src/spi/ascii/formatter-mode.ts | 16 - .../lib/src/spi/ascii/modern-formatter.ts | 83 -- .../src/spi/decorator/argument-processor.ts | 189 --- dockerfiles/lib/src/spi/decorator/message.ts | 62 - .../lib/src/spi/decorator/parameter.ts | 84 -- .../lib/src/spi/docker/container-version.ts | 32 - .../lib/src/spi/docker/recipebuilder.ts | 94 -- dockerfiles/lib/src/spi/docker/remoteip.ts | 35 - .../lib/src/spi/docker/ssh-generator.ts | 85 -- .../lib/src/spi/error/error-message.ts | 36 - .../src/spi/http/default-http-json-request.ts | 184 --- dockerfiles/lib/src/spi/i18n/i18n.ts | 43 - dockerfiles/lib/src/spi/index.ts | 22 - dockerfiles/lib/src/spi/log/log.ts | 133 -- .../lib/src/spi/websocket/json-rpc-bus.ts | 154 -- .../lib/src/spi/websocket/messagebuilder.ts | 64 - .../spi/websocket/messagebus-subscriber.ts | 21 - .../resolve-subscribe-promise-subscriber.ts | 51 - .../lib/src/spi/websocket/websocket.ts | 47 - dockerfiles/lib/src/utils/index.ts | 13 - dockerfiles/lib/src/utils/product-name.ts | 34 - dockerfiles/lib/src/utils/server-location.ts | 60 - .../lib/src/utils/string-utils.spec.ts | 64 - dockerfiles/lib/src/utils/string-utils.ts | 48 - dockerfiles/lib/src/utils/uuid.ts | 27 - dockerfiles/lib/tsconfig.json | 22 - dockerfiles/mount/Dockerfile | 69 - dockerfiles/mount/build.sh | 14 - dockerfiles/mount/entrypoint.sh | 178 --- dockerfiles/postgres/build.sh | 7 - .../init-che-user-and-run.sh.erb | 0 .../init-che-user.sh.erb | 0 dockerfiles/test/.require | 1 - dockerfiles/test/Dockerfile | 16 - dockerfiles/test/README.md | 22 - dockerfiles/test/build.sh | 14 - 459 files changed, 18610 deletions(-) delete mode 100644 dockerfiles/action/.require delete mode 100644 dockerfiles/action/Dockerfile delete mode 100644 dockerfiles/action/README.md delete mode 100755 dockerfiles/action/build.sh delete mode 100644 dockerfiles/base/Dockerfile delete mode 100755 dockerfiles/base/build.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_abuild.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_action.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_agenerate.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_archetype.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_arun.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_astop.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_backup.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_config.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_destroy.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_dir.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_download.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_help.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_info.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_init.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_offline.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_restart.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_restore.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_rmi.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_ssh.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_start.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_stop.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_sync.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_test.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_upgrade.sh delete mode 100644 dockerfiles/base/scripts/base/commands/cmd_version.sh delete mode 100644 dockerfiles/base/scripts/base/library.sh delete mode 100644 dockerfiles/base/scripts/base/startup.sh delete mode 100644 dockerfiles/base/scripts/base/startup_01_init.sh delete mode 100644 dockerfiles/base/scripts/base/startup_02_pre_docker.sh delete mode 100644 dockerfiles/base/scripts/base/startup_03_pre_networking.sh delete mode 100644 dockerfiles/base/scripts/base/startup_04_pre_cli_init.sh delete mode 100644 dockerfiles/base/scripts/base/startup_05_pre_exec.sh delete mode 100644 dockerfiles/base/scripts/entrypoint.sh delete mode 100644 dockerfiles/bats/Dockerfile delete mode 100755 dockerfiles/bats/build.sh delete mode 100644 dockerfiles/cli/.dockerignore delete mode 100644 dockerfiles/cli/.gitignore delete mode 100644 dockerfiles/cli/.require delete mode 100644 dockerfiles/cli/Dockerfile delete mode 100755 dockerfiles/cli/build.sh delete mode 100644 dockerfiles/cli/images.template delete mode 100644 dockerfiles/cli/scripts/post_init.sh delete mode 100644 dockerfiles/cli/scripts/pre_init.sh delete mode 100755 dockerfiles/cli/test.sh delete mode 100644 dockerfiles/cli/tests/cli_prompts_usage_tests.bats delete mode 100644 dockerfiles/cli/tests/cmd_backup_restore_tests.bats delete mode 100644 dockerfiles/cli/tests/cmd_config_tests.bats delete mode 100644 dockerfiles/cli/tests/cmd_info_tests.bats delete mode 100644 dockerfiles/cli/tests/cmd_init_destroy_tests.bats delete mode 100644 dockerfiles/cli/tests/cmd_offline_tests.bats delete mode 100644 dockerfiles/cli/tests/cmd_start_stop_restart_tests.bats delete mode 100644 dockerfiles/cli/tests/override_image_tests.bats delete mode 100644 dockerfiles/cli/tests/startup_03_pre_networking_tests.bats delete mode 100644 dockerfiles/cli/tests/test_base.sh delete mode 100644 dockerfiles/cli/version/4.7.2/images delete mode 100644 dockerfiles/cli/version/4.7.2/images-stacks delete mode 100644 dockerfiles/cli/version/5.0.0-M5/images delete mode 100644 dockerfiles/cli/version/5.0.0-M5/images-stacks delete mode 100644 dockerfiles/cli/version/5.0.0-M6/images delete mode 100644 dockerfiles/cli/version/5.0.0-M6/images-stacks delete mode 100644 dockerfiles/cli/version/5.0.0-M7/images delete mode 100644 dockerfiles/cli/version/5.0.0-M7/images-stacks delete mode 100644 dockerfiles/cli/version/5.0.0-M8/images delete mode 100644 dockerfiles/cli/version/5.0.0-M8/images-stacks delete mode 100644 dockerfiles/cli/version/5.0.0/images delete mode 100644 dockerfiles/cli/version/5.0.0/images-stacks delete mode 100644 dockerfiles/cli/version/5.0.1/images delete mode 100644 dockerfiles/cli/version/5.0.1/images-stacks delete mode 100644 dockerfiles/cli/version/5.1.0/images delete mode 100644 dockerfiles/cli/version/5.1.0/images-stacks delete mode 100644 dockerfiles/cli/version/5.1.1/images delete mode 100644 dockerfiles/cli/version/5.1.1/images-stacks delete mode 100644 dockerfiles/cli/version/5.10.0/images delete mode 100644 dockerfiles/cli/version/5.10.0/images-stacks delete mode 100644 dockerfiles/cli/version/5.11.0/images delete mode 100644 dockerfiles/cli/version/5.11.0/images-stacks delete mode 100644 dockerfiles/cli/version/5.11.1/images delete mode 100644 dockerfiles/cli/version/5.11.1/images-stacks delete mode 100644 dockerfiles/cli/version/5.11.2/images delete mode 100644 dockerfiles/cli/version/5.11.2/images-stacks delete mode 100644 dockerfiles/cli/version/5.12.0/images delete mode 100644 dockerfiles/cli/version/5.12.0/images-stacks delete mode 100644 dockerfiles/cli/version/5.13.0/images delete mode 100644 dockerfiles/cli/version/5.13.0/images-stacks delete mode 100644 dockerfiles/cli/version/5.14.0/images delete mode 100644 dockerfiles/cli/version/5.14.0/images-stacks delete mode 100644 dockerfiles/cli/version/5.15.0/images delete mode 100644 dockerfiles/cli/version/5.15.0/images-stacks delete mode 100644 dockerfiles/cli/version/5.16.0/images delete mode 100644 dockerfiles/cli/version/5.16.0/images-stacks delete mode 100644 dockerfiles/cli/version/5.17.0/images delete mode 100644 dockerfiles/cli/version/5.17.0/images-stacks delete mode 100644 dockerfiles/cli/version/5.18.0/images delete mode 100644 dockerfiles/cli/version/5.18.0/images-stacks delete mode 100644 dockerfiles/cli/version/5.18.1/images delete mode 100644 dockerfiles/cli/version/5.18.1/images-stacks delete mode 100644 dockerfiles/cli/version/5.19.0/images delete mode 100644 dockerfiles/cli/version/5.19.0/images-stacks delete mode 100644 dockerfiles/cli/version/5.2.0/images delete mode 100644 dockerfiles/cli/version/5.2.0/images-stacks delete mode 100644 dockerfiles/cli/version/5.2.1/images delete mode 100644 dockerfiles/cli/version/5.2.1/images-stacks delete mode 100644 dockerfiles/cli/version/5.2.2/images delete mode 100644 dockerfiles/cli/version/5.2.2/images-stacks delete mode 100644 dockerfiles/cli/version/5.20.0/images delete mode 100644 dockerfiles/cli/version/5.20.0/images-stacks delete mode 100644 dockerfiles/cli/version/5.20.1/images delete mode 100644 dockerfiles/cli/version/5.20.1/images-stacks delete mode 100644 dockerfiles/cli/version/5.21.0/images delete mode 100644 dockerfiles/cli/version/5.21.0/images-stacks delete mode 100644 dockerfiles/cli/version/5.22.0/images delete mode 100644 dockerfiles/cli/version/5.22.0/images-stacks delete mode 100644 dockerfiles/cli/version/5.3.0/images delete mode 100644 dockerfiles/cli/version/5.3.0/images-stacks delete mode 100644 dockerfiles/cli/version/5.3.1/images delete mode 100644 dockerfiles/cli/version/5.3.1/images-stacks delete mode 100644 dockerfiles/cli/version/5.4.0/images delete mode 100644 dockerfiles/cli/version/5.4.0/images-stacks delete mode 100644 dockerfiles/cli/version/5.4.1/images delete mode 100644 dockerfiles/cli/version/5.4.1/images-stacks delete mode 100644 dockerfiles/cli/version/5.5.0/images delete mode 100644 dockerfiles/cli/version/5.5.0/images-stacks delete mode 100644 dockerfiles/cli/version/5.6.0/images delete mode 100644 dockerfiles/cli/version/5.6.0/images-stacks delete mode 100644 dockerfiles/cli/version/5.7.0/images delete mode 100644 dockerfiles/cli/version/5.7.0/images-stacks delete mode 100644 dockerfiles/cli/version/5.7.1/images delete mode 100644 dockerfiles/cli/version/5.7.1/images-stacks delete mode 100644 dockerfiles/cli/version/5.7.2/images delete mode 100644 dockerfiles/cli/version/5.7.2/images-stacks delete mode 100644 dockerfiles/cli/version/5.8.0/images delete mode 100644 dockerfiles/cli/version/5.8.0/images-stacks delete mode 100644 dockerfiles/cli/version/5.8.1/images delete mode 100644 dockerfiles/cli/version/5.8.1/images-stacks delete mode 100644 dockerfiles/cli/version/5.9.0/images delete mode 100644 dockerfiles/cli/version/5.9.0/images-stacks delete mode 100644 dockerfiles/cli/version/5.9.1/images delete mode 100644 dockerfiles/cli/version/5.9.1/images-stacks delete mode 100644 dockerfiles/cli/version/6.0.0-M1/images delete mode 100644 dockerfiles/cli/version/6.0.0-M1/images-stacks delete mode 100644 dockerfiles/cli/version/6.0.0-M2/images delete mode 100644 dockerfiles/cli/version/6.0.0-M2/images-stacks delete mode 100644 dockerfiles/cli/version/6.0.0-M3/images delete mode 100644 dockerfiles/cli/version/6.0.0-M3/images-stacks delete mode 100644 dockerfiles/cli/version/6.0.0-M4/images delete mode 100644 dockerfiles/cli/version/6.0.0-M4/images-stacks delete mode 100644 dockerfiles/cli/version/6.0.0/images delete mode 100644 dockerfiles/cli/version/6.0.0/images-stacks delete mode 100644 dockerfiles/cli/version/6.1.0/images delete mode 100644 dockerfiles/cli/version/6.1.0/images-stacks delete mode 100644 dockerfiles/cli/version/6.10.0/images delete mode 100644 dockerfiles/cli/version/6.10.0/images-stacks delete mode 100644 dockerfiles/cli/version/6.11.0/images delete mode 100644 dockerfiles/cli/version/6.11.0/images-stacks delete mode 100644 dockerfiles/cli/version/6.12.0/images delete mode 100644 dockerfiles/cli/version/6.12.0/images-bootstrap delete mode 100644 dockerfiles/cli/version/6.12.0/images-stacks delete mode 100644 dockerfiles/cli/version/6.12.0/images-utilities delete mode 100644 dockerfiles/cli/version/6.13.0/images delete mode 100644 dockerfiles/cli/version/6.13.0/images-bootstrap delete mode 100644 dockerfiles/cli/version/6.13.0/images-stacks delete mode 100644 dockerfiles/cli/version/6.13.0/images-utilities delete mode 100644 dockerfiles/cli/version/6.14.0/images delete mode 100644 dockerfiles/cli/version/6.14.0/images-bootstrap delete mode 100644 dockerfiles/cli/version/6.14.0/images-stacks delete mode 100644 dockerfiles/cli/version/6.14.0/images-utilities delete mode 100644 dockerfiles/cli/version/6.15.0/images delete mode 100644 dockerfiles/cli/version/6.15.0/images-bootstrap delete mode 100644 dockerfiles/cli/version/6.15.0/images-stacks delete mode 100644 dockerfiles/cli/version/6.15.0/images-utilities delete mode 100644 dockerfiles/cli/version/6.16.0/images delete mode 100644 dockerfiles/cli/version/6.16.0/images-bootstrap delete mode 100644 dockerfiles/cli/version/6.16.0/images-stacks delete mode 100644 dockerfiles/cli/version/6.16.0/images-utilities delete mode 100644 dockerfiles/cli/version/6.17.0/images delete mode 100644 dockerfiles/cli/version/6.17.0/images-bootstrap delete mode 100644 dockerfiles/cli/version/6.17.0/images-stacks delete mode 100644 dockerfiles/cli/version/6.17.0/images-utilities delete mode 100644 dockerfiles/cli/version/6.18.0/images delete mode 100644 dockerfiles/cli/version/6.18.0/images-bootstrap delete mode 100644 dockerfiles/cli/version/6.18.0/images-stacks delete mode 100644 dockerfiles/cli/version/6.18.0/images-utilities delete mode 100644 dockerfiles/cli/version/6.19.0/images delete mode 100644 dockerfiles/cli/version/6.19.0/images-bootstrap delete mode 100644 dockerfiles/cli/version/6.19.0/images-stacks delete mode 100644 dockerfiles/cli/version/6.19.0/images-utilities delete mode 100644 dockerfiles/cli/version/6.2.0/images delete mode 100644 dockerfiles/cli/version/6.2.0/images-stacks delete mode 100644 dockerfiles/cli/version/6.3.0/images delete mode 100644 dockerfiles/cli/version/6.3.0/images-stacks delete mode 100644 dockerfiles/cli/version/6.4.0/images delete mode 100644 dockerfiles/cli/version/6.4.0/images-stacks delete mode 100644 dockerfiles/cli/version/6.4.1/images delete mode 100644 dockerfiles/cli/version/6.4.1/images-stacks delete mode 100644 dockerfiles/cli/version/6.5.0/images delete mode 100644 dockerfiles/cli/version/6.5.0/images-stacks delete mode 100644 dockerfiles/cli/version/6.5.1/images delete mode 100644 dockerfiles/cli/version/6.5.1/images-stacks delete mode 100644 dockerfiles/cli/version/6.5.2/images delete mode 100644 dockerfiles/cli/version/6.5.2/images-stacks delete mode 100644 dockerfiles/cli/version/6.5.3/images delete mode 100644 dockerfiles/cli/version/6.5.3/images-stacks delete mode 100644 dockerfiles/cli/version/6.6.0/images delete mode 100644 dockerfiles/cli/version/6.6.0/images-stacks delete mode 100644 dockerfiles/cli/version/6.6.1/images delete mode 100644 dockerfiles/cli/version/6.6.1/images-stacks delete mode 100644 dockerfiles/cli/version/6.7.0/images delete mode 100644 dockerfiles/cli/version/6.7.0/images-stacks delete mode 100644 dockerfiles/cli/version/6.8.0/images delete mode 100644 dockerfiles/cli/version/6.8.0/images-stacks delete mode 100644 dockerfiles/cli/version/6.9.0/images delete mode 100644 dockerfiles/cli/version/6.9.0/images-stacks delete mode 100644 dockerfiles/cli/version/7.0.0-RC-1.0/images delete mode 100644 dockerfiles/cli/version/7.0.0-RC-1.0/images-bootstrap delete mode 100644 dockerfiles/cli/version/7.0.0-RC-1.0/images-stacks delete mode 100644 dockerfiles/cli/version/7.0.0-RC-1.0/images-utilities delete mode 100644 dockerfiles/cli/version/7.0.0-RC-2.0/images delete mode 100644 dockerfiles/cli/version/7.0.0-RC-2.0/images-bootstrap delete mode 100644 dockerfiles/cli/version/7.0.0-RC-2.0/images-stacks delete mode 100644 dockerfiles/cli/version/7.0.0-RC-2.0/images-utilities delete mode 100644 dockerfiles/cli/version/7.0.0-beta-1.0/images delete mode 100644 dockerfiles/cli/version/7.0.0-beta-1.0/images-bootstrap delete mode 100644 dockerfiles/cli/version/7.0.0-beta-1.0/images-stacks delete mode 100644 dockerfiles/cli/version/7.0.0-beta-1.0/images-utilities delete mode 100644 dockerfiles/cli/version/7.0.0-beta-2.0/images delete mode 100644 dockerfiles/cli/version/7.0.0-beta-2.0/images-bootstrap delete mode 100644 dockerfiles/cli/version/7.0.0-beta-2.0/images-stacks delete mode 100644 dockerfiles/cli/version/7.0.0-beta-2.0/images-utilities delete mode 100644 dockerfiles/cli/version/7.0.0-beta-3.0/images delete mode 100644 dockerfiles/cli/version/7.0.0-beta-3.0/images-bootstrap delete mode 100644 dockerfiles/cli/version/7.0.0-beta-3.0/images-stacks delete mode 100644 dockerfiles/cli/version/7.0.0-beta-3.0/images-utilities delete mode 100644 dockerfiles/cli/version/7.0.0-beta-4.0/images delete mode 100644 dockerfiles/cli/version/7.0.0-beta-4.0/images-bootstrap delete mode 100644 dockerfiles/cli/version/7.0.0-beta-4.0/images-stacks delete mode 100644 dockerfiles/cli/version/7.0.0-beta-4.0/images-utilities delete mode 100644 dockerfiles/cli/version/7.0.0-beta-5.0/images delete mode 100644 dockerfiles/cli/version/7.0.0-beta-5.0/images-bootstrap delete mode 100644 dockerfiles/cli/version/7.0.0-beta-5.0/images-stacks delete mode 100644 dockerfiles/cli/version/7.0.0-beta-5.0/images-utilities delete mode 100644 dockerfiles/cli/version/7.0.0/images delete mode 100644 dockerfiles/cli/version/7.0.0/images-bootstrap delete mode 100644 dockerfiles/cli/version/7.0.0/images-stacks delete mode 100644 dockerfiles/cli/version/7.0.0/images-utilities delete mode 100644 dockerfiles/cli/version/latest.ver delete mode 100644 dockerfiles/cli/version/latest/images delete mode 100644 dockerfiles/cli/version/latest/images-bootstrap delete mode 100644 dockerfiles/cli/version/latest/images-stacks delete mode 100644 dockerfiles/cli/version/latest/images-utilities delete mode 100644 dockerfiles/cli/version/nightly/images delete mode 100644 dockerfiles/cli/version/nightly/images-bootstrap delete mode 100644 dockerfiles/cli/version/nightly/images-stacks delete mode 100644 dockerfiles/cli/version/nightly/images-utilities delete mode 100644 dockerfiles/cli/version/rc/images delete mode 100644 dockerfiles/cli/version/rc/images-bootstrap delete mode 100644 dockerfiles/cli/version/rc/images-stacks delete mode 100644 dockerfiles/cli/version/rc/images-utilities delete mode 100644 dockerfiles/dir/.require delete mode 100644 dockerfiles/dir/Dockerfile delete mode 100644 dockerfiles/dir/README.md delete mode 100755 dockerfiles/dir/build.sh delete mode 100644 dockerfiles/init/Dockerfile delete mode 100755 dockerfiles/init/build.sh delete mode 100644 dockerfiles/init/entrypoint.sh delete mode 100644 dockerfiles/init/manifests/che.env delete mode 100644 dockerfiles/init/manifests/che.pp delete mode 100644 dockerfiles/init/modules/base/manifests/init.pp delete mode 100644 dockerfiles/init/modules/che/manifests/init.pp delete mode 100644 dockerfiles/init/modules/che/templates/che.env.erb delete mode 100644 dockerfiles/init/modules/che/templates/che.sh.erb delete mode 100644 dockerfiles/init/modules/compose/manifests/init.pp delete mode 100644 dockerfiles/init/modules/compose/templates/docker-compose.yml.erb delete mode 100644 dockerfiles/init/modules/keycloak/manifests/init.pp delete mode 100644 dockerfiles/init/modules/postgres/manifests/init.pp delete mode 100644 dockerfiles/init/modules/puppet_plugins/lib/puppet/parser/functions/getValue.rb delete mode 100644 dockerfiles/init/modules/traefik/manifests/init.pp delete mode 100644 dockerfiles/init/modules/traefik/templates/traefik.toml.erb delete mode 100644 dockerfiles/ip/Dockerfile delete mode 100755 dockerfiles/ip/build.sh delete mode 100755 dockerfiles/ip/run.sh delete mode 100755 dockerfiles/ip/src/entrypoint.sh delete mode 100644 dockerfiles/ip/src/library.sh delete mode 100755 dockerfiles/ip/test.sh delete mode 100644 dockerfiles/ip/tests/ip-results/centos-native.expected delete mode 100644 dockerfiles/ip/tests/ip-results/centos-native.interface delete mode 100644 dockerfiles/ip/tests/ip-results/centos-native.output delete mode 100644 dockerfiles/ip/tests/ip-results/centos-native.uname delete mode 100644 dockerfiles/ip/tests/ip-results/fedora-multiple-ips.expected delete mode 100644 dockerfiles/ip/tests/ip-results/fedora-multiple-ips.interface delete mode 100644 dockerfiles/ip/tests/ip-results/fedora-multiple-ips.output delete mode 100644 dockerfiles/ip/tests/ip-results/fedora-multiple-ips.uname delete mode 100644 dockerfiles/ip/tests/ip-results/fedora-native.expected delete mode 100644 dockerfiles/ip/tests/ip-results/fedora-native.interface delete mode 100644 dockerfiles/ip/tests/ip-results/fedora-native.output delete mode 100644 dockerfiles/ip/tests/ip-results/fedora-native.uname delete mode 100644 dockerfiles/ip/tests/ip-results/macos-docker-for-mac.expected delete mode 100644 dockerfiles/ip/tests/ip-results/macos-docker-for-mac.interface delete mode 100644 dockerfiles/ip/tests/ip-results/macos-docker-for-mac.output delete mode 100644 dockerfiles/ip/tests/ip-results/macos-docker-for-mac.uname delete mode 100644 dockerfiles/ip/tests/ip-results/ubuntu-native-wlan.expected delete mode 100644 dockerfiles/ip/tests/ip-results/ubuntu-native-wlan.interface delete mode 100644 dockerfiles/ip/tests/ip-results/ubuntu-native-wlan.output delete mode 100644 dockerfiles/ip/tests/ip-results/ubuntu-native-wlan.uname delete mode 100644 dockerfiles/ip/tests/ip-results/ubuntu-native.expected delete mode 100644 dockerfiles/ip/tests/ip-results/ubuntu-native.interface delete mode 100644 dockerfiles/ip/tests/ip-results/ubuntu-native.output delete mode 100644 dockerfiles/ip/tests/ip-results/ubuntu-native.uname delete mode 100644 dockerfiles/ip/tests/ip-results/ubuntu-only-docker.expected delete mode 100644 dockerfiles/ip/tests/ip-results/ubuntu-only-docker.interface delete mode 100644 dockerfiles/ip/tests/ip-results/ubuntu-only-docker.output delete mode 100644 dockerfiles/ip/tests/ip-results/ubuntu-only-docker.uname delete mode 100644 dockerfiles/ip/tests/ip-results/windows10-boot2docker.expected delete mode 100644 dockerfiles/ip/tests/ip-results/windows10-boot2docker.interface delete mode 100644 dockerfiles/ip/tests/ip-results/windows10-boot2docker.output delete mode 100644 dockerfiles/ip/tests/ip-results/windows10-boot2docker.uname delete mode 100644 dockerfiles/ip/tests/ip-results/windows10-docker-for-windows.expected delete mode 100644 dockerfiles/ip/tests/ip-results/windows10-docker-for-windows.interface delete mode 100644 dockerfiles/ip/tests/ip-results/windows10-docker-for-windows.output delete mode 100644 dockerfiles/ip/tests/ip-results/windows10-docker-for-windows.uname delete mode 100644 dockerfiles/ip/tests/library_tests.bats rename dockerfiles/{init/modules/keycloak/templates => keycloak}/che-realm.json.erb (100%) rename dockerfiles/{init/modules/keycloak/templates => keycloak}/che-users-0.json.erb (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/account/messages/messages_en.properties (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/account/resources/css/che-account.css (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/account/template.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/account/theme.properties (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/email/html/email-verification.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/email/html/event-login_error.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/email/html/event-remove_totp.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/email/html/event-update_password.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/email/html/event-update_totp.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/email/html/executeActions.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/email/html/footer.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/email/html/header.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/email/html/identity-provider-link.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/email/html/password-reset.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/email/messages/messages_en.properties (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/email/text/email-verification.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/email/text/event-login_error.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/email/text/event-remove_totp.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/email/text/event-update_password.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/email/text/event-update_totp.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/email/text/executeActions.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/email/text/footer.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/email/text/header.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/email/text/identity-provider-link.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/email/text/password-reset.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/email/theme.properties (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/login/login-reset-password.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/login/login-update-password.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/login/login.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/login/logo.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/login/messages/messages_en.properties (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/login/register.ftl (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/login/resources/css/che-login.css (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/login/resources/img/che-logo.svg (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/login/resources/img/favicon.ico (100%) rename dockerfiles/{init/modules/keycloak/files => keycloak}/che/login/theme.properties (100%) rename dockerfiles/{init/modules/keycloak/templates => keycloak}/master-realm.json.erb (100%) rename dockerfiles/{init/modules/keycloak/templates => keycloak}/master-users-0.json.erb (100%) delete mode 100644 dockerfiles/lib/.babelrc delete mode 100644 dockerfiles/lib/.dockerignore delete mode 100644 dockerfiles/lib/.gitignore delete mode 100644 dockerfiles/lib/Dockerfile delete mode 100644 dockerfiles/lib/Dockerfile.dev delete mode 100644 dockerfiles/lib/README.md delete mode 100755 dockerfiles/lib/build.sh delete mode 100644 dockerfiles/lib/dto-pom.xml delete mode 100644 dockerfiles/lib/package.json delete mode 100644 dockerfiles/lib/runtime-dependencies/package.json delete mode 100644 dockerfiles/lib/src/api/exec-agent/exec-agent-service-client.ts delete mode 100644 dockerfiles/lib/src/api/exec-agent/process-ack-event-promise-subscriber.ts delete mode 100644 dockerfiles/lib/src/api/exec-agent/process-log-output-subscriber.ts delete mode 100644 dockerfiles/lib/src/api/exec-agent/process-terminated-event-promise-subscriber.ts delete mode 100644 dockerfiles/lib/src/api/wsmaster/auth/auth-data.ts delete mode 100644 dockerfiles/lib/src/api/wsmaster/permissions/dto/domaindto.ts delete mode 100644 dockerfiles/lib/src/api/wsmaster/permissions/dto/permissiondto.ts delete mode 100644 dockerfiles/lib/src/api/wsmaster/permissions/permissions.ts delete mode 100644 dockerfiles/lib/src/api/wsmaster/project/project.ts delete mode 100644 dockerfiles/lib/src/api/wsmaster/ssh/ssh.ts delete mode 100644 dockerfiles/lib/src/api/wsmaster/system/system-stop-event-promise-subscriber.ts delete mode 100644 dockerfiles/lib/src/api/wsmaster/system/system.ts delete mode 100644 dockerfiles/lib/src/api/wsmaster/user/user.ts delete mode 100644 dockerfiles/lib/src/api/wsmaster/workspace/workspace-log-output-subscriber.ts delete mode 100644 dockerfiles/lib/src/api/wsmaster/workspace/workspace-start-event-promise-subscriber.ts delete mode 100644 dockerfiles/lib/src/api/wsmaster/workspace/workspace-stop-event-promise-subscriber.ts delete mode 100644 dockerfiles/lib/src/api/wsmaster/workspace/workspace.ts delete mode 100644 dockerfiles/lib/src/api/wsmaster/wsmaster-location.ts delete mode 100644 dockerfiles/lib/src/index.ts delete mode 100644 dockerfiles/lib/src/internal/action/che-action.ts delete mode 100644 dockerfiles/lib/src/internal/action/impl/add-user-action.ts delete mode 100644 dockerfiles/lib/src/internal/action/impl/create-start-workspace-action.ts delete mode 100644 dockerfiles/lib/src/internal/action/impl/execute-command-action.ts delete mode 100644 dockerfiles/lib/src/internal/action/impl/get-ssh-action.ts delete mode 100644 dockerfiles/lib/src/internal/action/impl/graceful-stop-action.ts delete mode 100644 dockerfiles/lib/src/internal/action/impl/list-workspaces-action.ts delete mode 100644 dockerfiles/lib/src/internal/action/impl/remove-user-action.ts delete mode 100644 dockerfiles/lib/src/internal/action/impl/workspace-ssh-action.ts delete mode 100644 dockerfiles/lib/src/internal/dir/che-dir-constant.properties delete mode 100644 dockerfiles/lib/src/internal/dir/che-dir.ts delete mode 100644 dockerfiles/lib/src/internal/dir/chefile-struct/che-file-struct.ts delete mode 100644 dockerfiles/lib/src/internal/test/che-test.ts delete mode 100644 dockerfiles/lib/src/internal/test/impl/post-flight-check-test.properties delete mode 100644 dockerfiles/lib/src/internal/test/impl/post-flight-check-test.ts delete mode 100644 dockerfiles/lib/src/spi/ascii/ascii-array-info.ts delete mode 100644 dockerfiles/lib/src/spi/ascii/ascii-array.ts delete mode 100644 dockerfiles/lib/src/spi/ascii/ascii-form-entry.ts delete mode 100644 dockerfiles/lib/src/spi/ascii/ascii-form-info.ts delete mode 100644 dockerfiles/lib/src/spi/ascii/ascii-form.ts delete mode 100644 dockerfiles/lib/src/spi/ascii/ascii-format.ts delete mode 100644 dockerfiles/lib/src/spi/ascii/ascii-formatter.ts delete mode 100644 dockerfiles/lib/src/spi/ascii/csv-formatter.ts delete mode 100644 dockerfiles/lib/src/spi/ascii/default-ascii-array.spec.ts delete mode 100644 dockerfiles/lib/src/spi/ascii/default-ascii-array.ts delete mode 100644 dockerfiles/lib/src/spi/ascii/default-ascii-form.spec.ts delete mode 100644 dockerfiles/lib/src/spi/ascii/default-ascii-form.ts delete mode 100644 dockerfiles/lib/src/spi/ascii/formatter-mode.ts delete mode 100644 dockerfiles/lib/src/spi/ascii/modern-formatter.ts delete mode 100644 dockerfiles/lib/src/spi/decorator/argument-processor.ts delete mode 100644 dockerfiles/lib/src/spi/decorator/message.ts delete mode 100644 dockerfiles/lib/src/spi/decorator/parameter.ts delete mode 100644 dockerfiles/lib/src/spi/docker/container-version.ts delete mode 100644 dockerfiles/lib/src/spi/docker/recipebuilder.ts delete mode 100644 dockerfiles/lib/src/spi/docker/remoteip.ts delete mode 100644 dockerfiles/lib/src/spi/docker/ssh-generator.ts delete mode 100644 dockerfiles/lib/src/spi/error/error-message.ts delete mode 100644 dockerfiles/lib/src/spi/http/default-http-json-request.ts delete mode 100644 dockerfiles/lib/src/spi/i18n/i18n.ts delete mode 100644 dockerfiles/lib/src/spi/index.ts delete mode 100644 dockerfiles/lib/src/spi/log/log.ts delete mode 100644 dockerfiles/lib/src/spi/websocket/json-rpc-bus.ts delete mode 100644 dockerfiles/lib/src/spi/websocket/messagebuilder.ts delete mode 100644 dockerfiles/lib/src/spi/websocket/messagebus-subscriber.ts delete mode 100644 dockerfiles/lib/src/spi/websocket/resolve-subscribe-promise-subscriber.ts delete mode 100644 dockerfiles/lib/src/spi/websocket/websocket.ts delete mode 100644 dockerfiles/lib/src/utils/index.ts delete mode 100644 dockerfiles/lib/src/utils/product-name.ts delete mode 100644 dockerfiles/lib/src/utils/server-location.ts delete mode 100644 dockerfiles/lib/src/utils/string-utils.spec.ts delete mode 100644 dockerfiles/lib/src/utils/string-utils.ts delete mode 100644 dockerfiles/lib/src/utils/uuid.ts delete mode 100644 dockerfiles/lib/tsconfig.json delete mode 100644 dockerfiles/mount/Dockerfile delete mode 100755 dockerfiles/mount/build.sh delete mode 100755 dockerfiles/mount/entrypoint.sh rename dockerfiles/{init/modules/postgres/templates => postgres}/init-che-user-and-run.sh.erb (100%) rename dockerfiles/{init/modules/postgres/templates => postgres}/init-che-user.sh.erb (100%) delete mode 100644 dockerfiles/test/.require delete mode 100644 dockerfiles/test/Dockerfile delete mode 100644 dockerfiles/test/README.md delete mode 100755 dockerfiles/test/build.sh diff --git a/dockerfiles/action/.require b/dockerfiles/action/.require deleted file mode 100644 index a65b41774ad5..000000000000 --- a/dockerfiles/action/.require +++ /dev/null @@ -1 +0,0 @@ -lib diff --git a/dockerfiles/action/Dockerfile b/dockerfiles/action/Dockerfile deleted file mode 100644 index 3d0a9d9facbf..000000000000 --- a/dockerfiles/action/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2017 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 -# -# build: -# docker build -t eclipse/che-action . -# -# use: -# docker run -v /var/run/docker.sock:/var/run/docker.sock eclipse/che-action [command] - -FROM ${BUILD_ORGANIZATION}/${BUILD_PREFIX}-lib:${BUILD_TAG} - -ENTRYPOINT ["node", "/che-lib/index.js", "che-action"] diff --git a/dockerfiles/action/README.md b/dockerfiles/action/README.md deleted file mode 100644 index bc06f9b4ff64..000000000000 --- a/dockerfiles/action/README.md +++ /dev/null @@ -1,21 +0,0 @@ -### Performing actions on a local or remote Eclipse Che instance with a Docker container - -## Build container -``` -$ build.sh (on Unix) -``` - -## Run container -``` -docker run --rm -v /var/run/docker.sock:/var/run/docker.sock eclipse/che-action -``` - -## Get available actions -``` -docker run --rm -v /var/run/docker.sock:/var/run/docker.sock eclipse/che-action -``` - -## Get help on a test -``` -docker run --rm -v /var/run/docker.sock:/var/run/docker.sock eclipse/che-action --help -``` diff --git a/dockerfiles/action/build.sh b/dockerfiles/action/build.sh deleted file mode 100755 index 225af79f774c..000000000000 --- a/dockerfiles/action/build.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2017 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:action "$@" -build diff --git a/dockerfiles/base/Dockerfile b/dockerfiles/base/Dockerfile deleted file mode 100644 index 81f4662b4ba9..000000000000 --- a/dockerfiles/base/Dockerfile +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2017 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 -# -# build: -# docker build -t eclipse/che-base . -# -# use: -# docker run eclipse/che-base - -FROM alpine:3.4 - -ENV DOCKER_BUCKET get.docker.com -ENV DOCKER_VERSION 1.11.2 -ENV DOCKER_SHA256 8c2e0c35e3cda11706f54b2d46c2521a6e9026a7b13c7d4b8ae1f3a706fc55e1 - -# install packages -# coreutils is required for iso8601 compliant date utility -RUN mkdir -p /version \ - && mkdir -p /cli \ - && mkdir /scripts/ \ - && apk add --no-cache ca-certificates coreutils curl openssl jq \ - && apk add --update bash \ - && rm -rf /var/cache/apk/* \ - && set -x \ - && curl -fSL "https://${DOCKER_BUCKET}/builds/Linux/x86_64/docker-${DOCKER_VERSION}.tgz" -o docker.tgz \ - && echo "${DOCKER_SHA256} *docker.tgz" | sha256sum -c - \ - && tar -xzvf docker.tgz \ - && mv docker/docker /usr/local/bin/ \ - && rm -rf docker \ - && rm docker.tgz \ - && docker -v - -COPY scripts/base /scripts/base/ -COPY scripts/entrypoint.sh /scripts/entrypoint.sh - -RUN chmod u+x /scripts/entrypoint.sh diff --git a/dockerfiles/base/build.sh b/dockerfiles/base/build.sh deleted file mode 100755 index 34a1ee810d38..000000000000 --- a/dockerfiles/base/build.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2017 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:base "$@" -build diff --git a/dockerfiles/base/scripts/base/commands/cmd_abuild.sh b/dockerfiles/base/scripts/base/commands/cmd_abuild.sh deleted file mode 100644 index dbec039257da..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_abuild.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -pre_cmd_abuild() { - UTILITY_IMAGE_DEV="eclipse/che-dev" - - if ! is_fast && ! skip_pull; then - load_utilities_images_if_not_done - update_image $UTILITY_IMAGE_DEV - fi - - if [ ! -d /archetype/$ASSEMBLY_ID ]; then - error "Assembly at ${ARCHETYPE_MOUNT}/$ASSEMBLY_ID not found." - return 2 - fi -} - -cmd_abuild() { - cd /archetype/$ASSEMBLY_ID - - WRITE_PARAMETERS="" - if is_docker_for_mac || is_native; then - WRITE_PARAMETERS+="-v /etc/group:/etc/group:ro " - WRITE_PARAMETERS+="-v /etc/passwd:/etc/passwd:ro " - WRITE_PARAMETERS+="--user $CHE_USER " - IFS=$' ' - for TMP_GROUP in ${CHE_USER_GROUPS}; do - WRITE_PARAMETERS+="--group-add ${TMP_GROUP}" - done - fi - - GENERATE_COMMAND="docker run -it --rm --name build-che ${WRITE_PARAMETERS} \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -v \"${M2_MOUNT}\":/home/user/.m2/repository \ - -v \"${ARCHETYPE_MOUNT}/${ASSEMBLY_ID}\":/home/user/che-build \ - -w /home/user/che-build \ - ${UTILITY_IMAGE_DEV} \ - mvn clean install -pl '${ASSEMBLY_GROUP}.${ASSEMBLY_TYPE}:assembly-main' --am" - log ${GENERATE_COMMAND} - eval ${GENERATE_COMMAND} -} diff --git a/dockerfiles/base/scripts/base/commands/cmd_action.sh b/dockerfiles/base/scripts/base/commands/cmd_action.sh deleted file mode 100644 index 43e9e2488399..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_action.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -help_cmd_action() { - text "\n" - text "USAGE: ${CHE_IMAGE_FULLNAME} action [ACTION_PARAMETERS]\n" - text "\n" - text "Executes a REST action against ${CHE_MINI_PRODUCT_NAME} server or workspace.\n" - text "\n" - text "ACTIONS:\n" - text " create-start-workspace\n" - text " add-user\n" - text " remove-user\n" - text " execute-command\n" - text " list-workspaces\n" - text " workspace-ssh\n" - text " get-ssh-data\n" - text " graceful-stop\n" - text "\n" - text "Run '${CHE_IMAGE_FULLNAME} action' for action parameters" - text "\n" -} - -pre_cmd_action() { - # Not loaded as part of the init process to save on download time - load_utilities_images_if_not_done -} - -post_cmd_action() { - : -} - -cmd_action() { - docker_run $(get_docker_run_terminal_options) ${UTILITY_IMAGE_CHEACTION} "$@" -} diff --git a/dockerfiles/base/scripts/base/commands/cmd_agenerate.sh b/dockerfiles/base/scripts/base/commands/cmd_agenerate.sh deleted file mode 100644 index 29157feaceca..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_agenerate.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -pre_cmd_agenerate() { - # Not loaded as part of the init process to save on download time - - UTILITY_IMAGE_DEV="eclipse/che-dev" - - if ! is_fast && ! skip_pull; then - load_utilities_images_if_not_done - update_image $UTILITY_IMAGE_DEV - fi -} - -cmd_agenerate() { - if ! $SKIP_INTERACTIVE; then - info "archetype" "Welcome to $CHE_FORMAL_PRODUCT_NAME custom assembly generator!" - info "archetype" "" - info "archetype" "You can skip this message with '--no:interactive'." - info "archetype" "" - info "archetype" "This generator requires:" - info "archetype" " 1. Maven 3.3+ to be installed on your host." - info "archetype" " 2. Your host Maven M2 repo mounted to ':/m2'." - info "archetype" " 3. A local path for us to place the assembly mounted to ':/archetype'." - - text "\n" - read -p " Ready? [Y/n] " -n 1 -r - text "\n" - if [[ $REPLY =~ ^[Nn]$ ]]; then - return 2 - fi - - PS3="Please enter your choice: " - options=("agent-archetype - Assembly with sample agent" \ - "plugin-menu-archetype - Assembly with IDE extension to customize menu" \ - "plugin-wizard-archetype - Assembly with custom C project type extension" \ - "plugin-serverservice-archetype - Assembly with simple IDE extesion and a server service" \ - "plugin-embedjs-archetype - Assembly with simple IDE extesion for using native javascript in widgets" \ - "plugin-json-archetype - Assembly with sample JSON project type, editor codeassistant, and workspace services" \ - "stacks-archetype - Assembly with sample stack packaging module, for using custom stacks in assemblies") - select opt in "${options[@]}" - do - case $opt in - "agent-archetype - Assembly with sample agent") - ARCHETYPE_ID="agent-archetype" - break - ;; - "plugin-menu-archetype - Assembly with IDE extension to customize menu") - ARCHETYPE_ID="plugin-menu-archetype" - break - ;; - "plugin-wizard-archetype - Assembly with custom C project type extension") - ARCHETYPE_ID="plugin-wizard-archetype" - break - ;; - "plugin-serverservice-archetype - Assembly with simple IDE extesion and a server service") - ARCHETYPE_ID="plugin-serverservice-archetype" - break - ;; - "plugin-embedjs-archetype - Assembly with simple IDE extesion for using native javascript in widgets") - ARCHETYPE_ID="plugin-embedjs-archetype" - break - ;; - "plugin-json-archetype - Assembly with sample JSON project type, editor codeassistant, and workspace services") - ARCHETYPE_ID="plugin-json-archetype" - break - ;; - "stacks-archetype - Assembly with sample stack packaging module, for using custom stacks in assemblies") - ARCHETYPE_ID="stacks-archetype" - break - ;; - *) echo invalid option;; - esac - done - text "\n" - fi - - WRITE_PARAMETERS="" - if is_docker_for_mac || is_native; then - WRITE_PARAMETERS+="-v /etc/group:/etc/group:ro " - WRITE_PARAMETERS+="-v /etc/passwd:/etc/passwd:ro " - WRITE_PARAMETERS+="--user $CHE_USER " - IFS=$' ' - for TMP_GROUP in ${CHE_USER_GROUPS}; do - WRITE_PARAMETERS+="--group-add ${TMP_GROUP} " - done - fi - - GENERATE_COMMAND="docker run -it --rm --name generate-che ${WRITE_PARAMETERS} \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -v \"${M2_MOUNT}\":/home/user/.m2/repository \ - -v \"${ARCHETYPE_MOUNT}\":/home/user/che-build \ - -w /home/user/che-build \ - ${UTILITY_IMAGE_DEV} \ - mvn -Dmaven.repo.local=/home/user/.m2/repository/ org.apache.maven.plugins:maven-archetype-plugin:2.4:generate \ - -DarchetypeGroupId=org.eclipse.che.archetype \ - -DarchetypeArtifactId=$ARCHETYPE_ID \ - -DarchetypeVersion=$ARCHETYPE_VERSION \ - -DgroupId=$ASSEMBLY_GROUP \ - -DartifactId=$ASSEMBLY_ID \ - -Dversion=$ASSEMBLY_VERSION \ - -DinteractiveMode=false" - log ${GENERATE_COMMAND} - eval ${GENERATE_COMMAND} -} diff --git a/dockerfiles/base/scripts/base/commands/cmd_archetype.sh b/dockerfiles/base/scripts/base/commands/cmd_archetype.sh deleted file mode 100644 index 89c1fa31188a..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_archetype.sh +++ /dev/null @@ -1,185 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -help_cmd_archetype() { - text "\n" - text "USAGE: DOCKER_PARAMS ${CHE_IMAGE_FULLNAME} archetype ACTION [PARAMETERS]\n" - text "\n" - text "Use an archetype to generate, build or run a custom ${CHE_MINI_PRODUCT_NAME} assembly\n" - text "\n" - text "MANDATORY DOCKER PARAMETERS:\n" - text " -v :/archetype Local path where your custom assembly will be generated\n" - text "\n" - text "OPTIONAL DOCKER PARAMETERS:\n" - text " -v :/m2 Local path to your host's Maven M2 repository\n" - text "\n" - text "ACTION:\n" - text " all Generate, build and run a new custom assembly\n" - text " generate Generate a new custom assembly to folder mounted to '/archetype'\n" - text " build Uses 'eclipse/che-dev' image to compile archetype in '/archetype'\n" - text " run Starts ${CHE_MINI_PRODUCT_NAME} from custom assembly in '/archetype'\n" - text "\n" - text "PARAMETERS:\n" - text " --che For run and stop commands. Select Che assembly\n" - text " --codenvy For run and stop commands. Select Codenvy assembly\n" - text " --archid= Different archetypes generate different types of customizations\n" - text " --archversion= Sets archetype version - default = tag of CLI image\n" - text " --version= Sets custom assembly version - default = archetype version\n" - text " --group= Sets groupId of generated assembly - default = com.sample\n" - text " --id= Sets artifaceId of generated assembly - default = assembly\n" - text " --no:interactive Disables interactive mode\n" - text "\n" - text "An assembly is a bundling of extensions, plugins, stacks, agents, branding elements, and a CLI\n" - text "that can be built into a new binary for distribution. In essence, an assemly is a custom ${CHE_MINI_PRODUCT_NAME}.\n" - text "\n" - text "An archetype is a maven technique for generating code templates. A single archetype has an ID and\n" - text "generates a complete custom assembly. Differnent archetypes generate assemblies with different\n" - text "types of customizations. We make each archetype customize the minimal number of features to make\n" - text "learning about customizations simpler.\n" - text "\n" - text "Your host system must have Maven 3.3+ installed to facilitate generation and compiling of custom\n" - text "assemblies. You must pass in your Maven's M2 repository path on your host. Our archetype generator\n" - text "will download libraries into that repository making repeated compilations faster over time.\n" - text "On most Linux based systems, your M2 repo is located at '/home/user/.m2/repository' and it is\n" - text "'%%USERPROFILE%%/.m2/repostory 'for Windows. We default your M2 home to '/home/user/.m2'. If your.\n" - text "local Maven pom.xml changes the location of the repository, put the full path to the repo.\n" - text "\n" - text "Your custom assembly will be generated in the host path mounted to '/archetype'. This generates a \n" - text "Maven multi-module project. You can enter the folder and build it with 'mvn clean install' or use\n" - text "this utility to build it. Compiling an assembly requires other tools like Java, Angular, Go to be\n" - text "installed on your host system. However, if you use this tool to compile your custom assembly we\n" - text "use 'eclipse/che-dev' Docker image which contains all of these utilities preinstalled. It is simple\n" - text "but is a large download >1GB and compilation is slower than using your host since the Docker\n" - text "container is performing compilation against files that are host-mounted.\n" -} - -pre_cmd_archetype() { - if [ $# -eq 0 ]; then - help_cmd_archetype - return 2; - fi - - ARCHETYPE_ACTION="all" - ARCHETYPE_ID="plugin-menu-archetype" - -############################## - ARCHETYPE_VERSION=$(get_image_version) - ASSEMBLY_VERSION=$ARCHETYPE_VERSION - ASSEMBLY_GROUP="com.sample" - ASSEMBLY_ID="assembly" - SKIP_INTERACTIVE=false - ASSEMBLY_TYPE="che" - - for i in "$@" - do - case $1 in - all|generate|build|run|stop) - ARCHETYPE_ACTION=$1 - shift - ;; - - --che) - ASSEMBLY_TYPE="che" - shift - ;; - - --codenvy) - ASSEMBLY_TYPE="codenvy" - shift - ;; - - --archid=*) - ARCHETYPE_ID="${i#*=}" - shift - ;; - - --archversion=*) - ARCHETYPE_VERSION="${i#*=}" - shift - ;; - - --version=*) - ASSEMBLY_VERSION="${i#*=}" - shift - ;; - - --group=*) - ASSEMBLY_GROUP="${i#*=}" - shift - ;; - - --id=*) - ASSEMBLY_ID="${i#*=}" - shift - ;; - - --no:interactive) - SKIP_INTERACTIVE=true - shift - ;; - - *) - # unknown option - error "You passed an unknown command line option." - return 2 - ;; - esac - done - - ARCHETYPE_MOUNT=$(get_container_folder ":/archetype") - M2_MOUNT=$(get_container_folder ":/m2") - - if [[ "${ARCHETYPE_MOUNT}" = "not set" ]]; then - info "Welcome to $CHE_FORMAL_PRODUCT_NAME custom assembly generator!" - info "" - info "We could not detect a location to create your custom assembly." - info "Volume mount a local directory to ':/archetype'." - info "" - info "Syntax:" - info " docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock" - info " -v :${CHE_CONTAINER_ROOT}" - info " -v :/archetype" - info " ${CHE_IMAGE_FULLNAME} archetype $*" - info "" - return 2; - fi - - if [[ "${M2_MOUNT}" = "not set" ]]; then - warning "archetype" "Maven M2 repository detected - setting to '/home/user/.m2/repository'" - M2_MOUNT="/home/user/.m2/repository" - fi -} - -cmd_archetype() { - cd /archetype - - case $ARCHETYPE_ACTION in - generate) - cmd_lifecycle agenerate - ;; - build) - cmd_lifecycle abuild - ;; - run) - cmd_lifecycle arun - ;; - stop) - cmd_lifecycle astop - ;; - all) - cmd_lifecycle agenerate || true - cmd_lifecycle abuild || true - cmd_lifecycle arun || true - ;; - esac -} diff --git a/dockerfiles/base/scripts/base/commands/cmd_arun.sh b/dockerfiles/base/scripts/base/commands/cmd_arun.sh deleted file mode 100644 index a54877327f63..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_arun.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -pre_cmd_arun() { - if [ ! -d /archetype/$ASSEMBLY_ID ]; then - error "Assembly at ${ARCHETYPE_MOUNT}/$ASSEMBLY_ID not found." - return 2 - fi -} - -cmd_arun() { - -case $ASSEMBLY_TYPE in - codenvy ) CLI_IMAGE=codenvy/cli:nightly - DATA_MOUNT=$HOME/.codenvy/sample/data - ASSEMBLY_LOCATION=$ASSEMBLY_ID/assembly-codenvy/assembly-main/target/codenvy-onpremises-$ASSEMBLY_VERSION - ;; - che ) CLI_IMAGE=eclipse/che-cli:nightly - DATA_MOUNT=$HOME/.che/sample/data - ASSEMBLY_LOCATION=$ASSEMBLY_ID/assembly-che/assembly-main/target/eclipse-che-$ASSEMBLY_VERSION/eclipse-che-$ASSEMBLY_VERSION - ;; -esac - - cd /archetype/$ASSEMBLY_ID - - RUN_COMMAND="docker run -it --rm --name run-che \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -v \"${DATA_MOUNT}\":${CHE_CONTAINER_ROOT} \ - -v \"${ARCHETYPE_MOUNT}\"/\"${ASSEMBLY_LOCATION}\":/assembly \ - ${CLI_IMAGE} \ - start --skip:nightly" - log ${RUN_COMMAND} - eval ${RUN_COMMAND} -} diff --git a/dockerfiles/base/scripts/base/commands/cmd_astop.sh b/dockerfiles/base/scripts/base/commands/cmd_astop.sh deleted file mode 100644 index f4e8ffcdb1bf..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_astop.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -pre_cmd_astop() { - if [ ! -d /archetype/$ASSEMBLY_ID ]; then - error "Assembly at ${ARCHETYPE_MOUNT}/$ASSEMBLY_ID not found." - return 2 - fi -} - -cmd_astop() { - -case $ASSEMBLY_TYPE in - codenvy ) CLI_IMAGE=codenvy/cli:nightly - DATA_MOUNT=$HOME/.codenvy/sample/data - ASSEMBLY_LOCATION=$ASSEMBLY_ID/assembly-codenvy/assembly-main/target/codenvy-onpremises-$ASSEMBLY_VERSION - ;; - che ) CLI_IMAGE=eclipse/che-cli:nightly - DATA_MOUNT=$HOME/.che/sample/data - ASSEMBLY_LOCATION=$ASSEMBLY_ID/assembly-che/assembly-main/target/eclipse-che-$ASSEMBLY_VERSION/eclipse-che-$ASSEMBLY_VERSION - ;; -esac - - cd /archetype/$ASSEMBLY_ID - - STOP_COMMAND="docker run -it --rm --name run-che \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -v \"${DATA_MOUNT}\":${CHE_CONTAINER_ROOT} \ - -v \"${ARCHETYPE_MOUNT}\"/\"${ASSEMBLY_LOCATION}\":/assembly \ - ${CLI_IMAGE} \ - stop --skip:nightly --skip:graceful" - log ${STOP_COMMAND} - eval ${STOP_COMMAND} -} diff --git a/dockerfiles/base/scripts/base/commands/cmd_backup.sh b/dockerfiles/base/scripts/base/commands/cmd_backup.sh deleted file mode 100644 index 967eefa369e3..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_backup.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -help_cmd_backup() { - text "\n" - text "USAGE: ${CHE_IMAGE_FULLNAME} backup [PARAMETERS]\n" - text "\n" - text "Backup ${CHE_MINI_PRODUCT_NAME} configuration and user data\n" - text "\n" - text "PARAMETERS:\n" - text " --no-skip-data Excludes user data in /instance/data\n" - text "\n" -} - -pre_cmd_backup() { - : -} - -post_cmd_backup() { - : -} - -cmd_backup() { - # possibility to skip ${CHE_FORMAL_PRODUCT_NAME} projects backup - SKIP_BACKUP_CHE_DATA=${1:-"--no-skip-data"} - if [[ "${SKIP_BACKUP_CHE_DATA}" == "--skip-data" ]]; then - TAR_EXTRA_EXCLUDE="--exclude=instance/data${CHE_CONTAINER_ROOT}" - else - TAR_EXTRA_EXCLUDE="" - fi - - if [[ ! -d "${CHE_CONTAINER_CONFIG}" ]]; then - error "Cannot find existing CHE_CONFIG or CHE_INSTANCE." - return; - fi - - if get_server_container_id "${CHE_SERVER_CONTAINER_NAME}" >> "${LOGS}" 2>&1; then - error "$CHE_MINI_PRODUCT_NAME is running. Stop before performing a backup." - return 2; - fi - - if [[ ! -d "${CHE_CONTAINER_BACKUP}" ]]; then - mkdir -p "${CHE_CONTAINER_BACKUP}" - fi - - # check if backups already exist and if so we move it with time stamp in name - if [[ -f "${CHE_CONTAINER_BACKUP}/${CHE_BACKUP_FILE_NAME}" ]]; then - mv "${CHE_CONTAINER_BACKUP}/${CHE_BACKUP_FILE_NAME}" \ - "${CHE_CONTAINER_BACKUP}/moved-$(get_current_date)-${CHE_BACKUP_FILE_NAME}" - fi - - info "backup" "Saving Eclipse Che data..." - docker_run -v "${CHE_HOST_CONFIG}":/root${CHE_CONTAINER_ROOT} \ - -v "${CHE_HOST_BACKUP}":/root/backup \ - $(cmd_backup_extra_args) \ - ${BOOTSTRAP_IMAGE_ALPINE} sh -c "tar czf /root/backup/${CHE_BACKUP_FILE_NAME} -C /root${CHE_CONTAINER_ROOT} . --exclude='backup' --exclude='instance/dev' --exclude='instance/logs' ${TAR_EXTRA_EXCLUDE}" - info "" - info "backup" "${CHE_MINI_PRODUCT_NAME} data saved in ${CHE_HOST_BACKUP}/${CHE_BACKUP_FILE_NAME}" -} - -cmd_backup_extra_args() { - echo "" -} - -# return date in format which can be used as a unique file or dir name -# example 2016-10-31-1477931458 -get_current_date() { - date +'%Y-%m-%d-%s' -} diff --git a/dockerfiles/base/scripts/base/commands/cmd_config.sh b/dockerfiles/base/scripts/base/commands/cmd_config.sh deleted file mode 100644 index 46d6b320d6f2..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_config.sh +++ /dev/null @@ -1,207 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -help_cmd_config() { - text "\n" - text "USAGE: ${CHE_IMAGE_FULLNAME} config [PARAMETERS]\n" - text "\n" - text "Generate a ${CHE_MINI_PRODUCT_NAME} runtime configuration into /instance. The configurator uses -values from your host, ${CHE_MINI_PRODUCT_NAME}.env, and optionally your local repository to generate -a runtime configuration used to start and stop ${CHE_MINI_PRODUCT_NAME}. A configuration is generated -before every execution of ${CHE_MINI_PRODUCT_NAME}. The configuration phase will download all Docker -images required to start or stop ${CHE_MINI_PRODUCT_NAME} to guarantee that the right images are cached -before execution. If you have mounted a local repository or assembly, the ${CHE_MINI_PRODUCT_NAME} Docker -images will use those binaries instead of their embedded ones.\n" - text "\n" - text "PARAMETERS:\n" - text " --force Uses 'docker rmi' and 'docker pull' to forcibly retrieve latest images\n" - text " --no-force Updates images if matching tag not found in local cache\n" - text " --pull Uses 'docker pull' to check for new remote versions of images\n" - text " --skip:config Skip re-generation of config files placed into /instance\n" - text "\n" -} - -pre_cmd_config() { - CHE_SKIP_CONFIG=false - FORCE_UPDATE="--no-force" - - while [ $# -gt 0 ]; do - case $1 in - --skip:config) - CHE_SKIP_CONFIG=true - shift ;; - --force) - FORCE_UPDATE="--force" - shift ;; - --no-force) - FORCE_UPDATE="--no-force" - shift ;; - --pull) - FORCE_UPDATE="--pull" - shift ;; - *) error "Unknown parameter: $1" return 2 ;; - esac - done -} - -post_cmd_config() { - : -} - -cmd_config() { - # If the system is not initialized, initalize it. - # If the system is already initialized, but a user wants to update images, then re-download. - if ! is_initialized; then - cmd_lifecycle init $FORCE_UPDATE - elif [[ "${FORCE_UPDATE}" == "--pull" ]] || \ - [[ "${FORCE_UPDATE}" == "--force" ]]; then - cmd_lifecycle download $FORCE_UPDATE - elif is_nightly && ! is_fast && ! skip_pull; then - cmd_lifecycle download --pull - fi - - # If using a local repository, then we need to always perform an updated init with those files - if local_repo; then - # if user has mounted local repo, use configuration files from the repo. - # please note that in production mode update of configuration sources must be only on update. - docker_run -v "${CHE_HOST_CONFIG}":/copy \ - -v "${CHE_HOST_DEVELOPMENT_REPO}"/dockerfiles/init:/files \ - $IMAGE_INIT - - fi - - # Run the docker configurator - if ! skip_config; then - generate_configuration_with_puppet - fi - - # Replace certain environment file lines with their container counterparts - info "config" "Customizing docker-compose for running in a container" - - if local_repo || local_assembly; then - # in development mode to avoid permissions issues we copy tomcat assembly to ${CHE_INSTANCE} - # if ${CHE_FORMAL_PRODUCT_NAME} development tomcat exist we remove it - if [[ -d "${CHE_CONTAINER_INSTANCE}/dev" ]]; then - log "docker_run -v \"${CHE_HOST_INSTANCE}/dev\":/root/dev ${BOOTSTRAP_IMAGE_ALPINE} sh -c \"rm -rf /root/dev/*\"" - - # Super weird bug - sometimes, the RM command doesn't wipe everything, so we have to repeat it a couple times - until config_directory_is_empty; do - docker_run -v "${CHE_HOST_INSTANCE}/dev":/root/dev ${BOOTSTRAP_IMAGE_ALPINE} sh -c "rm -rf /root/dev/${CHE_MINI_PRODUCT_NAME}-tomcat" > /dev/null 2>&1 || true - done - - log "rm -rf \"${CHE_HOST_INSTANCE}/dev\" >> \"${LOGS}\"" - rm -rf "${CHE_CONTAINER_INSTANCE}/dev" - fi - - if [[ ! -d $(echo ${CHE_CONTAINER_ASSEMBLY_FULL_PATH}) ]]; then - warning "You mounted ':/repo' or ':/assembly', but we did not find an assembly." - warning "Have you built the assembly with 'mvn clean install'?" - warning "CHE_ASSEMBLY=${CHE_CONTAINER_ASSEMBLY_FULL_PATH}" - return 2 - fi - - # copy ${CHE_FORMAL_PRODUCT_NAME} development tomcat to ${CHE_INSTANCE} folder - info "config" "Copying local binaries to ${CHE_HOST_INSTANCE}/dev..." - mkdir -p "${CHE_CONTAINER_INSTANCE}/dev/${CHE_MINI_PRODUCT_NAME}-tomcat" - cp -r "$(echo ${CHE_CONTAINER_ASSEMBLY_FULL_PATH})/." \ - "${CHE_CONTAINER_INSTANCE}/dev/${CHE_MINI_PRODUCT_NAME}-tomcat/" - fi -} - - -# Runs puppet image to generate che configuration -generate_configuration_with_puppet() { - info "config" "Generating $CHE_MINI_PRODUCT_NAME configuration..." - - if is_docker_for_windows; then - CHE_ENV_FILE=$(convert_posix_to_windows "${CHE_HOST_INSTANCE}/config/$CHE_MINI_PRODUCT_NAME.env") - else - CHE_ENV_FILE="${CHE_HOST_INSTANCE}/config/$CHE_MINI_PRODUCT_NAME.env" - fi - - if debug_server; then - CHE_ENVIRONMENT="development" - WRITE_LOGS="" - else - CHE_ENVIRONMENT="production" - WRITE_LOGS=">> \"${LOGS}\"" - fi - - CHE_REPO="off" - WRITE_PARAMETERS="" - - if local_repo || local_assembly; then - CHE_REPO="on" - WRITE_PARAMETERS=" -e \"CHE_ASSEMBLY=${CHE_ASSEMBLY}\"" - fi - - if local_repo; then - # add local mounts only if they are present - if [ -d "/repo/dockerfiles/init/manifests" ]; then - WRITE_PARAMETERS+=" -v \"${CHE_HOST_DEVELOPMENT_REPO}/dockerfiles/init/manifests\":/etc/puppet/manifests:ro" - fi - if [ -d "/repo/dockerfiles/init/modules" ]; then - WRITE_PARAMETERS+=" -v \"${CHE_HOST_DEVELOPMENT_REPO}/dockerfiles/init/modules\":/etc/puppet/modules:ro" - fi - # Handle override/addon - if [ -d "/repo/dockerfiles/init/addon" ]; then - WRITE_PARAMETERS+=" -v \"${CHE_HOST_DEVELOPMENT_REPO}/dockerfiles/init/addon/addon.pp\":/etc/puppet/manifests/addon.pp:ro" - if [ -d "/repo/dockerfiles/init/addon/modules" ]; then - WRITE_PARAMETERS+=" -v \"${CHE_HOST_DEVELOPMENT_REPO}/dockerfiles/init/addon/modules/\":/etc/puppet/addon/:ro" - fi - fi - fi - - for element in "${CLI_ENV_ARRAY[@]}" - do - var1=$(echo $element | cut -f1 -d=) - var2=$(echo $element | cut -f2 -d=) - - if [[ $var1 == CHE_* ]] || - [[ $var1 == IMAGE_* ]] || - [[ $var1 == *_IMAGE_* ]] || - [[ $var1 == ${CHE_PRODUCT_NAME}_* ]]; then - WRITE_PARAMETERS+=" -e $var1='$var2'" - fi - done - - GENERATE_CONFIG_COMMAND="docker_run \ - --env-file=\"${REFERENCE_CONTAINER_ENVIRONMENT_FILE}\" \ - --env-file=/version/$CHE_VERSION/images \ - -v \"${CHE_HOST_INSTANCE}\":/opt/${CHE_MINI_PRODUCT_NAME}:rw \ - ${WRITE_PARAMETERS} \ - -e \"CHE_ENV_FILE=${CHE_ENV_FILE}\" \ - -e \"CHE_CONTAINER_ROOT=${CHE_CONTAINER_ROOT}\" \ - -e \"CHE_CONTAINER_NAME=${CHE_CONTAINER_NAME}\" \ - -e \"CHE_ENVIRONMENT=${CHE_ENVIRONMENT}\" \ - -e \"CHE_CONFIG=${CHE_HOST_INSTANCE}\" \ - -e \"CHE_USER=${CHE_USER}\" \ - -e \"CHE_INSTANCE=${CHE_HOST_INSTANCE}\" \ - -e \"CHE_REPO=${CHE_REPO}\" \ - --entrypoint=/usr/bin/puppet \ - $IMAGE_INIT \ - apply --modulepath \ - /etc/puppet/modules/:/etc/puppet/addon/ \ - /etc/puppet/manifests/ --show_diff ${WRITE_LOGS}" - - log ${GENERATE_CONFIG_COMMAND} - eval ${GENERATE_CONFIG_COMMAND} -} - -config_directory_is_empty() { - if [[ -d "${CHE_CONTAINER_INSTANCE}/dev/${CHE_MINI_PRODUCT_NAME}-tomcat" ]]; then - return 1 - else - return 0 - fi -} diff --git a/dockerfiles/base/scripts/base/commands/cmd_destroy.sh b/dockerfiles/base/scripts/base/commands/cmd_destroy.sh deleted file mode 100644 index a4aa6c5f324e..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_destroy.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -help_cmd_destroy() { - text "\n" - text "USAGE: ${CHE_IMAGE_FULLNAME} destroy [PARAMETERS]\n" - text "\n" - text "Deletes a ${CHE_MINI_PRODUCT_NAME} installation\n" - text "\n" - text "PARAMETERS:\n" - text " --quiet Do not ask user for confirmation\n" - text " --cli Removes the 'cli.log'\n" - text "\n" -} - - -pre_cmd_destroy() { - : -} - -post_cmd_destroy() { - : -} - -cmd_destroy_post_action() { - true -} - -cmd_destroy() { - debug $FUNCNAME - - QUIET="" - DESTROY_CLI="false" - - while [ $# -gt 0 ]; do - case $1 in - --quiet) - QUIET="--quiet" - shift ;; - --cli) - DESTROY_CLI="true" - shift ;; - *) error "Unknown parameter: $1; did you mean --quiet or --cli?" ; return 2 ;; - esac - done - - WARNING="${YELLOW}!!!${RED} Stopping services and ${YELLOW}!!!${RED} deleting data ${YELLOW}!!!${RED} this is unrecoverable ${YELLOW}!!!${NC}" - if ! confirm_operation "${WARNING}" "${QUIET}"; then - return; - fi - - cmd_lifecycle stop --skip:graceful - - info "destroy" "Deleting instance and config..." - - log "docker_run -v \"${CHE_HOST_CONFIG}\":${CHE_CONTAINER_ROOT} \ - ${BOOTSTRAP_IMAGE_ALPINE} sh -c \"rm -rf /root${CHE_CONTAINER_ROOT}/docs \ - && rm -rf /root${CHE_CONTAINER_ROOT}/instance \ - && rm -rf /root${CHE_CONTAINER_ROOT}/${CHE_MINI_PRODUCT_NAME}.env\"" - # Super weird bug. For some reason on windows, this command has to be run 3x for everything - # to be destroyed properly if you are in dev mode. - until directory_is_empty; do - docker_run -v "${CHE_HOST_CONFIG}":/root${CHE_CONTAINER_ROOT} \ - ${BOOTSTRAP_IMAGE_ALPINE} sh -c "rm -rf /root${CHE_CONTAINER_ROOT}/docs \ - ; rm -rf /root${CHE_CONTAINER_ROOT}/instance \ - ; rm -rf /root${CHE_CONTAINER_ROOT}/${CHE_MINI_PRODUCT_NAME}.env" > /dev/null 2>&1 || true - done - rm -rf "${CHE_CONTAINER_INSTANCE}" - - cmd_destroy_post_action - - # Sometimes users want the CLI log after they have destroyed their instance - # If they pass destroy --cli then we will also destroy the CLI log - if [[ "${DESTROY_CLI}" = "true" ]]; then - info "destroy" "Deleting cli.log..." - docker_run -v "${CHE_HOST_CONFIG}":/root${CHE_CONTAINER_ROOT} \ - ${BOOTSTRAP_IMAGE_ALPINE} sh -c "rm -rf /root${CHE_CONTAINER_ROOT}/cli.log" > /dev/null 2>&1 || true - fi -} - -directory_is_empty() { - if [[ -d "${CHE_CONTAINER_CONFIG}/docs" ]] || - [[ -d "${CHE_CONTAINER_CONFIG}/instance" ]] || - [[ -f "${CHE_CONTAINER_CONFIG}/${CHE_MINI_PRODUCT_NAME}.env" ]]; then - return 1 - else - return 0 - fi -} diff --git a/dockerfiles/base/scripts/base/commands/cmd_dir.sh b/dockerfiles/base/scripts/base/commands/cmd_dir.sh deleted file mode 100644 index 1fcdcd5c044e..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_dir.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# - -help_cmd_dir() { - text "\n" - text "USAGE: ${CHE_IMAGE_FULLNAME} dir COMMAND [PARAMETERS]\n" - text "\n" - text "Create a workspace using a local directory mounted to ':\chedir'\n" - text "\n" - text "COMMANDS:\n" - text " init Initializes an empty local directory with a new Chefile\n" - text " down Stops the workspace and ${CHE_MINI_PRODUCT_NAME} representing this directory\n" - text " ssh SSH into the workspace that represents the local directory\n" - text " status Reports on the runtime status of ${CHE_MINI_PRODUCT_NAME} and the workspace runtime\n" - text " up Starts ${CHE_MINI_PRODUCT_NAME} and creates a new workspace with a project from your local dir\n" - text "\n" -} - -pre_cmd_dir() { - # Not loaded as part of the init process to save on download time - load_utilities_images_if_not_done -} - -post_cmd_dir() { - : -} - -cmd_dir() { - CHE_LOCAL_REPO=false - if [[ "${CHEDIR_MOUNT}" != "not set" ]]; then - local HOST_FOLDER_TO_USE="${CHEDIR_MOUNT}" - else - local HOST_FOLDER_TO_USE="${DATA_MOUNT}" - - warning "':/chedir' not mounted - using ${DATA_MOUNT} as source location" - fi - - docker_run $(get_docker_run_terminal_options) -v ${HOST_FOLDER_TO_USE}:${HOST_FOLDER_TO_USE} \ - ${UTILITY_IMAGE_CHEDIR} ${HOST_FOLDER_TO_USE} "$@" -} diff --git a/dockerfiles/base/scripts/base/commands/cmd_download.sh b/dockerfiles/base/scripts/base/commands/cmd_download.sh deleted file mode 100644 index c5b3a6f67004..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_download.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -help_cmd_download() { - text "\n" - text "USAGE: ${CHE_IMAGE_FULLNAME} download [PARAMETERS]\n" - text "\n" - text "Downloads Docker images required to execute ${CHE_MINI_PRODUCT_NAME}\n" - text "\n" - text "PARAMETERS:\n" - text " --force Uses 'docker rmi' and 'docker pull' to forcibly retrieve latest images\n" - text " --no-force Updates images if matching tag not found in local cache\n" - text " --pull Uses 'docker pull' to check for new remote versions of images\n" - text "\n" -} - -pre_cmd_download() { - : -} - -post_cmd_download() { - : -} - - -cmd_download() { - FORCE_UPDATE=${1:-"--no-force"} - local IMAGES=${IMAGE_LIST} - IMAGES+=$'\n'${BOOTSTRAP_IMAGE_LIST} - IMAGES+=$'\n'${UTILITY_IMAGE_LIST} - - IFS=$'\n' - for SINGLE_IMAGE in $IMAGES; do - VALUE_IMAGE=$(echo $SINGLE_IMAGE | cut -d'=' -f2) - if [[ $FORCE_UPDATE == "--force" ]] || - [[ $FORCE_UPDATE == "--pull" ]]; then - update_image $FORCE_UPDATE $VALUE_IMAGE - else - update_image_if_not_found $VALUE_IMAGE - fi - done -} - diff --git a/dockerfiles/base/scripts/base/commands/cmd_help.sh b/dockerfiles/base/scripts/base/commands/cmd_help.sh deleted file mode 100644 index 03dcaf852d51..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_help.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -help_cmd_help() { - text "\n" - text "Usage: ${CHE_IMAGE_FULLNAME} help" - text "\n" -} - -cmd_help() { - usage -} - -pre_cmd_help() { - : -} - -post_cmd_help() { - : -} diff --git a/dockerfiles/base/scripts/base/commands/cmd_info.sh b/dockerfiles/base/scripts/base/commands/cmd_info.sh deleted file mode 100644 index c8cfa6a40a6d..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_info.sh +++ /dev/null @@ -1,194 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -help_cmd_info() { - text "\n" - text "USAGE: ${CHE_IMAGE_FULLNAME} info [PARAMETERS]\n" - text "\n" - text "Status, information, and support diagnostic bundles for ${CHE_MINI_PRODUCT_NAME}\n" - text "\n" - text "PARAMETERS:\n" - text " --all Prints info, runs networking tests, ad prepares diagnostic bundle\n" - text " --bundle Prepares diagnostic bundle for ${CHE_MINI_PRODUCT_NAME} and Docker\n" - text " --network Runs simulated network diagnostic to confirm network routing\n" - text " --print Default - displays status and configuration of ${CHE_MINI_PRODUCT_NAME}\n" - text "\n" -} - - -pre_cmd_info() { - : -} - -post_cmd_info() { - : -} - -cmd_info() { - debug $FUNCNAME - if [ $# -eq 0 ]; then - TESTS="--print" - else - TESTS=$1 - fi - - case $TESTS in - --all|-all) - print_info - cmd_network - prepare_bundle - ;; - --network|-network) - cmd_network - ;; - --print|-print) - print_info - ;; - --bundle|-bundle) - prepare_bundle - ;; - *) - info "info" "Unknown info flag passed: $1." - return; - ;; - esac -} - -prepare_bundle() { - info "info" "Preparing diagnostic bundle..." - docker run --net host ${BOOTSTRAP_IMAGE_ALPINE} ip a show >> "${CLI_DIR}/ip.output" - docker run --net host ${BOOTSTRAP_IMAGE_ALPINE} route >> "${CLI_DIR}/route.output" - curl -s https://hub.docker.com/v2/repositories/${CHE_IMAGE_NAME}/tags/ >> "${CLI_DIR}/curlversion.output" - curl -I -k https://hub.docker.com >> "${CLI_DIR}/curldockerhub.output" - df "${CHE_CONTAINER_ROOT}" >> "${CLI_DIR}/df.output" - cmd_network >> "${CLI_DIR}/cli-network.output" - print_info >> "${CLI_DIR}/cli-info.output" - - tar -cf "${CLI_DIR}"/${CHE_MINI_PRODUCT_NAME}-diagnostic-bundle.tar \ - "${CLI_DIR}/ip.output" \ - "${CLI_DIR}/route.output" \ - "${CLI_DIR}/curlversion.output" \ - "${CLI_DIR}/curldockerhub.output" \ - "${CLI_DIR}/df.output" \ - "${CLI_DIR}/cli.log" \ - "${CLI_DIR}/cli-network.output" \ - "${CLI_DIR}/cli-info.output" \ - "${CHE_CONTAINER_INSTANCE}/logs" > /dev/null 2>&1 || true - - - info "info" "Diagnostic bundle ${CHE_MINI_PRODUCT_NAME}-diagnostic-bundle.tar prepared" - - # Clean - docker_run -v "${CHE_HOST_CONFIG}":/root${CHE_CONTAINER_ROOT} \ - ${BOOTSTRAP_IMAGE_ALPINE} \ - sh -c "rm -rf /root${CHE_CONTAINER_ROOT}/ip.output \ - ; rm -rf /root${CHE_CONTAINER_ROOT}/route.output \ - ; rm -rf /root${CHE_CONTAINER_ROOT}/curlversion.output \ - ; rm -rf /root${CHE_CONTAINER_ROOT}/curldockerhub.output \ - ; rm -rf /root${CHE_CONTAINER_ROOT}/df.output \ - ; rm -rf /root${CHE_CONTAINER_ROOT}/cli-info.output \ - ; rm -rf /root${CHE_CONTAINER_ROOT}/cli-network.output" > /dev/null 2>&1 || true -} - -print_info() { - DOCKER_CONNECT="${DOCKER_MOUNT}" - if [[ "${DOCKER_MOUNT}" = "not set" ]]; then - DOCKER_CONNECT=$(docker inspect $(get_this_container_id) | grep DOCKER_HOST) - DOCKER_CONNECT=${DOCKER_CONNECT//\"} - DOCKER_CONNECT=${DOCKER_CONNECT//\,} - DOCKER_CONNECT=${DOCKER_CONNECT#*=} - fi - text "\n" - text "CLI:\n" - text " TTY: ${TTY_ACTIVATED}\n" - text " Daemon: ${DOCKER_CONNECT}\n" - text " Image: ${CHE_IMAGE_FULLNAME}\n" - text " Version: ${CHE_IMAGE_VERSION}\n" - text " Command: $(echo $COMMAND | cut -f2 -d'_')\n" - text " Parameters: ${ORIGINAL_PARAMETERS}\n" - text "Mounts:\n" - text " $CHE_CONTAINER_ROOT: $DATA_MOUNT\n" - text " $CHE_CONTAINER_ROOT/instance: $INSTANCE_MOUNT\n" - text " $CHE_CONTAINER_ROOT/backup: $BACKUP_MOUNT\n" - text " /repo: $REPO_MOUNT\n" - text " /assembly: $ASSEMBLY_MOUNT\n" - text " /sync: $SYNC_MOUNT\n" - text " /unison: $UNISON_PROFILE_MOUNT\n" - text " /chedir: $CHEDIR_MOUNT\n" - text "System:\n" - text " Docker: $(get_docker_install_type)\n" - if [[ ${HTTP_PROXY} = "" ]] && - [[ ${HTTPS_PROXY} = "" ]] && - [[ ${NO_PROXY} = "" ]]; then - text " Proxy: not set\n" - else - text " Proxy: HTTP_PROXY=${HTTP_PROXY}, HTTPS_PROXY=${HTTPS_PROXY}, NO_PROXY=${NO_PROXY}\n" - fi - text "Internal:\n" - text " ${CHE_PRODUCT_NAME}_VERSION: ${CHE_VERSION}\n" - text " ${CHE_PRODUCT_NAME}_HOST: ${CHE_HOST}\n" - text " ${CHE_PRODUCT_NAME}_INSTANCE: ${CHE_HOST_INSTANCE}\n" - text " ${CHE_PRODUCT_NAME}_CONFIG: ${CHE_HOST_CONFIG}\n" - text " ${CHE_PRODUCT_NAME}_BACKUP: ${CHE_HOST_BACKUP}\n" - text " ${CHE_PRODUCT_NAME}_REGISTRY: ${CHE_MANIFEST_DIR}\n" - text " ${CHE_PRODUCT_NAME}_DEBUG: ${CHE_DEBUG}\n" - text " IP Detection: $(docker run --net host ${BOOTSTRAP_IMAGE_CHEIP})\n" - if is_initialized; then - text " Initialized: true\n" - else - text " Initialized: false\n" - fi - if local_repo; then - text " ${CHE_PRODUCT_NAME}_DEVELOPMENT_REPO: ${CHE_HOST_DEVELOPMENT_REPO}\n" - fi - - text "Image Registry:\n" - for SINGLE_IMAGE in $IMAGE_LIST; do - text " $SINGLE_IMAGE\n" - done - for SINGLE_IMAGE in $BOOTSTRAP_IMAGE_LIST; do - text " $SINGLE_IMAGE\n" - done - for SINGLE_IMAGE in $UTILITY_IMAGE_LIST; do - text " $SINGLE_IMAGE\n" - done - - if ! is_initialized; then - text "${CHE_ENVIRONMENT_FILE}: not initialized\n" - else - text "${CHE_ENVIRONMENT_FILE}:\n" - # Implement loop of all lines that are uncommented. - CONFIGURATION_ARRAY=($(grep "^[^#]" "${REFERENCE_CONTAINER_ENVIRONMENT_FILE}")) - for SINGLE_CONFIGURATION in "${CONFIGURATION_ARRAY[@]}"; do - text " $SINGLE_CONFIGURATION\n" - done - fi -} - -cmd_network() { - info "" - info "---------------------------------------" - info "-------- CONNECTIVITY TEST --------" - info "---------------------------------------" - - info "network" "${BOOTSTRAP_IMAGE_CHEIP}: ${CHE_HOST}" - - start_test_server - - info "network" "Browser => Workspace Agent (localhost): Connection $(test1 && echo "succeeded" || echo "failed")" - info "network" "Browser => Workspace Agent ($AGENT_EXTERNAL_IP): Connection $(test2 && echo "succeeded" || echo "failed")" - info "network" "Server => Workspace Agent (External IP): Connection $(test3 && echo "succeeded" || echo "failed")" - info "network" "Server => Workspace Agent (Internal IP): Connection $(test4 && echo "succeeded" || echo "failed")" - - stop_test_server -} diff --git a/dockerfiles/base/scripts/base/commands/cmd_init.sh b/dockerfiles/base/scripts/base/commands/cmd_init.sh deleted file mode 100644 index 09628ec5a33f..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_init.sh +++ /dev/null @@ -1,172 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -help_cmd_init() { - text "\n" - text "USAGE: ${CHE_IMAGE_FULLNAME} init [PARAMETERS]\n" - text "\n" - text "Initializes a directory with a new ${CHE_MINI_PRODUCT_NAME} installation\n" - text "\n" - text "PARAMETERS:\n" - text " --accept-license If license acceptance required, auto accepts during installation\n" - text " --force Uses 'docker rmi' and 'docker pull' to forcibly retrieve latest images\n" - text " --no-force Updates images if matching tag not found in local cache\n" - text " --pull Uses 'docker pull' to check for new remote versions of images\n" - text " --reinit Reinitialize an existing installation overwriting defaults\n" - text "\n" -} - -pre_cmd_init() { - : -} - -post_cmd_init() { - : -} - -cmd_init() { - - # set an initial value for the flag - if is_nightly && ! is_fast && ! skip_pull; then - FORCE_UPDATE="--pull" - else - FORCE_UPDATE="--no-force" - fi - - AUTO_ACCEPT_LICENSE="false" - REINIT="false" - - while [ $# -gt 0 ]; do - case $1 in - --no-force|--force|--pull|--offline) - FORCE_UPDATE=$1 - shift ;; - --accept-license) - AUTO_ACCEPT_LICENSE="true" - shift ;; - --reinit) - REINIT="true" - shift ;; - *) error "Unknown parameter: $1" ; return 2 ;; - esac - done - - if [ "${FORCE_UPDATE}" == "--no-force" ]; then - # If ${CHE_FORMAL_PRODUCT_NAME}.environment file exists, then fail - if is_initialized; then - if [[ "${REINIT}" = "false" ]]; then - info "init" "Already initialized." - return 2 - fi - fi - fi - - if [[ "${CHE_IMAGE_VERSION}" = "nightly" ]]; then - warning "($CHE_MINI_PRODUCT_NAME init): 'nightly' installations cannot be upgraded to non-nightly versions" - fi - - if ! skip_pull; then - cmd_lifecycle download $FORCE_UPDATE - fi - - if require_license; then - if [[ "${AUTO_ACCEPT_LICENSE}" = "false" ]]; then - info "" - info "init" "Do you accept the ${CHE_FORMAL_PRODUCT_NAME} license? (${CHE_LICENSE_URL})" - text "\n" - read -p " I accept the license: [Y/n] " -r || { error "Shell is not in interactive mode. Add -i flag to the docker run command"; return 2; } - if [[ $REPLY =~ ^[Nn]$ ]]; then - return 2; - fi - text "\n" - fi - fi - - info "init" "Installing configuration and bootstrap variables:" - log "mkdir -p \"${CHE_CONTAINER_CONFIG}\"" - mkdir -p "${CHE_CONTAINER_CONFIG}" - log "mkdir -p \"${CHE_CONTAINER_INSTANCE}\"" - mkdir -p "${CHE_CONTAINER_INSTANCE}" - - if [ ! -w "${CHE_CONTAINER_CONFIG}" ]; then - error "CHE_CONTAINER_CONFIG is not writable. Aborting." - return 1; - fi - - if [ ! -w "${CHE_CONTAINER_INSTANCE}" ]; then - error "CHE_CONTAINER_INSTANCE is not writable. Aborting." - return 1; - fi - - # in development mode we use init files from repo otherwise we use it from docker image - INIT_RUN_PARAMETERS="" - if local_repo; then - if [ -d "/repo/dockerfiles/init/manifests" ]; then - INIT_RUN_PARAMETERS=" -v \"${CHE_HOST_DEVELOPMENT_REPO}/dockerfiles/init\":/files" - INIT_RUN_PARAMETERS+=" -v \"${CHE_HOST_DEVELOPMENT_REPO}/dockerfiles/init/manifests/${CHE_MINI_PRODUCT_NAME}.env\":/etc/puppet/manifests/${CHE_MINI_PRODUCT_NAME}.env" - fi - fi - GENERATE_INIT_COMMAND="docker_run -v \"${CHE_HOST_CONFIG}\":/copy ${INIT_RUN_PARAMETERS} $IMAGE_INIT" - log $GENERATE_INIT_COMMAND - eval $GENERATE_INIT_COMMAND - - # If this is is a reinit, we should not overwrite these core template files. - # If this is an initial init, then we have to override some values - if [[ "${REINIT}" = "false" ]]; then - # Otherwise, we are using the templated version and making some modifications. - cmd_init_reinit_pre_action - rm -rf "${REFERENCE_CONTAINER_ENVIRONMENT_FILE}".bak > /dev/null 2>&1 - - info "init" " ${CHE_PRODUCT_NAME}_HOST=${CHE_HOST}" - info "init" " ${CHE_PRODUCT_NAME}_VERSION=${CHE_VERSION}" - info "init" " ${CHE_PRODUCT_NAME}_CONFIG=${CHE_HOST_CONFIG}" - info "init" " ${CHE_PRODUCT_NAME}_INSTANCE=${CHE_HOST_INSTANCE}" - if local_repo; then - info "init" " ${CHE_PRODUCT_NAME}_REPO=${CHE_HOST_DEVELOPMENT_REPO}" - fi - if local_repo || local_assembly; then - info "init" " ${CHE_PRODUCT_NAME}_ASSEMBLY=${CHE_ASSEMBLY}" - fi - fi - - # Encode the version that we initialized into the version file - echo "$CHE_VERSION" > "${CHE_CONTAINER_INSTANCE}/${CHE_VERSION_FILE}" -} - -cmd_init_reinit_pre_action() { - - # One time only, set the value of CHE_HOST within the environment file. - sed -i'.bak' "s|#${CHE_PRODUCT_NAME}_HOST=.*|${CHE_PRODUCT_NAME}_HOST=${CHE_HOST}|" "${REFERENCE_CONTAINER_ENVIRONMENT_FILE}" - - if [[ ! ${HTTP_PROXY} = "" ]]; then - sed -i'.bak' "s|#${CHE_PRODUCT_NAME}_HTTP_PROXY=.*|${CHE_PRODUCT_NAME}_HTTP_PROXY=${HTTP_PROXY}|" "${REFERENCE_CONTAINER_ENVIRONMENT_FILE}" - sed -i'.bak' "s|#${CHE_PRODUCT_NAME}_WORKSPACE_HTTP__PROXY=.*|${CHE_PRODUCT_NAME}_WORKSPACE_HTTP__PROXY=${HTTP_PROXY}|" "${REFERENCE_CONTAINER_ENVIRONMENT_FILE}" - fi - if [[ ! ${HTTPS_PROXY} = "" ]]; then - sed -i'.bak' "s|#${CHE_PRODUCT_NAME}_HTTPS_PROXY=.*|${CHE_PRODUCT_NAME}_HTTPS_PROXY=${HTTPS_PROXY}|" "${REFERENCE_CONTAINER_ENVIRONMENT_FILE}" - sed -i'.bak' "s|#${CHE_PRODUCT_NAME}_WORKSPACE_HTTPS__PROXY=.*|${CHE_PRODUCT_NAME}_WORKSPACE_HTTPS__PROXY=${HTTPS_PROXY}|" "${REFERENCE_CONTAINER_ENVIRONMENT_FILE}" - fi - if [[ ! ${HTTP_PROXY} = "" ]] || - [[ ! ${HTTPS_PROXY} = "" ]]; then - sed -i'.bak' "s|#${CHE_PRODUCT_NAME}_NO_PROXY=.*|${CHE_PRODUCT_NAME}_NO_PROXY=${NO_PROXY:-localhost},${CHE_HOST}|" "${REFERENCE_CONTAINER_ENVIRONMENT_FILE}" - sed -i'.bak' "s|#${CHE_PRODUCT_NAME}_WORKSPACE_NO__PROXY=.*|${CHE_PRODUCT_NAME}_WORKSPACE_NO__PROXY=che-host,${NO_PROXY:-localhost},${CHE_HOST}|" "${REFERENCE_CONTAINER_ENVIRONMENT_FILE}" - fi -} - -require_license() { - if [[ "${CHE_LICENSE}" = "true" ]]; then - return 0 - else - return 1 - fi -} diff --git a/dockerfiles/base/scripts/base/commands/cmd_offline.sh b/dockerfiles/base/scripts/base/commands/cmd_offline.sh deleted file mode 100644 index 95fe00d38d97..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_offline.sh +++ /dev/null @@ -1,155 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -help_cmd_offline() { - text "\n" - text "USAGE: ${CHE_IMAGE_FULLNAME} offline [PARAMETERS]\n" - text "\n" - text "Downloads and saves Docker images required to run ${CHE_MINI_PRODUCT_NAME} offline. Add the -'--offline' global parameter command to execute ${CHE_MINI_PRODUCT_NAME} in offline mode. You can optionally -download stack images used to start workspaces. Stack images are heavy and often larger than 1GB. You -can save them all or selectively choose stacks.\n" - text "\n" - text "PARAMETERS:\n" - text " --all-stacks Saves all stack images\n" - text " --list Lists all images that will be downloaded and saved\n" - text " --image: Downloads specific stack image\n" - text " --no-stacks Do not save any stack images\n" - text "\n" -} - - -pre_cmd_offline() { - : -} - -post_cmd_offline() { - : -} - -cmd_offline() { - # Read in optional stack images - readarray -t STACK_IMAGE_LIST < /version/$CHE_VERSION/images-stacks - BOOTSTRAP_IMAGE_LIST=$(cat /version/$CHE_VERSION/images-bootstrap) - UTILITY_IMAGE_LIST=$(cat /version/$CHE_VERSION/images-utilities) - - # List all images to be saved - if [[ $# -gt 0 ]] && [[ $1 = "--list" ]]; then - # First display mandatory - info "offline" "Listing images to save for offline usage" - info "" - info "offline" "Always:" - info "offline" " CLI: ${CHE_IMAGE_FULLNAME}" - - IFS=$'\n' - for SINGLE_IMAGE in $BOOTSTRAP_IMAGE_LIST; do - IMAGE_NAME=$(echo $SINGLE_IMAGE | cut -d'=' -f2) - info "offline" " BOOTSTRAP: ${IMAGE_NAME}" - done - - IFS=$'\n' - for SINGLE_IMAGE in $IMAGE_LIST; do - IMAGE_NAME=$(echo $SINGLE_IMAGE | cut -d'=' -f2) - info "offline" " SYSTEM: ${IMAGE_NAME}" - done - - IFS=$'\n' - for SINGLE_IMAGE in $UTILITY_IMAGE_LIST; do - IMAGE_NAME=$(echo $SINGLE_IMAGE | cut -d'=' -f2) - info "offline" " UTILITY: ${IMAGE_NAME}" - done - - info "" - info "offline" "Optional: (repeat --image: for stack, --all-stacks, or --no-stacks)" - for STACK in $(seq 0 $((${#STACK_IMAGE_LIST[@]}-1))) - do - if [ ! -z ${STACK_IMAGE_LIST[$STACK]} ]; then - info "offline" " STACK: ${STACK_IMAGE_LIST[$STACK]}" - fi - done - - return 1 - fi - - # Make sure the images have been pulled and are in your local Docker registry - cmd_lifecycle download - - mkdir -p $CHE_CONTAINER_OFFLINE_FOLDER - - info "offline" "Saving ${CHE_MINI_PRODUCT_NAME} cli image..." - save_image ${CHE_IMAGE_FULLNAME} - - info "offline" "Saving ${CHE_MINI_PRODUCT_NAME} bootstrap images..." - IFS=$'\n' - for SINGLE_IMAGE in ${BOOTSTRAP_IMAGE_LIST}; do - IMAGE_NAME=$(echo $SINGLE_IMAGE | cut -d'=' -f2) - save_image $IMAGE_NAME - done - - info "offline" "Saving ${CHE_MINI_PRODUCT_NAME} system images..." - for SINGLE_IMAGE in $IMAGE_LIST; do - IMAGE_NAME=$(echo $SINGLE_IMAGE | cut -d'=' -f2) - save_image $IMAGE_NAME - done - - info "offline" "Saving utility images..." - for SINGLE_IMAGE in ${UTILITY_IMAGE_LIST}; do - IMAGE_NAME=$(echo $SINGLE_IMAGE | cut -d'=' -f2) - save_image $IMAGE_NAME - done - - info "offline" "Saving ${CHE_MINI_PRODUCT_NAME} stack images..." - STACK_SAVE="--no-stacks" - while [ $# -gt 0 ]; do - case $1 in - --all-stacks) - for STACK in $(seq 0 $((${#STACK_IMAGE_LIST[@]}-1))) - do - if [ ! -z ${STACK_IMAGE_LIST[$STACK]} ]; then - download_and_save_image ${STACK_IMAGE_LIST[$STACK]} - fi - done - break - shift ;; - --no-stacks) - info "offline" "--no-stacks indicated...skipping" - break - shift ;; - --image:*|-i:*) - download_and_save_image "${1#*:}" - shift ;; - *) error "Unknown parameter: $1" ; return 2 ;; - esac - done - - info "offline" "Done!" -} - -download_and_save_image() { - update_image_if_not_found ${1} - save_image ${1} -} - -save_image(){ - TAR_NAME=$(echo $1 | sed "s|\/|_|g") - - if [ ! -f $CHE_CONTAINER_OFFLINE_FOLDER/$TAR_NAME.tar ]; then - info "offline" "Saving $CHE_HOST_OFFLINE_FOLDER/$TAR_NAME.tar..." - if ! $(docker save $1 > $CHE_CONTAINER_OFFLINE_FOLDER/$TAR_NAME.tar); then - error "Docker was interrupted while saving $CHE_CONTAINER_OFFLINE_FOLDER/$TAR_NAME.tar" - return 1; - fi - else - info "offline" " Image $1 already saved...skipping" - fi -} \ No newline at end of file diff --git a/dockerfiles/base/scripts/base/commands/cmd_restart.sh b/dockerfiles/base/scripts/base/commands/cmd_restart.sh deleted file mode 100644 index 3229ac5dc14b..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_restart.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -help_cmd_restart() { - text "\n" - text "USAGE: ${CHE_IMAGE_FULLNAME} restart [PARAMETERS]\n" - text "\n" - text "Stops ${CHE_MINI_PRODUCT_NAME} and starts again\n" - text "\n" - text "PARAMETERS:\n" - text " --force Uses 'docker rmi' and 'docker pull' to forcibly retrieve latest images\n" - text " --no-force Updates images if matching tag not found in local cache\n" - text " --pull Uses 'docker pull' to check for new remote versions of images\n" - text " --skip:config Skip re-generation of config files placed into /instance\n" - text " --skip:graceful Do not wait for confirmation that workspaces have stopped\n" - text " --skip:preflight Skip preflight checks\n" - text " --skip:postflight Skip postflight checks\n" - text "\n" -} - -pre_cmd_restart() { - : -} - -post_cmd_restart() { - : -} - -cmd_restart() { - - info "restart" "Restarting..." - cmd_lifecycle stop ${@} - - # Need to remove any stop parameters from the command line otherwise the start will fail - set -- "${@/\-\-skip\:graceful/}" - - cmd_lifecycle start "${@}" -} diff --git a/dockerfiles/base/scripts/base/commands/cmd_restore.sh b/dockerfiles/base/scripts/base/commands/cmd_restore.sh deleted file mode 100644 index d5743e7425cb..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_restore.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -help_cmd_restore() { - text "\n" - text "USAGE: ${CHE_IMAGE_FULLNAME} restore\n" - text "\n" - text "Restores user data and recovers a ${CHE_MINI_PRODUCT_NAME} configuration\n" - text "\n" -} - -pre_cmd_restore() { - : -} - -post_cmd_restore() { - : -} - -cmd_restore_pre_action() { - true -} - -cmd_restore_extra_args() { - echo "" -} - -cmd_restore() { - debug $FUNCNAME - - if [[ -d "${CHE_CONTAINER_CONFIG}" ]]; then - WARNING="Restoration overwrites existing configuration and data. Are you sure?" - if ! confirm_operation "${WARNING}" "$@"; then - return; - fi - fi - - if get_server_container_id "${CHE_SERVER_CONTAINER_NAME}" >> "${LOGS}" 2>&1; then - error "${CHE_FORMAL_PRODUCT_NAME} is running. Stop before performing a restore." - return; - fi - - if [[ ! -f "${CHE_CONTAINER_BACKUP}/${CHE_BACKUP_FILE_NAME}" ]]; then - error "Backup files not found. To do restore please do backup first." - return; - fi - - # remove config and instance folders - log "docker_run -v \"${CHE_HOST_CONFIG}\":${CHE_CONTAINER_ROOT} \ - ${BOOTSTRAP_IMAGE_ALPINE} sh -c \"rm -rf /root${CHE_CONTAINER_ROOT}/docs \ - ; rm -rf /root${CHE_CONTAINER_ROOT}/instance \ - ; rm -rf /root${CHE_CONTAINER_ROOT}/${CHE_MINI_PRODUCT_NAME}.env\"" - docker_run -v "${CHE_HOST_CONFIG}":/root${CHE_CONTAINER_ROOT} \ - ${BOOTSTRAP_IMAGE_ALPINE} sh -c "rm -rf /root${CHE_CONTAINER_ROOT}/docs \ - ; rm -rf /root${CHE_CONTAINER_ROOT}/instance \ - ; rm -rf /root${CHE_CONTAINER_ROOT}/${CHE_MINI_PRODUCT_NAME}.env" - - info "restore" "Recovering ${CHE_FORMAL_PRODUCT_NAME} data..." - - cmd_restore_pre_action - - docker_run -v "${CHE_HOST_CONFIG}":/root${CHE_CONTAINER_ROOT} \ - -v "${CHE_HOST_BACKUP}/${CHE_BACKUP_FILE_NAME}":"/root/backup/${CHE_BACKUP_FILE_NAME}" \ - $(cmd_restore_extra_args) \ - ${BOOTSTRAP_IMAGE_ALPINE} sh -c "tar xf /root/backup/${CHE_BACKUP_FILE_NAME} -C /root${CHE_CONTAINER_ROOT}" -} diff --git a/dockerfiles/base/scripts/base/commands/cmd_rmi.sh b/dockerfiles/base/scripts/base/commands/cmd_rmi.sh deleted file mode 100644 index 998a63d12928..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_rmi.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -help_cmd_rmi() { - text "\n" - text "USAGE: ${CHE_IMAGE_FULLNAME} rmi\n" - text "\n" - text "Removes bootstrap, utility, and system Docker images used to run ${CHE_MINI_PRODUCT_NAME}\n" - text "\n" -} - -pre_cmd_rmi() { - : -} - -post_cmd_rmi() { - : -} - -cmd_rmi() { - info "rmi" "Checking registry for version '$CHE_VERSION' images" - if ! has_version_registry $CHE_VERSION; then - version_error $CHE_VERSION - return 1; - fi - - WARNING="rmi !!! Removing images disables ${CHE_FORMAL_PRODUCT_NAME} and forces a pull !!!" - if ! confirm_operation "${WARNING}" "$@"; then - return; - fi - - IMAGE_LIST=$(cat "$CHE_MANIFEST_DIR"/$CHE_VERSION/images) - IMAGE_LIST+=$'\n'${BOOTSTRAP_IMAGE_LIST} - IMAGE_LIST+=$'\n'${UTILITY_IMAGE_LIST} - - IFS=$'\n' - info "rmi" "Removing ${CHE_MINI_PRODUCT_NAME} Docker images..." - - for SINGLE_IMAGE in $IMAGE_LIST; do - VALUE_IMAGE=$(echo $SINGLE_IMAGE | cut -d'=' -f2) - info "rmi" "Removing $VALUE_IMAGE..." - log "docker rmi -f ${VALUE_IMAGE} >> \"${LOGS}\" 2>&1 || true" - docker rmi -f $VALUE_IMAGE >> "${LOGS}" 2>&1 || true - done -} diff --git a/dockerfiles/base/scripts/base/commands/cmd_ssh.sh b/dockerfiles/base/scripts/base/commands/cmd_ssh.sh deleted file mode 100644 index 0bf7558ef6da..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_ssh.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -help_cmd_ssh() { - text "\n" - text "USAGE: ${CHE_IMAGE_FULLNAME} ssh WORKSPACE [MACHINE] [PARAMETERS]\n" - text "\n" - text "Connect to a workspace in ${CHE_MINI_PRODUCT_NAME} over SSH\n" - text "\n" - text "WORKSPACE: Accepts workspace name, ID, or namespace:ws-name\n" - text " List all workspaces with 'action list-workspaces'\n" - text "\n" - text "MACHINE: Choose machine (default is dev machine) if workspace as multiple containers\n" - text "\n" - text "PARAMETERS:\n" - text " --url Location of ${CHE_MINI_PRODUCT_NAME}\n" - text " --user User name of ${CHE_MINI_PRODUCT_NAME} if accessing authenticated system\n" - text " --password Password of ${CHE_MINI_PRODUCT_NAME} if accessing authenticated system\n" -} - -pre_cmd_ssh() { - : -} - -post_cmd_ssh() { - : -} - -cmd_ssh() { - cmd_lifecycle action "workspace-ssh" "$@" -} diff --git a/dockerfiles/base/scripts/base/commands/cmd_start.sh b/dockerfiles/base/scripts/base/commands/cmd_start.sh deleted file mode 100644 index 57d527e589b1..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_start.sh +++ /dev/null @@ -1,325 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -help_cmd_start() { - text "\n" - text "USAGE: ${CHE_IMAGE_FULLNAME} start [PARAMETERS]\n" - text "\n" - text "Starts ${CHE_MINI_PRODUCT_NAME} and verifies its operation\n" - text "\n" - text "PARAMETERS:\n" - text " --follow Displays server logs to console and blocks until user interrupts\n" - text " --force Uses 'docker rmi' and 'docker pull' to forcibly retrieve latest images\n" - text " --no-force Updates images if matching tag not found in local cache\n" - text " --pull Uses 'docker pull' to check for new remote versions of images\n" - text " --skip:config Skip re-generation of config files placed into /instance\n" - text " --skip:preflight Skip preflight checks\n" - text " --skip:postflight Skip postflight checks\n" - text "\n" -} - -pre_cmd_start() { - CHE_SKIP_CONFIG=false - CHE_SKIP_PREFLIGHT=false - CHE_SKIP_POSTFLIGHT=false - CHE_FOLLOW_LOGS=false - FORCE_UPDATE="--no-force" - - while [ $# -gt 0 ]; do - case $1 in - --skip:config) - CHE_SKIP_CONFIG=true - shift ;; - --skip:preflight) - CHE_SKIP_PREFLIGHT=true - shift ;; - --skip:postflight) - CHE_SKIP_POSTFLIGHT=true - shift ;; - --follow) - CHE_FOLLOW_LOGS=true - shift ;; - --force) - FORCE_UPDATE="--force" - shift ;; - --no-force) - FORCE_UPDATE="--no-force" - shift ;; - --pull) - FORCE_UPDATE="--pull" - shift ;; - *) - shift ;; - esac - done -} - -post_cmd_start() { - : -} - - -cmd_start() { - # If already running, just display output again - check_if_booted - - if server_is_booted $(get_server_container_id $CHE_CONTAINER_NAME); then - return 1 - fi - - # Always regenerate puppet configuration from environment variable source, whether changed or not. - # If the current directory is not configured with an .env file, it will initialize - if skip_config; then - cmd_lifecycle config $FORCE_UPDATE --skip:config - else - cmd_lifecycle config $FORCE_UPDATE - fi - - # Preflight checks - # a) Check for open ports - # b) Test simulated connections for failures - if ! is_fast && ! skip_preflight; then - info "start" "Preflight checks" - cmd_start_check_preflight - text "\n" - fi - - # Start ${CHE_FORMAL_PRODUCT_NAME} - # Note bug in docker requires relative path, not absolute path to compose file - info "start" "Starting containers..." - COMPOSE_UP_COMMAND="docker_compose --file=\"${REFERENCE_CONTAINER_COMPOSE_FILE}\" -p=\"${CHE_COMPOSE_PROJECT_NAME}\" up -d" - - ## validate the compose file (quiet mode) - if local_repo; then - docker_compose --file=${REFERENCE_CONTAINER_COMPOSE_FILE} config -q || (error "Invalid docker compose file content at ${REFERENCE_CONTAINER_COMPOSE_FILE}" && return 2) - fi - - if ! debug_server; then - COMPOSE_UP_COMMAND+=" >> \"${LOGS}\" 2>&1" - fi - - log ${COMPOSE_UP_COMMAND} - eval ${COMPOSE_UP_COMMAND} || (error "Error during 'compose up' - printing 30 line tail of ${CHE_HOST_CONFIG}/cli.log:" && tail -30 ${LOGS} && return 2) - - wait_until_booted - - if ! server_is_booted $(get_server_container_id $CHE_CONTAINER_NAME); then - error "(${CHE_MINI_PRODUCT_NAME} start): Timeout waiting for server. Run \"docker logs ${CHE_CONTAINER_NAME}\" to inspect." - return 2 - fi - - if ! is_fast && ! skip_postflight; then - cmd_start_check_postflight - fi - - check_if_booted -} - -cmd_start_check_host_resources() { - HOST_RAM=$(docker info | grep "Total Memory:") - HOST_RAM=$(echo ${HOST_RAM#*:} | xargs) - HOST_RAM=${HOST_RAM% *} - - PREFLIGHT="" - if less_than_numerically $CHE_MIN_RAM $HOST_RAM; then - text " mem ($CHE_MIN_RAM GiB): ${GREEN}[OK]${NC}\n" - else - text " mem ($CHE_MIN_RAM GiB): ${RED}[NOT OK]${NC}\n" - PREFLIGHT="fail" - fi - - HOST_DISK=$(df "${CHE_CONTAINER_ROOT}" | grep "${CHE_CONTAINER_ROOT}" | awk '{ print $4}') - - if less_than_numerically "$CHE_MIN_DISK"000 $HOST_DISK; then - text " disk ($CHE_MIN_DISK MB): ${GREEN}[OK]${NC}\n" - else - text " disk ($CHE_MIN_DISK MB): ${RED}[NOT OK]${NC}\n" - PREFLIGHT="fail" - fi - - if [[ "${PREFLIGHT}" = "fail" ]]; then - text "\n" - error "${CHE_MINI_PRODUCT_NAME} requires more RAM or disk to guarantee workspaces can start." - return 2; - fi -} - -cmd_start_check_ports() { - # Develop array of port #, description. - # Format of array is ";" where the is the text to appear in console - local PORT_ARRAY=( - "${CHE_PORT};port ${CHE_PORT} (http): " - ) - - # If dev mode is on, then we also need to check the debug port set by the user for availability - if debug_server; then - USER_DEBUG_PORT=$(get_value_of_var_from_env_file ${CHE_PRODUCT_NAME}_DEBUG_PORT) - - if [[ "$USER_DEBUG_PORT" = "" ]]; then - # If the user has not set a debug port, then use the default - CHE_LOCAL_DEBUG_PORT=8000 - else - # Otherwise, this is the value set by the user - CHE_LOCAL_DEBUG_PORT=$USER_DEBUG_PORT - fi - - PORT_ARRAY+=("$CHE_LOCAL_DEBUG_PORT;port ${CHE_LOCAL_DEBUG_PORT} (debug): ") - fi - - if check_all_ports "${PORT_ARRAY[@]}"; then - print_ports_as_ok "${PORT_ARRAY[@]}" - else - find_and_print_ports_as_notok "${PORT_ARRAY[@]}" - fi -} - -# See cmd_network.sh for utilities for unning these tests -cmd_start_check_agent_network() { - start_test_server - - PREFLIGHT="success" - if test1 || test2; then - text " conn (browser => ws): ${GREEN}[OK]${NC}\n" - else - text " conn (browser => ws): ${RED}[NOT OK]${NC}\n" - PREFLIGHT="fail" - fi - - if test3 && test4; then - text " conn (server => ws): ${GREEN}[OK]${NC}\n" - else - text " conn (server => ws): ${RED}[NOT OK]${NC}\n\n" - PREFLIGHT="fail" - fi - - stop_test_server - - if [[ "${PREFLIGHT}" = "fail" ]]; then - text "\n" - error "Try 'docker run ${CHE_IMAGE_FULLNAME} info --network' for more tests." - return 2; - fi -} - -cmd_start_check_preflight() { - cmd_start_check_host_resources - cmd_start_check_ports - cmd_start_check_agent_network -} - -cmd_start_check_postflight() { - true -} - -wait_until_booted() { - CURRENT_CHE_SERVER_CONTAINER_ID=$(get_server_container_id $CHE_CONTAINER_NAME) - - wait_until_container_is_running 20 ${CURRENT_CHE_SERVER_CONTAINER_ID} - if ! container_is_running ${CURRENT_CHE_SERVER_CONTAINER_ID}; then - error "(${CHE_MINI_PRODUCT_NAME} start): Timeout waiting for ${CHE_MINI_PRODUCT_NAME} container to start." - return 2 - fi - - info "start" "Services booting..." - - # CHE-3546 - if in development mode, then display the che server logs to STDOUT - # automatically kill the streaming of the log output when the server is booted - if debug_server || follow_logs; then - DOCKER_LOGS_COMMAND="docker logs -f ${CHE_CONTAINER_NAME}" - - if debug_server; then - DOCKER_LOGS_COMMAND+=" &" - fi - - eval $DOCKER_LOGS_COMMAND - LOG_PID=$! - else - info "start" "Server logs at \"docker logs -f ${CHE_CONTAINER_NAME}\"" - fi - - check_containers_are_running - wait_until_server_is_booted 60 ${CURRENT_CHE_SERVER_CONTAINER_ID} - check_containers_are_running - - if debug_server; then - kill $LOG_PID > /dev/null 2>&1 - info "" - fi -} - -check_if_booted() { - if container_exist_by_name $CHE_CONTAINER_NAME; then - local CURRENT_CHE_SERVER_CONTAINER_ID=$(get_server_container_id $CHE_CONTAINER_NAME) - if server_is_booted $CURRENT_CHE_SERVER_CONTAINER_ID; then - DISPLAY_URL=$(get_display_url) - info "start" "Booted and reachable" - info "start" "Ver: $(get_installed_version)" - info "start" "Use: ${DISPLAY_URL}" - info "start" "API: ${DISPLAY_URL}/swagger" - if debug_server; then - DISPLAY_DEBUG_URL=$(get_debug_display_url) - info "start" "Debug: ${DISPLAY_DEBUG_URL}" - fi - fi - fi -} - -check_containers_are_running() { - # get list of docker compose services started by this docker compose - local LIST_OF_COMPOSE_CONTAINERS=$(docker_compose --file=${REFERENCE_CONTAINER_COMPOSE_FILE} -p=$CHE_COMPOSE_PROJECT_NAME config --services) - - # For each service of docker-compose file, get container and then check it is running - while IFS= read -r DOCKER_COMPOSE_SERVICE_NAME ; do - local CONTAINER_ID_MATCHING_SERVICE_NAMES=$(docker ps -q --filter label=com.docker.compose.service=${DOCKER_COMPOSE_SERVICE_NAME}) - if [[ -z "${CONTAINER_ID_MATCHING_SERVICE_NAMES}" ]]; then - error "Unable to find a matching container for the docker compose service named ${DOCKER_COMPOSE_SERVICE_NAME}. Check logs at ${CHE_HOST_CONFIG}/cli.log" - return 2 - fi - - while IFS='\n' read -r CONTAINER_ID_MATCHING_SERVICE_NAME ; do - debug "Container with id ${CONTAINER_ID_MATCHING_SERVICE_NAME} is matching ${DOCKER_COMPOSE_SERVICE_NAME} service" - local IS_RUNNING_CONTAINER=$(docker inspect -f {{.State.Running}} ${CONTAINER_ID_MATCHING_SERVICE_NAME}) - debug "Running state of container ${CONTAINER_ID_MATCHING_SERVICE_NAME} is ${IS_RUNNING_CONTAINER}" - - if [[ ${IS_RUNNING_CONTAINER} != "true" ]]; then - error "The container with ID ${CONTAINER_ID_MATCHING_SERVICE_NAME} of docker-compose service ${DOCKER_COMPOSE_SERVICE_NAME} is not running, aborting." - docker inspect ${CONTAINER_ID_MATCHING_SERVICE_NAME} - return 2 - fi - done <<< "${CONTAINER_ID_MATCHING_SERVICE_NAMES}" - done <<< "${LIST_OF_COMPOSE_CONTAINERS}" -} - -skip_preflight() { - if [ "${CHE_SKIP_PREFLIGHT}" = "true" ]; then - return 0 - else - return 1 - fi -} - -skip_postflight() { - if [ "${CHE_SKIP_POSTFLIGHT}" = "true" ]; then - return 0 - else - return 1 - fi -} - -follow_logs() { - if [ "${CHE_FOLLOW_LOGS}" = "true" ]; then - return 0 - else - return 1 - fi -} diff --git a/dockerfiles/base/scripts/base/commands/cmd_stop.sh b/dockerfiles/base/scripts/base/commands/cmd_stop.sh deleted file mode 100644 index 46a3336c963a..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_stop.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -help_cmd_stop() { - text "\n" - text "USAGE: ${CHE_IMAGE_FULLNAME} restart [PARAMETERS]\n" - text "\n" - text "Stops ${CHE_MINI_PRODUCT_NAME} workspaces gracefully and then the server\n" - text "\n" - text "PARAMETERS:\n" - text " --skip:graceful Do not wait for confirmation that workspaces have stopped\n" - text " --user Admin user name for authenticated Che systems\n" - text " --password Admin password for authenticated Che systems\n" - text "\n" -} - -pre_cmd_stop() { - : -} - -post_cmd_stop() { - : -} - -cmd_stop() { - debug $FUNCNAME - FORCE_STOP=false - if [[ "$@" == *"--skip:graceful"* ]]; then - FORCE_STOP=true - elif local_repo || local_assembly; then - FORCE_STOP=true - fi - - if server_is_booted $(get_server_container_id $CHE_CONTAINER_NAME); then - if [[ ${FORCE_STOP} = "false" ]]; then - info "stop" "Stopping workspaces..." - local GRACEFUL_STATUS_RESULT=0 - cmd_lifecycle action "graceful-stop" "$@" >> "${LOGS}" 2>&1 || GRACEFUL_STATUS_RESULT=$? - # error on authentication (401 modulo 256 = 145) - if [[ ${GRACEFUL_STATUS_RESULT} -eq 145 ]]; then - error "Authentication failed (hint: --user/--password for auth, --skip:graceful bypasses workspace stop)" - return 2; - elif [[ ${GRACEFUL_STATUS_RESULT} -ne 0 ]]; then - error "Error during graceful stop - see $CHE_HOST_CONFIG/cli.log. (hint: --skip:graceful bypasses workspace stop)" - return 2; - fi - fi - # stop containers booted by docker compose - stop_containers - else - info "stop" "Server $CHE_CONTAINER_NAME on port $CHE_PORT not running..." - fi -} - -# stop containers booted by docker compose and remove them -stop_containers() { - info "stop" "Stopping containers..." - if is_initialized; then - log "docker_compose --file=\"${REFERENCE_CONTAINER_COMPOSE_FILE}\" -p=$CHE_COMPOSE_PROJECT_NAME stop -t ${CHE_COMPOSE_STOP_TIMEOUT} >> \"${LOGS}\" 2>&1 || true" - docker_compose --file="${REFERENCE_CONTAINER_COMPOSE_FILE}" \ - -p=$CHE_COMPOSE_PROJECT_NAME stop -t ${CHE_COMPOSE_STOP_TIMEOUT} >> "${LOGS}" 2>&1 || true - info "stop" "Removing containers..." - log "docker_compose --file=\"${REFERENCE_CONTAINER_COMPOSE_FILE}\" -p=$CHE_COMPOSE_PROJECT_NAME rm -v --force >> \"${LOGS}\" 2>&1 || true" - docker_compose --file="${REFERENCE_CONTAINER_COMPOSE_FILE}" \ - -p=$CHE_COMPOSE_PROJECT_NAME rm -v --force >> "${LOGS}" 2>&1 || true - fi -} diff --git a/dockerfiles/base/scripts/base/commands/cmd_sync.sh b/dockerfiles/base/scripts/base/commands/cmd_sync.sh deleted file mode 100644 index f04da2ac838f..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_sync.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -help_cmd_sync() { - text "\n" - text "USAGE: ${CHE_IMAGE_FULLNAME} sync WORKSPACE [PARAMETERS]\n" - text "\n" - text "Synchronizes a ${CHE_MINI_PRODUCT_NAME} workspace to a local path mounted to ':/sync'\n" - text "\n" - text "WORKSPACE: Accepts workspace name, ID, or namespace:ws-name\n" - text " List all workspaces with 'action list-workspaces'\n" - text "\n" - text "PARAMETERS:\n" - text " --url Location of ${CHE_MINI_PRODUCT_NAME}\n" - text " --user User name of ${CHE_MINI_PRODUCT_NAME} if accessing authenticated system\n" - text " --password Password of ${CHE_MINI_PRODUCT_NAME} if accessing authenticated system\n" - text " --unison-verbose Verbose output of unison sync\n" -} - -pre_cmd_sync() { - # Not loaded as part of the init process to save on download time - load_utilities_images_if_not_done -} - -post_cmd_sync() { - : -} - -cmd_sync() { - if [[ "${SYNC_MOUNT}" = "not set" ]]; then - info "Welcome to $CHE_FORMAL_PRODUCT_NAME!" - info "" - info "We could not detect a location to do the sync." - info "Volume mount a local directory to ':/sync'." - info "" - info " docker run ... -v :/sync ..." - return 2; - fi - - # Determine the mount path to do the mount - info "mount" "Starting sync process to ${SYNC_MOUNT}" - -# grab docker run options to enable tty -DOCKER_RUN_OPTIONS=$(get_docker_run_terminal_options) - - docker_run ${DOCKER_RUN_OPTIONS} \ - --cap-add SYS_ADMIN \ - --device /dev/fuse \ - --security-opt apparmor:unconfined \ - -e CHE_VERSION=${CHE_VERSION} \ - --name che-mount \ - -v "${SYNC_MOUNT}":/mnthost \ - ${UTILITY_IMAGE_CHEMOUNT} $* - - # Docker doesn't seem to normally clean up this container - docker rm -f che-mount -} diff --git a/dockerfiles/base/scripts/base/commands/cmd_test.sh b/dockerfiles/base/scripts/base/commands/cmd_test.sh deleted file mode 100644 index 01d762176159..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_test.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# - -help_cmd_test() { - text "\n" - text "USAGE: ${CHE_IMAGE_FULLNAME} test TEST [PARAMETERS]\n" - text "\n" - text "Synchronizes a ${CHE_MINI_PRODUCT_NAME} workspace to a local path mounted to ':/sync'\n" - text "\n" - text "TESTS:\n" - text " post-flight-check Performs post-flight check to validate ${CHE_MINI_PRODUCT_NAME} install\n" - text "\n" - text "PARAMETERS:\n" - text " --quiet Display not output during test\n" - text " --user User name of ${CHE_MINI_PRODUCT_NAME} if accessing authenticated system\n" - text " --password Password of ${CHE_MINI_PRODUCT_NAME} if accessing authenticated system\n" - text " --port Define an optional port to use for the test\n" -} - -pre_cmd_test() { - # Not loaded as part of the init process to save on download time - load_utilities_images_if_not_done -} - -post_cmd_test() { - : -} - - -cmd_test() { - docker_run $(get_docker_run_terminal_options) ${UTILITY_IMAGE_CHETEST} "$@" -} diff --git a/dockerfiles/base/scripts/base/commands/cmd_upgrade.sh b/dockerfiles/base/scripts/base/commands/cmd_upgrade.sh deleted file mode 100644 index f16c1f0a00ae..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_upgrade.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -help_cmd_upgrade() { - text "\n" - text "USAGE: ${CHE_IMAGE_FULLNAME} upgrade [PARAMETERS]\n" - text "\n" - text "Upgrades ${CHE_MINI_PRODUCT_NAME} from one version to another while protecting user workspace data" - text "\n" - text "PARAMETERS:\n" - text " --skip-backup Skip backup of user data before performing upgrade\n" -} - -pre_cmd_upgrade() { - : -} - -post_cmd_upgrade() { - : -} - -cmd_upgrade() { - CHE_IMAGE_VERSION=$(get_image_version) - DO_BACKUP="true" - ARGS="" - - for var in $@; do - if [[ "$var" == *"--skip-backup"* ]]; then - DO_BACKUP="false" - continue - fi - ARGS+="$var " - done - - # If we got here, this means: - # image version > configured & installed version - # configured version = installed version - # - # We can now upgrade using the information contained in the CLI image - - ## Download version images - info "upgrade" "Downloading $CHE_MINI_PRODUCT_NAME images for version $CHE_IMAGE_VERSION..." - get_image_manifest $CHE_IMAGE_VERSION - SAVEIFS=$IFS - IFS=$'\n' - for SINGLE_IMAGE in ${IMAGE_LIST}; do - VALUE_IMAGE=$(echo ${SINGLE_IMAGE} | cut -d'=' -f2) - update_image_if_not_found ${VALUE_IMAGE} - done - IFS=$SAVEIFS - info "upgrade" "Downloading done." - - if get_server_container_id "${CHE_SERVER_CONTAINER_NAME}" >> "${LOGS}" 2>&1; then - error "$CHE_MINI_PRODUCT_NAME is running. Stop before performing an upgrade." - return 2; - fi - - if [[ "${DO_BACKUP}" == "true" ]]; then - info "upgrade" "Preparing backup..." - cmd_lifecycle backup - else - info "upgrade" "Skipping backup" - fi - - info "upgrade" "Reinitializing the system with your configuration..." - cmd_lifecycle init --accept-license --reinit - - cmd_lifecycle start ${ARGS} -} diff --git a/dockerfiles/base/scripts/base/commands/cmd_version.sh b/dockerfiles/base/scripts/base/commands/cmd_version.sh deleted file mode 100644 index 7706c830b24f..000000000000 --- a/dockerfiles/base/scripts/base/commands/cmd_version.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -help_cmd_version() { - text "\n" - text "USAGE: ${CHE_IMAGE_FULLNAME} version\n" - text "\n" - text "List installed and available versions of ${CHE_MINI_PRODUCT_NAME}" - text "\n" -} - -pre_cmd_version() { - : -} - -post_cmd_version() { - : -} - -cmd_version() { - # Do not perform any logging in this method as it is runnable before the system is bootstrap - echo "" - text "Your CLI version is '%s'.\n" $(get_image_version) - if is_initialized; then - text "Your installed version is '%s'.\n" $(get_installed_version) - else - text "Your installed version is ''.\n" - fi - - text "\n" - - if is_offline; then - text "Available on DockerHub: offline mode\n" - else - text "Available on DockerHub:\n" - - local VERSION_LIST_JSON=$(curl -s https://hub.docker.com/v2/repositories/${CHE_IMAGE_NAME}/tags/) - local NUMBER_OF_VERSIONS=$(echo $VERSION_LIST_JSON | jq '.count') - - if [[ "${NUMBER_OF_VERSIONS}" = "" ]] || [[ "${NUMBER_OF_VERSIONS}" = "null" ]]; then - warning "Unable to retrieve version list from public Docker Hub for image named ${CHE_IMAGE_NAME}." - warning "Diagnose with 'docker run -it appropriate/curl -s https://hub.docker.com/v2/repositories/${CHE_IMAGE_NAME}/tags/'." - warning "Use '--offline' to ignore this." - return 2 - fi - - DISPLAY_LIMIT=10 - if [ $DISPLAY_LIMIT -gt $NUMBER_OF_VERSIONS ]; then - DISPLAY_LIMIT=$NUMBER_OF_VERSIONS - fi - - COUNTER=0 - while [ $COUNTER -lt $DISPLAY_LIMIT ]; do - TAG=$(echo $VERSION_LIST_JSON | jq ".results[$COUNTER].name") - text " ${TAG//\"}\n" - let COUNTER=COUNTER+1 - done - - if [ $NUMBER_OF_VERSIONS -gt $DISPLAY_LIMIT ]; then - OLDER_VERSION=$(echo $VERSION_LIST_JSON | jq '.next') - text " See older versions at: $OLDER_VERSION\n" - fi - fi -} - diff --git a/dockerfiles/base/scripts/base/library.sh b/dockerfiles/base/scripts/base/library.sh deleted file mode 100644 index 6cc396fedc21..000000000000 --- a/dockerfiles/base/scripts/base/library.sh +++ /dev/null @@ -1,351 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2017 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 -# - -convert_windows_to_posix() { -# debug $FUNCNAME - echo "/"$(echo "$1" | sed 's/\\/\//g' | sed 's/://') -} - -convert_posix_to_windows() { -# debug $FUNCNAME - # Remove leading slash - VALUE="${1:1}" - - # Get first character (drive letter) - VALUE2="${VALUE:0:1}" - - # Replace / with \ - VALUE3=$(echo ${VALUE} | tr '/' '\\' | sed 's/\\/\\\\/g') - - # Replace c\ with c:\ for drive letter - echo "$VALUE3" | sed "s/./$VALUE2:/1" -} - -get_boot_url() { - echo "$CHE_HOST:$CHE_PORT/api/system/state" -} - -get_display_url() { - # If the user has modified che.env with a custom CHE_HOST, we need to detect that here - # and not use the in-memory one which is always set with eclipse/che-ip. - local CHE_HOST_LOCAL=$${CHE_PRODUCT_NAME}_HOST - - if is_initialized; then - CHE_HOST_LOCAL=$(get_value_of_var_from_env_file ${CHE_PRODUCT_NAME}_HOST) - fi - - if ! is_docker_for_mac && ! is_docker_for_windows; then - echo "http://${CHE_HOST_LOCAL}:${CHE_PORT}" - else - echo "http://localhost:${CHE_PORT}" - fi -} - -get_debug_display_url() { - local CHE_DEBUG_PORT_LOCAL=8000 - - if is_initialized; then - DEBUG_PORT_FROM_CONFIG=$(get_value_of_var_from_env_file ${CHE_PRODUCT_NAME}_DEBUG_PORT) - if [[ "${DEBUG_PORT_FROM_CONFIG}" != "" ]]; then - CHE_DEBUG_PORT_LOCAL=$DEBUG_PORT_FROM_CONFIG - fi - fi - - if ! is_docker_for_mac && ! is_docker_for_windows; then - echo "http://${CHE_HOST}:${CHE_DEBUG_PORT_LOCAL}" - else - echo "http://localhost:${CHE_DEBUG_PORT_LOCAL}" - fi -} - -server_is_booted() { - PING_URL=$(get_boot_url) - HTTP_STATUS_CODE=$(curl -I -k ${PING_URL} -s -o /dev/null --write-out '%{http_code}') - log "${HTTP_STATUS_CODE}" - if [[ "${HTTP_STATUS_CODE}" = "200" ]] || [[ "${HTTP_STATUS_CODE}" = "302" ]]; then - return 0 - else - return 1 - fi -} - -has_env_variables() { - PROPERTIES=$(env | grep "${CHE_PRODUCT_NAME}_") - - if [ "$PROPERTIES" = "" ]; then - return 1 - else - return 0 - fi -} - - -### check if all utilities images are loaded and update them if not found -load_utilities_images_if_not_done() { - IFS=$'\n' - for UTILITY_IMAGE_LINE in ${UTILITY_IMAGE_LIST}; do - local UTILITY_IMAGE=$(echo ${UTILITY_IMAGE_LINE} | cut -d'=' -f2) - update_image_if_not_found ${UTILITY_IMAGE} - done - -} - -update_image_if_not_found() { - local CHECKING_TEXT="${GREEN}INFO:${NC} (${CHE_MINI_PRODUCT_NAME} download): Checking for image '$1'..." - CURRENT_IMAGE=$(docker images -q "$1") - if [ "${CURRENT_IMAGE}" == "" ]; then - text "${CHECKING_TEXT} not found\n" - update_image $1 - else - log "${CHECKING_TEXT} found" - fi -} - -# Usage: -# confirm_operation [--force|--no-force] -confirm_operation() { - FORCE_OPERATION=${2:-"--no-force"} - - if [ ! "${FORCE_OPERATION}" == "--quiet" ]; then - # Warn user with passed message - info "${1}" - text "\n" - read -p " Are you sure? [N/y] " -n 1 -r - text "\n\n" - if [[ ! $REPLY =~ ^[Yy]$ ]]; then - return 1; - else - return 0; - fi - fi -} - -port_open() { - docker run -d -p $1:$1 --name fake ${BOOTSTRAP_IMAGE_ALPINE} httpd -f -p $1 -h /etc/ > /dev/null 2>&1 - NETSTAT_EXIT=$? - docker rm -f fake > /dev/null 2>&1 - - if [ $NETSTAT_EXIT = 125 ]; then - return 1 - else - return 0 - fi -} - -server_is_booted_extra_check() { - true -} - -wait_until_server_is_booted() { - SERVER_BOOT_TIMEOUT=${1} - - ELAPSED=0 - until server_is_booted ${2} || [ ${ELAPSED} -eq "${SERVER_BOOT_TIMEOUT}" ]; do - log "sleep 2" - sleep 2 - server_is_booted_extra_check - ELAPSED=$((ELAPSED+1)) - done -} - -less_than_numerically() { - COMPARE=$(awk "BEGIN { print ($1 < $2) ? 0 : 1}") - return $COMPARE -} - -# Input - an array of ports and port descriptions to check -# Output - true if all ports are open, false if any of them are already bound -check_all_ports(){ - - declare -a PORT_INTERNAL_ARRAY=("${@}") - - DOCKER_PORT_STRING="" - HTTPD_PORT_STRING="" - for index in "${!PORT_INTERNAL_ARRAY[@]}"; do - PORT=${PORT_INTERNAL_ARRAY[$index]%;*} - PORT_STRING=${PORT_INTERNAL_ARRAY[$index]#*;} - - DOCKER_PORT_STRING+=" -p $PORT:$PORT" - HTTPD_PORT_STRING+=" -p $PORT" - done - - EXECUTION_STRING="docker run --rm ${DOCKER_PORT_STRING} ${BOOTSTRAP_IMAGE_ALPINE} \ - sh -c \"echo hi\" > /dev/null 2>&1" - eval ${EXECUTION_STRING} - NETSTAT_EXIT=$? - - if [[ $NETSTAT_EXIT = 125 ]]; then - return 1 - else - return 0 - fi -} - -print_ports_as_ok() { - declare -a PORT_INTERNAL_ARRAY=("${@}") - - for index in "${!PORT_INTERNAL_ARRAY[@]}"; do - PORT_STRING=${PORT_INTERNAL_ARRAY[$index]#*;} - text " $PORT_STRING ${GREEN}[AVAILABLE]${NC}\n" - done -} - -find_and_print_ports_as_notok() { - declare -a PORT_INTERNAL_ARRAY=("${@}") - - for index in "${!PORT_INTERNAL_ARRAY[@]}"; do - PORT=${PORT_INTERNAL_ARRAY[$index]%;*} - PORT_STRING=${PORT_INTERNAL_ARRAY[$index]#*;} - text " ${PORT_STRING} $(port_open ${PORT} && echo "${GREEN}[AVAILABLE]${NC}" || echo "${RED}[ALREADY IN USE]${NC}") \n" - done - - echo "" - error "Ports required to run $CHE_MINI_PRODUCT_NAME are used by another program." - return 2; -} - -container_exist_by_name(){ - docker inspect ${1} > /dev/null 2>&1 - if [ "$?" == "0" ]; then - return 0 - else - return 1 - fi -} - -get_server_container_id() { - log "docker inspect -f '{{.Id}}' ${1}" - docker inspect -f '{{.Id}}' ${1} 2>&1 || false -} - -container_is_running() { - if [ "$(docker ps -qa -f "status=running" -f "id=${1}" | wc -l)" -eq 0 ]; then - return 1 - else - return 0 - fi -} - -wait_until_container_is_running() { - CONTAINER_START_TIMEOUT=${1} - - ELAPSED=0 - until container_is_running ${2} || [ ${ELAPSED} -eq "${CONTAINER_START_TIMEOUT}" ]; do - log "sleep 1" - sleep 1 - ELAPSED=$((ELAPSED+1)) - done -} - -has_compose() { - hash docker-compose 2>/dev/null && return 0 || return 1 -} - -docker_compose() { -# debug $FUNCNAME - - if has_compose; then - docker-compose "$@" - else - docker_run -v "${CHE_HOST_INSTANCE}":"${CHE_CONTAINER_INSTANCE}" \ - $IMAGE_COMPOSE "$@" - fi -} - -start_test_server() { - export AGENT_INTERNAL_PORT=80 - export AGENT_EXTERNAL_PORT=32768 - export AGENT_CONTAINER_NAME="fakeagent-$CHE_PORT" - - # Start mini httpd server to run simulated tests - docker run -d -p $AGENT_EXTERNAL_PORT:$AGENT_INTERNAL_PORT --name $AGENT_CONTAINER_NAME \ - ${BOOTSTRAP_IMAGE_ALPINE} httpd -f -p $AGENT_INTERNAL_PORT -h /etc/ >> "${LOGS}" - - export AGENT_INTERNAL_IP=$(docker inspect --format='{{.NetworkSettings.IPAddress}}' $AGENT_CONTAINER_NAME) - export AGENT_EXTERNAL_IP=$CHE_HOST -} - -stop_test_server() { - # Remove httpd server - docker rm -f $AGENT_CONTAINER_NAME >> "${LOGS}" -} - -test1() { - HTTP_CODE=$(curl -I localhost:${AGENT_EXTERNAL_PORT}/alpine-release \ - -s -o /dev/null --connect-timeout 5 \ - --write-out '%{http_code}') || echo "28" >> "${LOGS}" - - if check_http_code $HTTP_CODE; then - return 0 - else - return 1 - fi -} - -test2() { - HTTP_CODE=$(curl -I ${AGENT_EXTERNAL_IP}:${AGENT_EXTERNAL_PORT}/alpine-release \ - -s -o /dev/null --connect-timeout 5 \ - --write-out '%{http_code}') || echo "28" >> "${LOGS}" - - if check_http_code $HTTP_CODE; then - return 0 - else - return 1 - fi -} - -test3() { - HTTP_CODE=$(docker_run --entrypoint=curl \ - $(eval "echo \${IMAGE_${CHE_PRODUCT_NAME}}") \ - -I ${AGENT_EXTERNAL_IP}:${AGENT_EXTERNAL_PORT}/alpine-release \ - -s -o /dev/null \ - --write-out '%{http_code}') - - if check_http_code $HTTP_CODE; then - return 0 - else - return 1 - fi -} - -test4() { - HTTP_CODE=$(docker_run --entrypoint=curl \ - $(eval "echo \${IMAGE_${CHE_PRODUCT_NAME}}") \ - -I ${AGENT_INTERNAL_IP}:${AGENT_INTERNAL_PORT}/alpine-release \ - -s -o /dev/null \ - --write-out '%{http_code}') - - if check_http_code $HTTP_CODE; then - return 0 - else - return 1 - fi -} - -check_http_code() { - if [ "${1}" = "200" ]; then - return 0 - else - return 1 - fi -} - -# return options for docker run used by end-user when calling cli -get_docker_run_terminal_options() { - local DOCKER_RUN_OPTIONS="" - # if TTY is there, need to use -ti - if [[ ${TTY_ACTIVATED} == "true" ]]; then - DOCKER_RUN_OPTIONS="-t" - fi - if [[ ${CHE_CLI_IS_INTERACTIVE} == "true" ]]; then - DOCKER_RUN_OPTIONS+="i" - fi - echo ${DOCKER_RUN_OPTIONS} -} diff --git a/dockerfiles/base/scripts/base/startup.sh b/dockerfiles/base/scripts/base/startup.sh deleted file mode 100644 index fec8b8e858c1..000000000000 --- a/dockerfiles/base/scripts/base/startup.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2017 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 -# - -# Check pre/post functions are there or not -declare -f pre_init > /dev/null -if [ "$?" == "1" ]; then - pre_init() { - : - } -fi - -declare -f post_init > /dev/null -if [ "$?" == "1" ]; then - post_init() { - : - } -fi - -source /scripts/base/startup_01_init.sh - -# See: https://sipb.mit.edu/doc/safe-shell/ -set -e -set -u - -trap "cleanup" INT TERM EXIT diff --git a/dockerfiles/base/scripts/base/startup_01_init.sh b/dockerfiles/base/scripts/base/startup_01_init.sh deleted file mode 100644 index bf13ed65d9b6..000000000000 --- a/dockerfiles/base/scripts/base/startup_01_init.sh +++ /dev/null @@ -1,359 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2017 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 -# - - -init_usage() { - USAGE=" -USAGE: - docker run -it --rm ${CHE_IMAGE_FULLNAME} [COMMAND] - -MANDATORY DOCKER PARAMETERS: - -v :${CHE_CONTAINER_ROOT} Where user, instance, and log data saved${ADDITIONAL_MANDATORY_PARAMETERS} - -OPTIONAL DOCKER PARAMETERS:${ADDITIONAL_OPTIONAL_DOCKER_PARAMETERS} - -v :${CHE_CONTAINER_ROOT}/instance Where instance, user, log data will be saved - -v :${CHE_CONTAINER_ROOT}/backup Where backup files will be saved - -v :/repo ${CHE_MINI_PRODUCT_NAME} git repo - uses local binaries and manifests - -v :/assembly ${CHE_MINI_PRODUCT_NAME} assembly - uses local binaries - -v :/sync Where remote ws files will be copied with sync command - -v :/unison Where unison profile for optimizing sync command resides - -v :/chedir Soure repository to convert into workspace with Chedir utility${ADDITIONAL_OPTIONAL_DOCKER_MOUNTS} - -COMMANDS: - archetype Generate, build, and run custom assemblies of ${CHE_MINI_PRODUCT_NAME} - action Start action on ${CHE_MINI_PRODUCT_NAME} instance - backup Backups ${CHE_MINI_PRODUCT_NAME} configuration and data to ${CHE_CONTAINER_ROOT}/backup volume mount - config Generates a ${CHE_MINI_PRODUCT_NAME} config from vars; run on any start / restart - destroy Stops services, and deletes ${CHE_MINI_PRODUCT_NAME} instance data - dir Use Chedir and Chefile in the directory mounted to :/chedir - download Pulls Docker images for the current ${CHE_MINI_PRODUCT_NAME} version - help This message - info Displays info about ${CHE_MINI_PRODUCT_NAME} and the CLI - init Initializes a directory with a ${CHE_MINI_PRODUCT_NAME} install - offline Saves ${CHE_MINI_PRODUCT_NAME} Docker images into TAR files for offline install - restart Restart ${CHE_MINI_PRODUCT_NAME} services - restore Restores ${CHE_MINI_PRODUCT_NAME} configuration and data from ${CHE_CONTAINER_ROOT}/backup mount - rmi Removes the Docker images for , forcing a repull - ssh [machine-name] SSH to a workspace if SSH agent enabled - start Starts ${CHE_MINI_PRODUCT_NAME} services - stop Stops ${CHE_MINI_PRODUCT_NAME} services - sync Synchronize workspace with local directory mounted to :/sync - test Start test on ${CHE_MINI_PRODUCT_NAME} instance - upgrade Upgrades ${CHE_MINI_PRODUCT_NAME} from one version to another with migrations and backups - version Installed version and upgrade paths${ADDITIONAL_COMMANDS} - -GLOBAL COMMAND OPTIONS: - --fast Skips networking, version, nightly and preflight checks - --offline Runs CLI in offline mode, loading images from disk - --debug Enable debugging of ${CHE_MINI_PRODUCT_NAME} server - --trace Activates trace output for debugging CLI${ADDITIONAL_GLOBAL_OPTIONS} - --help Get help for a command -" -} - -init_constants() { - BLUE='\033[1;34m' - GREEN='\033[0;32m' - RED='\033[0;31m' - YELLOW='\033[38;5;220m' - BOLD='\033[1m' - UNDERLINE='\033[4m' - NC='\033[0m' - - # CLI DEVELOPERS - ONLY INCREMENT THIS CHANGE IF MODIFYING SECTIONS THAT AFFECT LOADING - # BEFORE :/REPO IS VOLUME MOUNTED. CLI ASSEMBLIES WILL FAIL UNTIL THEY - # ARE RECOMPILED WITH MATCHING VERSION. - CHE_BASE_API_VERSION=2 -} - -init_global_vars() { - LOG_INITIALIZED=false - FAST_BOOT=false - CHE_DEBUG=false - CHE_OFFLINE=false - CHE_SKIP_NIGHTLY=false - CHE_SKIP_NETWORK=false - CHE_SKIP_PULL=false - CHE_COMMAND_HELP=false - CHE_SKIP_SCRIPTS=false - - DEFAULT_CHE_PRODUCT_NAME="CHE" - CHE_PRODUCT_NAME=${CHE_PRODUCT_NAME:-${DEFAULT_CHE_PRODUCT_NAME}} - - # Name used in CLI statements - DEFAULT_CHE_MINI_PRODUCT_NAME="che" - CHE_MINI_PRODUCT_NAME=${CHE_MINI_PRODUCT_NAME:-${DEFAULT_CHE_MINI_PRODUCT_NAME}} - - DEFAULT_CHE_FORMAL_PRODUCT_NAME="Eclipse Che" - CHE_FORMAL_PRODUCT_NAME=${CHE_FORMAL_PRODUCT_NAME:-${DEFAULT_CHE_FORMAL_PRODUCT_NAME}} - - # Path to root folder inside the container - DEFAULT_CHE_CONTAINER_ROOT="/data" - CHE_CONTAINER_ROOT=${CHE_CONTAINER_ROOT:-${DEFAULT_CHE_CONTAINER_ROOT}} - - # Turns on stack trace - DEFAULT_CHE_CLI_DEBUG="false" - CHE_CLI_DEBUG=${CLI_DEBUG:-${DEFAULT_CHE_CLI_DEBUG}} - - # Activates console output - DEFAULT_CHE_CLI_INFO="true" - CHE_CLI_INFO=${CLI_INFO:-${DEFAULT_CHE_CLI_INFO}} - - # Activates console warnings - DEFAULT_CHE_CLI_WARN="true" - CHE_CLI_WARN=${CLI_WARN:-${DEFAULT_CHE_CLI_WARN}} - - # Activates console output - DEFAULT_CHE_CLI_LOG="true" - CHE_CLI_LOG=${CLI_LOG:-${DEFAULT_CHE_CLI_LOG}} - - DEFAULT_CHE_ASSEMBLY_IN_REPO_MODULE_NAME="assembly/assembly-main" - CHE_ASSEMBLY_IN_REPO_MODULE_NAME=${CHE_ASSEMBLY_IN_REPO_MODULE_NAME:-${DEFAULT_CHE_ASSEMBLY_IN_REPO_MODULE_NAME}} - - DEFAULT_CHE_ASSEMBLY_IN_REPO="${DEFAULT_CHE_ASSEMBLY_IN_REPO_MODULE_NAME}/target/eclipse-che*/eclipse-che-*" - CHE_ASSEMBLY_IN_REPO=${CHE_ASSEMBLY_IN_REPO:-${DEFAULT_CHE_ASSEMBLY_IN_REPO}} - - DEFAULT_CHE_SCRIPTS_CONTAINER_SOURCE_DIR="/repo/dockerfiles/cli/scripts" - CHE_SCRIPTS_CONTAINER_SOURCE_DIR=${CHE_SCRIPTS_CONTAINER_SOURCE_DIR:-${DEFAULT_CHE_SCRIPTS_CONTAINER_SOURCE_DIR}} - - DEFAULT_CHE_BASE_SCRIPTS_CONTAINER_SOURCE_DIR="/scripts/base" - CHE_BASE_SCRIPTS_CONTAINER_SOURCE_DIR=${CHE_BASE_SCRIPTS_CONTAINER_SOURCE_DIR:-${DEFAULT_CHE_BASE_SCRIPTS_CONTAINER_SOURCE_DIR}} - - DEFAULT_CHE_LICENSE_URL="https://www.eclipse.org/legal/epl-2.0/" - CHE_LICENSE_URL=${CHE_LICENSE_URL:-${DEFAULT_CHE_LICENSE_URL}} - - DEFAULT_CHE_IMAGE_FULLNAME="eclipse/che-cli:" - CHE_IMAGE_FULLNAME=${CHE_IMAGE_FULLNAME:-${DEFAULT_CHE_IMAGE_FULLNAME}} - - # Constants - CHE_MANIFEST_DIR="/version" - CHE_VERSION_FILE="${CHE_MINI_PRODUCT_NAME}.ver.do_not_modify" - CHE_ENVIRONMENT_FILE="${CHE_MINI_PRODUCT_NAME}.env" - CHE_COMPOSE_FILE="docker-compose-container.yml" - CHE_HOST_COMPOSE_FILE="docker-compose.yml" - - # Keep for backwards compatibility - DEFAULT_CHE_SERVER_CONTAINER_NAME="${CHE_MINI_PRODUCT_NAME}" - CHE_SERVER_CONTAINER_NAME="${CHE_SERVER_CONTAINER_NAME:-${DEFAULT_CHE_SERVER_CONTAINER_NAME}}" - - DEFAULT_CHE_CONTAINER_NAME="${CHE_SERVER_CONTAINER_NAME}" - CHE_CONTAINER_NAME="${CHE_CONTAINER:-${DEFAULT_CHE_CONTAINER_NAME}}" - - DEFAULT_CHE_CONTAINER_PREFIX="${CHE_SERVER_CONTAINER_NAME}" - CHE_CONTAINER_PREFIX="${CHE_CONTAINER_PREFIX:-${DEFAULT_CHE_CONTAINER_PREFIX}}" - - CHE_BACKUP_FILE_NAME="${CHE_MINI_PRODUCT_NAME}_backup.tar.gz" - CHE_COMPOSE_STOP_TIMEOUT="180" - - DEFAULT_CHE_CLI_ACTION="help" - CHE_CLI_ACTION=${CHE_CLI_ACTION:-${DEFAULT_CHE_CLI_ACTION}} - - DEFAULT_CHE_LICENSE=false - CHE_LICENSE=${CHE_LICENSE:-${DEFAULT_CHE_LICENSE}} - - if [[ "${CHE_CONTAINER_NAME}" = "${CHE_MINI_PRODUCT_NAME}" ]]; then - if [[ "${CHE_PORT}" != "${DEFAULT_CHE_PORT}" ]]; then - CHE_CONTAINER_NAME="${CHE_CONTAINER_PREFIX}-${CHE_PORT}" - else - CHE_CONTAINER_NAME="${CHE_CONTAINER_PREFIX}" - fi - fi - - DEFAULT_CHE_COMPOSE_PROJECT_NAME="${CHE_CONTAINER_NAME}" - CHE_COMPOSE_PROJECT_NAME="${CHE_COMPOSE_PROJECT_NAME:-${DEFAULT_CHE_COMPOSE_PROJECT_NAME}}" - - DEFAULT_CHE_USER="root" - CHE_USER="${CHE_USER:-${DEFAULT_CHE_USER}}" - - CHE_USER_GROUPS="" - - UNAME_R=${UNAME_R:-$(uname -r)} - -} - -usage() { - # debug $FUNCNAME - init_usage - printf "%s" "${USAGE}" -} - -init_cli_version_check() { - if [[ $CHE_BASE_API_VERSION != $CHE_CLI_API_VERSION ]]; then - printf "CLI base ($CHE_BASE_API_VERSION) does not match CLI ($CHE_CLI_API_VERSION) version.\n" - printf "Recompile the CLI with the latest version of the CLI base.\n" - return 1; - fi -} - -init_usage_check() { - # If there are no parameters, immediately display usage - - if [[ $# == 0 ]]; then - usage - return 1 - fi - - if [[ "$@" == *"--fast"* ]]; then - FAST_BOOT=true - fi - - if [[ "$@" == *"--debug"* ]]; then - CHE_DEBUG=true - fi - - if [[ "$@" == *"--offline"* ]]; then - CHE_OFFLINE=true - fi - - if [[ "$@" == *"--trace"* ]]; then - CHE_TRACE=true - set -x - fi - - if [[ "$@" == *"--skip:nightly"* ]]; then - CHE_SKIP_NIGHTLY=true - fi - - if [[ "$@" == *"--skip:network"* ]]; then - CHE_SKIP_NETWORK=true - fi - - if [[ "$@" == *"--skip:pull"* ]]; then - CHE_SKIP_PULL=true - fi - - if [[ "$@" == *"--help"* ]]; then - CHE_COMMAND_HELP=true - fi - - if [[ "$@" == *"--skip:scripts"* ]]; then - CHE_SKIP_SCRIPTS=true - fi -} - -cleanup() { - RETURN_CODE=$? - - # CLI developers should only return '3' in code after the init() method has completed. - # This will check to see if the CLI directory is not mounted and only offer the error - # message if it isn't currently mounted. - if [ $RETURN_CODE -eq "3" ]; then - error "" - error "Unexpected exit: Trace output saved to $CHE_HOST_CONFIG/cli.log." - fi -} - -start() { - # pre_init is unique to each CLI assembly. This can be called before networking is established. - source "/scripts/pre_init.sh" - pre_init - - # Yo, constants - init_constants - - # Variables used throughout - init_global_vars - - # Check to make sure CLI assembly matches base - init_cli_version_check - - # Checks for global parameters - init_usage_check "$@" - - # Removes global parameters from the positional arguments - ORIGINAL_PARAMETERS=$@ - set -- "${@/\-\-fast/}" - set -- "${@/\-\-debug/}" - set -- "${@/\-\-offline/}" - set -- "${@/\-\-trace/}" - set -- "${@/\-\-skip\:nightly/}" - set -- "${@/\-\-skip\:network/}" - set -- "${@/\-\-skip\:pull/}" - set -- "${@/\-\-help/}" - set -- "${@/\-\-skip\:scripts/}" - - source "${CHE_BASE_SCRIPTS_CONTAINER_SOURCE_DIR}"/startup_02_pre_docker.sh - - # Make sure Docker is working and we have /var/run/docker.sock mounted or valid DOCKER_HOST - init_check_docker "$@" - - # Check to see if Docker is configured with a proxy and pull values - init_check_docker_networking - - # Verify that -i is passed on the command line - init_check_interactive "$@" - - # Only verify mounts after Docker is confirmed to be working. - init_check_mounts "$@" - - # Extract the value of --user from the docker command line - init_check_user "$@" - - # Extract the value of --group-add from the docker command line - init_check_groups "$@" - - # Only initialize after mounts have been established so we can write cli.log out to a mount folder - init_logging "$@" - - # Determine where the remaining scripts will be sourced from (inside image, or repo?) - init_scripts "$@" - - # We now know enough to load scripts from different locations - so source from proper source - source "${SCRIPTS_BASE_CONTAINER_SOURCE_DIR}"/startup_03_pre_networking.sh - - # If offline mode, then load dependent images from disk and populate the local Docker cache. - # If not in offline mode, verify that we have access to DockerHub. - # This is also the first usage of curl - init_offline_or_network_mode "$@" - - # Pull the list of images that are necessary. If in offline mode, verifies that the images - # are properly loaded into the cache. - init_initial_images "$@" - - # Each CLI assembly must provide this cli.sh - loads overridden functions and variables for the CLI - source "${SCRIPTS_CONTAINER_SOURCE_DIR}"/post_init.sh - - # The post_init method is unique to each assembly. This method must be provided by - # a custom CLI assembly in their container and can set global variables which are - # specific to that implementation of the CLI. Place initialization functions that - # require networking here. - post_init - - # Begin product-specific CLI calls - info "cli" "$CHE_VERSION - using docker ${DOCKER_SERVER_VERSION} / $(get_docker_install_type)" - - source "${SCRIPTS_BASE_CONTAINER_SOURCE_DIR}"/startup_04_pre_cli_init.sh - - # Allow CLI assemblies to load variables assuming networking, logging, docker activated - cli_pre_init - - # Set CHE_HOST, CHE_PORT, and apply any CLI-specific command-line overrides to variables - cli_init "$@" - - # Additional checks for nightly version - cli_verify_nightly "$@" - - # Additional checks to verify image matches version installed on disk & upgrade suitability - cli_verify_version "$@" - - # Allow CLI assemblies to load variables assuming CLI is finished bootstrapping - cli_post_init - - source "${SCRIPTS_BASE_CONTAINER_SOURCE_DIR}"/startup_05_pre_exec.sh - - # Loads the library and associated dependencies - cli_load "$@" - - # Parses the command list for validity - cli_parse "$@" - - # Executes command lifecycle - cli_execute "$@" -} diff --git a/dockerfiles/base/scripts/base/startup_02_pre_docker.sh b/dockerfiles/base/scripts/base/startup_02_pre_docker.sh deleted file mode 100644 index b9b1b8d7248e..000000000000 --- a/dockerfiles/base/scripts/base/startup_02_pre_docker.sh +++ /dev/null @@ -1,717 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2017 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 -# - -# Sends arguments as a text to CLI log file -# Usage: -# log [other arguments] -log() { - if [[ "$LOG_INITIALIZED" = "true" ]]; then - if is_log; then - echo "$@" >> "${LOGS}" - fi - fi -} - -warning() { - if [ -z ${2+x} ]; then - local PRINT_COMMAND="" - local PRINT_STATEMENT=$1 - else - local PRINT_COMMAND="($CHE_MINI_PRODUCT_NAME $1): " - local PRINT_STATEMENT=$2 - fi - - if is_warning; then - printf "${YELLOW}WARN:${NC} %b%b\n" \ - "${PRINT_COMMAND}" \ - "${PRINT_STATEMENT}" - fi - log $(printf "INFO: %b %b\n" \ - "${PRINT_COMMAND}" \ - "${PRINT_STATEMENT}") -} - -info() { - if [ -z ${2+x} ]; then - local PRINT_COMMAND="" - local PRINT_STATEMENT=$1 - else - local PRINT_COMMAND="($CHE_MINI_PRODUCT_NAME $1): " - local PRINT_STATEMENT=$2 - fi - if is_info; then - printf "${GREEN}INFO:${NC} %b%b\n" \ - "${PRINT_COMMAND}" \ - "${PRINT_STATEMENT}" - fi - log $(printf "INFO: %b %b\n" \ - "${PRINT_COMMAND}" \ - "${PRINT_STATEMENT}") -} - -debug() { - if is_debug; then - printf "\n${BLUE}DEBUG:${NC} %s" "${1}" - fi - log $(printf "\nDEBUG: %s" "${1}") -} - -error() { - printf "${RED}ERROR:${NC} %s\n" "${1}" - log $(printf "ERROR: %s\n" "${1}") -} - -# Prints message without changes -# Usage: has the same syntax as printf command -text() { - printf "$@" - log $(printf "$@") -} - -## TODO use that for all native calls to improve logging for support purposes -# Executes command with 'eval' command. -# Also logs what is being executed and stdout/stderr -# Usage: -# cli_eval -# Examples: -# cli_eval "$(which curl) http://localhost:80/api/" -cli_eval() { - log "$@" - tmpfile=$(mktemp) - if eval "$@" &>"${tmpfile}"; then - # Execution succeeded - cat "${tmpfile}" >> "${LOGS}" - cat "${tmpfile}" - rm "${tmpfile}" - else - # Execution failed - cat "${tmpfile}" >> "${LOGS}" - cat "${tmpfile}" - rm "${tmpfile}" - fail - fi -} - -# Executes command with 'eval' command and suppress stdout/stderr. -# Also logs what is being executed and stdout+stderr -# Usage: -# cli_silent_eval -# Examples: -# cli_silent_eval "$(which curl) http://localhost:80/api/" -cli_silent_eval() { - log "$@" - eval "$@" >> "${LOGS}" 2>&1 -} - -is_log() { - if [ "${CHE_CLI_LOG}" = "true" ]; then - return 0 - else - return 1 - fi -} - -is_warning() { - if [ "${CHE_CLI_WARN}" = "true" ]; then - return 0 - else - return 1 - fi -} - -is_info() { - if [ "${CHE_CLI_INFO}" = "true" ]; then - return 0 - else - return 1 - fi -} - -is_debug() { - if [ "${CHE_CLI_DEBUG}" = "true" ]; then - return 0 - else - return 1 - fi -} - -debug_server() { - if [ "${CHE_DEBUG}" = "true" ]; then - return 0 - else - return 1 - fi -} - -is_fast() { - if [ "${FAST_BOOT}" = "true" ]; then - return 0 - else - return 1 - fi -} - -is_offline() { - if [ "${CHE_OFFLINE}" = "true" ]; then - return 0 - else - return 1 - fi -} - -is_trace() { - if [ "${CHE_TRACE}" = "true" ]; then - return 0 - else - return 1 - fi -} - -skip_nightly() { - if [ "${CHE_SKIP_NIGHTLY}" = "true" ]; then - return 0 - else - return 1 - fi -} - -skip_network() { - if [ "${CHE_SKIP_NETWORK}" = "true" ]; then - return 0 - else - return 1 - fi -} - -skip_pull() { - if [ "${CHE_SKIP_PULL}" = "true" ]; then - return 0 - else - return 1 - fi -} - -local_repo() { - if [ "${CHE_LOCAL_REPO}" = "true" ]; then - return 0 - else - return 1 - fi -} - -local_assembly() { - if [ "${CHE_LOCAL_ASSEMBLY}" = "true" ]; then - return 0 - else - return 1 - fi -} - -get_command_help() { - if [ "${CHE_COMMAND_HELP}" = "true" ]; then - return 0 - else - return 1 - fi -} - -custom_user() { - if [ "${CHE_USER}" != "${DEFAULT_CHE_USER}" ]; then - return 0 - else - return 1 - fi -} - -skip_scripts() { - if [ "${CHE_SKIP_SCRIPTS}" = "true" ]; then - return 0 - else - return 1 - fi -} - -cli_init() { - CHE_HOST=$(eval "echo \$${CHE_PRODUCT_NAME}_HOST") - CHE_PORT=$(eval "echo \$${CHE_PRODUCT_NAME}_PORT") - - if [[ "$(eval "echo \$${CHE_PRODUCT_NAME}_HOST")" = "" ]]; then - info "Welcome to $CHE_FORMAL_PRODUCT_NAME!" - info "" - info "We did not auto-detect a valid HOST or IP address." - info "Pass ${CHE_PRODUCT_NAME}_HOST with your hostname or IP address." - info "" - info "Rerun the CLI:" - info " docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock" - info " -v :${CHE_CONTAINER_ROOT}" - info " -e ${CHE_PRODUCT_NAME}_HOST=" - info " $CHE_IMAGE_FULLNAME $*" - return 2; - fi - - if is_initialized; then - CHE_HOST_LOCAL=$(get_value_of_var_from_env_file ${CHE_PRODUCT_NAME}_HOST) - if [[ "${CHE_HOST}" != "${CHE_HOST_LOCAL}" ]]; then - warning "${CHE_PRODUCT_NAME}_HOST (${CHE_HOST}) overridden by ${CHE_ENVIRONMENT_FILE} (${CHE_HOST_LOCAL})" - fi - fi - - # Special function to perform special behaviors if you are running nightly version - verify_nightly_accuracy - - # Do not perform a version compatibility check if running upgrade command. - # The upgrade command has its own internal checks for version compatibility. - if [[ "$@" == *"upgrade"* ]]; then - verify_version_upgrade_compatibility - elif ! is_fast; then - verify_version_compatibility - fi -} - -init_check_docker() { - if ! has_docker; then - error "Docker not found. Get it at https://docs.docker.com/engine/installation/." - return 1; - fi - - CHECK_VERSION=$(docker ps 2>&1 || true) - if [[ "$CHECK_VERSION" = *"Error response from daemon: client is newer"* ]]; then - error "Error - Docker engine 1.11+ required." - return 2; - fi - - # If DOCKER_HOST is not set, then it should bind mounted - if [ -z "${DOCKER_HOST+x}" ]; then - if ! docker ps > /dev/null 2>&1; then - info "Welcome to ${CHE_FORMAL_PRODUCT_NAME}!" - info "" - info "You are missing a mandatory parameter:" - info " 1. Mount 'docker.sock' for accessing Docker with unix sockets." - info " 2. Or, set DOCKER_HOST to Docker's location (unix or tcp)." - info "" - info "Mount Syntax:" - info " Start with 'docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock' ..." - info "" - info "DOCKER_HOST Syntax:" - info " Start with 'docker run -it --rm -e DOCKER_HOST= ...'" - info "" - info "Possible root causes:" - info " 1. Your admin has not granted permissions to /var/run/docker.sock." - info " 2. You passed '--user uid:gid' with bad values." - info " 3. Your firewall is blocking TCP ports for accessing Docker daemon." - return 2; - fi - fi - - DOCKER_CLIENT_VERSION=$(docker version --format '{{.Client.Version}}') - DOCKER_SERVER_VERSION=$(docker version --format '{{.Server.Version}}') - - # Detect version so that we can provide better error warnings - DEFAULT_CHE_VERSION=$(cat "/version/latest.ver") - CHE_IMAGE_FULLNAME=$(docker inspect --format='{{.Config.Image}}' $(get_this_container_id)) - - # Note - cut command here fails if there is no colon : in the image - CHE_IMAGE_NAME=${CHE_IMAGE_FULLNAME%:*} - CHE_IMAGE_VERSION=$(echo "${CHE_IMAGE_FULLNAME}" | cut -d : -f2 -s) - if [[ "${CHE_IMAGE_VERSION}" = "" ]] || - [[ "${CHE_IMAGE_VERSION}" = "latest" ]]; then - CHE_IMAGE_VERSION=$DEFAULT_CHE_VERSION - warning "Bound '$CHE_IMAGE_NAME' to '$CHE_IMAGE_NAME:$CHE_IMAGE_VERSION'" - else - CHE_IMAGE_VERSION=$CHE_IMAGE_VERSION - fi - - CHE_VERSION=$CHE_IMAGE_VERSION -} - -init_check_docker_networking() { - # Check to see if HTTP_PROXY, HTTPS_PROXY, and NO_PROXY is set within the Docker daemon. - OUTPUT=$(docker info) - HTTP_PROXY=$(grep "Http Proxy" <<< "$OUTPUT" || true) - if [ ! -z "$HTTP_PROXY" ]; then - HTTP_PROXY=${HTTP_PROXY#"Http Proxy: "} - else - HTTP_PROXY="" - fi - - HTTPS_PROXY=$(grep "Https Proxy" <<< "$OUTPUT" || true) - if [ ! -z "$HTTPS_PROXY" ]; then - HTTPS_PROXY=${HTTPS_PROXY#"Https Proxy: "} - else - HTTPS_PROXY="" - fi - - NO_PROXY=$(grep "No Proxy" <<< "$OUTPUT" || true) - if [ ! -z "$NO_PROXY" ]; then - NO_PROXY=${NO_PROXY#"No Proxy: "} - else - NO_PROXY="" - fi - - if [[ ! ${HTTP_PROXY} = "" ]] || - [[ ! ${HTTPS_PROXY} = "" ]] || - [[ ! ${NO_PROXY} = "" ]]; then - info "Proxy: HTTP_PROXY=${HTTP_PROXY}, HTTPS_PROXY=${HTTPS_PROXY}, NO_PROXY=${NO_PROXY}" - if [[ ${NO_PROXY} = "" ]]; then - warning "Potential networking issue discovered!" - warning "We have identified that http and https proxies are set but no_proxy is not. This may cause fatal networking errors. Set no_proxy for your Docker daemon!" - fi - fi - - export http_proxy=$HTTP_PROXY - export https_proxy=$HTTPS_PROXY - export no_proxy=$NO_PROXY -} - -init_check_interactive() { - # Detect and verify that the CLI container was started with -it option. - TTY_ACTIVATED=true - CHE_CLI_IS_INTERACTIVE=true - - # check if no terminal - if [ ! -t 1 ]; then - TTY_ACTIVATED=false - CHE_CLI_IS_INTERACTIVE=false - warning "Did not detect TTY - interactive mode disabled" - else - # There is a terminal, check if it's in interactive mode - CHE_CLI_IS_INTERACTIVE=$(docker inspect --format='{{.Config.AttachStdin}}' $(get_this_container_id)) - if [[ ${CHE_CLI_IS_INTERACTIVE} == "false" ]]; then - CHE_CLI_IS_INTERACTIVE=false - warning "Did detect TTY but not in interactive mode" - fi - fi -} - -# Add check to see if --user uid:gid passed in. -init_check_user() { - DOCKER_CHE_USER=$(docker inspect --format='{{.Config.User}}' $(get_this_container_id)) - if [[ "${DOCKER_CHE_USER}" != "" ]]; then - CHE_USER=$DOCKER_CHE_USER - fi - - if custom_user; then - true - fi -} - -# Extract groups of the docker run command -init_check_groups() { - DOCKER_CHE_GROUPS=$(docker inspect --format='{{.HostConfig.GroupAdd}}' $(get_this_container_id) | cut -d '[' -f 2 | cut -d ']' -f 1 | xargs) - if [[ "${DOCKER_CHE_GROUPS}" != "" ]]; then - CHE_USER_GROUPS=${DOCKER_CHE_GROUPS} - fi -} - -init_check_mounts() { - DATA_MOUNT=$(get_container_folder ":${CHE_CONTAINER_ROOT}") - INSTANCE_MOUNT=$(get_container_folder ":${CHE_CONTAINER_ROOT}/instance") - BACKUP_MOUNT=$(get_container_folder ":${CHE_CONTAINER_ROOT}/backup") - REPO_MOUNT=$(get_container_folder ":/repo") - ASSEMBLY_MOUNT=$(get_container_folder ":/assembly") - SYNC_MOUNT=$(get_container_folder ":/sync") - UNISON_PROFILE_MOUNT=$(get_container_folder ":/unison") - CHEDIR_MOUNT=$(get_container_folder ":/chedir") - DOCKER_MOUNT=$(get_container_folder ":/var/run/docker.sock") - - if [[ "${DATA_MOUNT}" = "not set" ]]; then - info "Welcome to $CHE_FORMAL_PRODUCT_NAME!" - info "" - info "We could not detect a location to save data." - info "Volume mount a local directory to ':${CHE_CONTAINER_ROOT}'." - info "" - info "Simplest syntax:" - info " docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock" - info " -v :${CHE_CONTAINER_ROOT}" - info " ${CHE_IMAGE_FULLNAME} $*" - info "" - info "" - info "Or, run with additional overrides:" - info " docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock" - info " -v :${CHE_CONTAINER_ROOT}" - info " -v :${CHE_CONTAINER_ROOT}/instance" - info " -v :${CHE_CONTAINER_ROOT}/backup" - info " ${CHE_IMAGE_FULLNAME} $*" - return 2; - fi - - # Verify that we can write to the host file system from the container - if ! is_fast; then - check_host_volume_mount - fi - - DEFAULT_CHE_CONFIG="${DATA_MOUNT}" - DEFAULT_CHE_INSTANCE="${DATA_MOUNT}"/instance - DEFAULT_CHE_BACKUP="${DATA_MOUNT}"/backup - - if [[ "${INSTANCE_MOUNT}" != "not set" ]]; then - DEFAULT_CHE_INSTANCE="${INSTANCE_MOUNT}" - fi - - if [[ "${BACKUP_MOUNT}" != "not set" ]]; then - DEFAULT_CHE_BACKUP="${BACKUP_MOUNT}" - fi - - # DERIVED VARIABLES FROM MOUNTS - CHE_HOST_CONFIG=${CHE_CONFIG:-${DEFAULT_CHE_CONFIG}} - CHE_CONTAINER_CONFIG="${CHE_CONTAINER_ROOT}" - - CHE_HOST_INSTANCE=${CHE_INSTANCE:-${DEFAULT_CHE_INSTANCE}} - CHE_CONTAINER_INSTANCE="${CHE_CONTAINER_ROOT}/instance" - - CHE_HOST_BACKUP=${CHE_BACKUP:-${DEFAULT_CHE_BACKUP}} - CHE_CONTAINER_BACKUP="${CHE_CONTAINER_ROOT}/backup" - - REFERENCE_HOST_ENVIRONMENT_FILE="${CHE_HOST_CONFIG}/${CHE_ENVIRONMENT_FILE}" - REFERENCE_HOST_COMPOSE_FILE="${CHE_HOST_INSTANCE}/${CHE_COMPOSE_FILE}" - REFERENCE_CONTAINER_ENVIRONMENT_FILE="${CHE_CONTAINER_CONFIG}/${CHE_ENVIRONMENT_FILE}" - REFERENCE_CONTAINER_COMPOSE_FILE="${CHE_CONTAINER_INSTANCE}/${CHE_COMPOSE_FILE}" - REFERENCE_CONTAINER_COMPOSE_HOST_FILE="${CHE_CONTAINER_INSTANCE}/${CHE_HOST_COMPOSE_FILE}" - - CHE_CONTAINER_OFFLINE_FOLDER="${CHE_CONTAINER_BACKUP}" - CHE_HOST_OFFLINE_FOLDER="${CHE_HOST_BACKUP}" - - CHE_HOST_CONFIG_MANIFESTS_FOLDER="${CHE_HOST_INSTANCE}/manifests" - CHE_CONTAINER_CONFIG_MANIFESTS_FOLDER="${CHE_CONTAINER_INSTANCE}/manifests" - - CHE_HOST_CONFIG_MODULES_FOLDER="${CHE_HOST_INSTANCE}/modules" - CHE_CONTAINER_CONFIG_MODULES_FOLDER="${CHE_CONTAINER_INSTANCE}/modules" - - - ### DEV MODE VARIABLES - CHE_LOCAL_REPO=false - if [[ "${REPO_MOUNT}" != "not set" ]]; then - info "cli" "/repo mounted - using assembly and manifests from your local repository" - - CHE_LOCAL_REPO=true - CHE_HOST_DEVELOPMENT_REPO="${REPO_MOUNT}" - CHE_CONTAINER_DEVELOPMENT_REPO="/repo" - - # When we build eclipse/che-base, we insert the version of the repo it was built from into the image - if [[ -f "/repo/dockerfiles/base/scripts/base/startup_01_init.sh" ]]; then - CHE_REPO_BASE_VERSION=$(grep -hn CHE_BASE_API_VERSION= /repo/dockerfiles/base/scripts/base/startup_01_init.sh) - CHE_REPO_BASE_VERSION=${CHE_REPO_BASE_VERSION#*=} - else - CHE_REPO_BASE_VERSION=$CHE_BASE_API_VERSION - fi - - if [[ $CHE_BASE_API_VERSION != $CHE_REPO_BASE_VERSION ]]; then - warning "The CLI base image version ($CHE_BASE_API_VERSION) does not match your repo ($CHE_REPO_BASE_VERSION)" - warning "You have mounted :/repo and your repo branch does not match with the image." - fi - - CHE_ASSEMBLY="${CHE_HOST_INSTANCE}/dev/${CHE_MINI_PRODUCT_NAME}-tomcat" - - if [[ ! -d "${CHE_CONTAINER_DEVELOPMENT_REPO}" ]] || [[ ! -d "${CHE_CONTAINER_DEVELOPMENT_REPO}/assembly" ]]; then - info "Welcome to $CHE_FORMAL_PRODUCT_NAME!" - info "" - info "You volume mounted ':/repo', but we did not detect a valid ${CHE_FORMAL_PRODUCT_NAME} source repo." - info "" - info "Volume mounting ':/repo' activates dev mode, using assembly and CLI files from $CHE_FORMAL_PRODUCT_NAME repo." - info "" - info "Please check the path you mounted to verify that is a valid $CHE_FORMAL_PRODUCT_NAME git repository." - info "" - info "Simplest syntax:" - info " docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock" - info " -v :${CHE_CONTAINER_ROOT}" - info " -v :/repo" - info " ${CHE_IMAGE_FULLNAME} $*" - info "" - info "" - info "Or run with overrides for instance, and backup (all required):" - info " docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock" - info " -v :${CHE_CONTAINER_ROOT}" - info " -v :${CHE_CONTAINER_ROOT}/instance" - info " -v :${CHE_CONTAINER_ROOT}/backup" - info " -v :/repo" - info " ${CHE_IMAGE_FULLNAME} $*" - return 2 - fi - - CHE_CONTAINER_ASSEMBLY_FULL_PATH="${CHE_CONTAINER_DEVELOPMENT_REPO}"/"${CHE_ASSEMBLY_IN_REPO}" - elif debug_server; then - warning "Debugging activated without ':/repo' mount - using binaries inside Docker image" - fi - - CHE_LOCAL_ASSEMBLY=false - if [[ "${ASSEMBLY_MOUNT}" != "not set" ]]; then - info "cli" ":/assembly mounted - using assembly from local host" - - CHE_LOCAL_ASSEMBLY=true - CHE_ASSEMBLY="${CHE_HOST_INSTANCE}/dev/${CHE_MINI_PRODUCT_NAME}-tomcat" - - CHE_CONTAINER_ASSEMBLY="/assembly" - if [[ ! -d "${CHE_CONTAINER_ASSEMBLY}" ]]; then - info "Welcome to $CHE_FORMAL_PRODUCT_NAME!" - info "" - info "You volume mounted ':/assembly', but we could not find a valid assembly." - info "" - info "Please check the path you mounted." - info "" - info "Syntax:" - info " docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock" - info " -v :${CHE_CONTAINER_ROOT}" - info " -v :/assembly" - info " ${CHE_IMAGE_FULLNAME} $*" - return 2 - fi - CHE_CONTAINER_ASSEMBLY_FULL_PATH="${CHE_CONTAINER_ASSEMBLY}" - fi -} - -init_logging() { - # Initialize CLI folder - CLI_DIR=$CHE_CONTAINER_ROOT - test -d "${CLI_DIR}" || mkdir -p "${CLI_DIR}" - - # Ensure logs folder exists - LOGS="${CLI_DIR}/cli.log" - LOG_INITIALIZED=true - - # Log date of CLI execution - log "$(date)" -} - -init_scripts() { - SCRIPTS_CONTAINER_SOURCE_DIR="" - SCRIPTS_BASE_CONTAINER_SOURCE_DIR="" - if local_repo && ! skip_scripts; then - # Use the CLI that is inside the repository. - SCRIPTS_CONTAINER_SOURCE_DIR=${CHE_SCRIPTS_CONTAINER_SOURCE_DIR} - - if [[ -d "/repo/dockerfiles/base/scripts/base" ]]; then - SCRIPTS_BASE_CONTAINER_SOURCE_DIR="/repo/dockerfiles/base/scripts/base" - else - SCRIPTS_BASE_CONTAINER_SOURCE_DIR=${CHE_BASE_SCRIPTS_CONTAINER_SOURCE_DIR} - fi - - # Compare scripts inside of the Docker image with those on the repository - # Fail if they do not match - DIFF_NUM=$(diff -r "/scripts/base" "${SCRIPTS_BASE_CONTAINER_SOURCE_DIR}" | wc -l) - if [ $DIFF_NUM -gt 0 ]; then - error "The scripts in ${CHE_IMAGE_FULLNAME} do not match those in :/repo." - error "Is your repo branch compatible with this image version?" - error "Add '--skip:scripts' to skip this check." - fi - else - # Use the CLI that is inside the container. - SCRIPTS_CONTAINER_SOURCE_DIR="/scripts" - SCRIPTS_BASE_CONTAINER_SOURCE_DIR=${CHE_BASE_SCRIPTS_CONTAINER_SOURCE_DIR} - fi -} - -has_docker() { - hash docker 2>/dev/null && return 0 || return 1 -} - -get_container_folder() { - THIS_CONTAINER_ID=$(get_this_container_id) - FOLDER=$(get_container_host_bind_folder "$1" $THIS_CONTAINER_ID) - echo "${FOLDER:=not set}" -} - -get_this_container_id() { - hostname -} - -get_container_host_bind_folder() { - # BINDS in the format of var/run/docker.sock:/var/run/docker.sock :${CHE_CONTAINER_ROOT} - BINDS=$(docker inspect --format="{{.HostConfig.Binds}}" "${2}" | cut -d '[' -f 2 | cut -d ']' -f 1) - - # Remove /var/run/docker.sock:/var/run/docker.sock - #VALUE=${BINDS/\/var\/run\/docker\.sock\:\/var\/run\/docker\.sock/} - - # Remove leading and trailing spaces - VALUE2=$(echo "${BINDS}" | xargs) - - MOUNT="" - IFS=$' ' - for SINGLE_BIND in $VALUE2; do - case $SINGLE_BIND in - - # Fix for CHE-3863 - in case there is :Z after the mount for SELinux, add * - *$1*) - MOUNT="${MOUNT} ${SINGLE_BIND}" - echo "${MOUNT}" | cut -f1 -d":" | xargs - ;; - *) - # Super ugly - since we parse by space, if the next parameter is not a colon, then - # we know that next parameter is second part of a directory with a space in it. - if [[ ${SINGLE_BIND} != *":"* ]]; then - MOUNT="${MOUNT} ${SINGLE_BIND}" - else - MOUNT="" - fi - ;; - esac - done -} - -check_host_volume_mount() { - if is_boot2docker; then - warning "Boot2docker detected - ensure :/data is mounted to %userprofile%" - fi - - add_file_system_test "${CHE_CONTAINER_ROOT}/test" - - if ! file_system_writable "${CHE_CONTAINER_ROOT}/test" || - ! file_system_executable "${CHE_CONTAINER_ROOT}/test"; then - error "Unable to write or execute files on your host." - error "Have you enabled Docker to allow mounting host directories?" - error "Did you give our CLI rights to create + exec files on your host?" - delete_file_system_test "${CHE_CONTAINER_ROOT}/test" - return 2; - fi - - delete_file_system_test "${CHE_CONTAINER_ROOT}/test" -} - -add_file_system_test() { - echo '#!/bin/sh' > "${1}" - echo 'echo hi' >> "${1}" - chmod +x "${1}" > /dev/null -} - -file_system_writable() { - if [[ -f "${1}" ]]; then - return 0 - else - return 1 - fi -} - -file_system_executable() { - EXEC_OUTPUT=$(bash "${1}") - if [ $EXEC_OUTPUT = "hi" ]; then - return 0 - else - return 1 - fi -} - -delete_file_system_test() { - rm -rf $1 > /dev/null 2>&1 -} - -is_boot2docker() { - if uname -r | grep -q 'boot2docker'; then - return 0 - else - return 1 - fi -} - -skip_config() { - if [ "${CHE_SKIP_CONFIG}" = "true" ]; then - return 0 - else - return 1 - fi -} diff --git a/dockerfiles/base/scripts/base/startup_03_pre_networking.sh b/dockerfiles/base/scripts/base/startup_03_pre_networking.sh deleted file mode 100644 index 0acfb6e90423..000000000000 --- a/dockerfiles/base/scripts/base/startup_03_pre_networking.sh +++ /dev/null @@ -1,267 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2017 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 -# - -init_offline_or_network_mode(){ - # If you are using ${CHE_FORMAL_PRODUCT_NAME} in offline mode, images must be loaded here - # This is the point where we know that docker is working, but before we run any utilities - # that require docker. - if is_offline; then - info "init" "Importing ${CHE_MINI_PRODUCT_NAME} Docker images from tars..." - - if [ ! -d ${CHE_CONTAINER_OFFLINE_FOLDER} ]; then - warning "Skipping offline image loading - '${CHE_CONTAINER_OFFLINE_FOLDER}' not found" - else - IFS=$'\n' - for file in "${CHE_CONTAINER_OFFLINE_FOLDER}"/*.tar - do - if ! $(docker load < "${CHE_CONTAINER_OFFLINE_FOLDER}"/"${file##*/}" > /dev/null); then - error "Failed to restore ${CHE_MINI_PRODUCT_NAME} Docker images" - return 2; - fi - info "init" "Loading ${file##*/}..." - done - fi - else - # If we are here, then we want to run in networking mode. - # If we are in networking mode, we have had some issues where users have failed DNS networking. - # See: https://github.com/eclipse/che/issues/3266#issuecomment-265464165 - if ! is_fast && ! skip_network; then - # Removing this info line as it was appearing before initial CLI output - - local HTTP_STATUS_CODE=$(curl -I -k https://hub.docker.com -s -o /dev/null --write-out '%{http_code}') - if [[ ! $HTTP_STATUS_CODE -eq "301" ]] && [[ ! $HTTP_STATUS_CODE -eq "200" ]]; then - info "Welcome to $CHE_FORMAL_PRODUCT_NAME!" - info "" - info "We could not resolve DockerHub using DNS." - info "Either we cannot reach the Internet or Docker's DNS resolver needs a modification." - info "" - info "You can:" - info " 1. Modify Docker's DNS settings." - info " a. Docker for Windows & Mac have GUIs for this." - info " b. Typically setting DNS to 8.8.8.8 fixes resolver issues." - info " 2. Does your network require Docker to use a proxy?" - info " a. Docker for Windows & Mac have GUIs to set proxies." - info " 3. Verify that you have access to DockerHub." - info " a. Try 'curl --head hub.docker.com'" - info " 4. Skip networking checks." - info " a. Add '--fast' to any command" - return 2; - fi - fi - fi -} - -init_initial_images() { - # get list of images - get_image_manifest ${CHE_VERSION} - - # grab all bootstrap images - IFS=$'\n' - for BOOTSTRAP_IMAGE_LINE in ${BOOTSTRAP_IMAGE_LIST}; do - local BOOTSTRAP_IMAGE=$(echo ${BOOTSTRAP_IMAGE_LINE} | cut -d'=' -f2) - if [ "$(docker images -q ${BOOTSTRAP_IMAGE} 2> /dev/null)" = "" ]; then - info "cli" "Pulling image ${BOOTSTRAP_IMAGE}" - log "docker pull ${BOOTSTRAP_IMAGE} >> \"${LOGS}\" 2>&1" - TEST="" - docker pull ${BOOTSTRAP_IMAGE} >> "${LOGS}" > /dev/null 2>&1 || TEST=$? - if [ "$TEST" = "1" ]; then - error "Image ${BOOTSTRAP_IMAGE} unavailable. Not on dockerhub or built locally." - return 2; - fi - fi - done - -} - -### Returns the list of ${CHE_FORMAL_PRODUCT_NAME} images for a particular version of ${CHE_FORMAL_PRODUCT_NAME} -### Sets the images as environment variables after loading from file -get_image_manifest() { - log "Checking registry for version '$1' images" - if ! has_version_registry $1; then - version_error $1 - return 1; - fi - - # Load images from file - BOOTSTRAP_IMAGE_LIST=$(cat /version/$1/images-bootstrap) - IMAGE_LIST=$(cat /version/$1/images) - if [ -z "${CHE_SINGLE_PORT:-}" ]; then - IMAGE_LIST=$(echo "${IMAGE_LIST}" | sed '/IMAGE_TRAEFIK/d') - fi - if [ -z "${CHE_MULTIUSER:-}" ]; then - IMAGE_LIST=$(echo "${IMAGE_LIST}" | sed '/IMAGE_KEY*/d; /IMAGE_POSTGRES/d') - fi - UTILITY_IMAGE_LIST=$(cat /version/$1/images-utilities) - - # set variables - set_variables_images_list "${BOOTSTRAP_IMAGE_LIST}" - set_variables_images_list "${IMAGE_LIST}" - set_variables_images_list "${UTILITY_IMAGE_LIST}" -} - -has_version_registry() { - if [ -d /version/$1 ]; then - return 0; - else - return 1; - fi -} - -version_error(){ - text "\nWe could not find version '$1'. Available versions:\n" - list_versions - text "\nSet CHE_VERSION= and rerun.\n\n" -} - -list_versions(){ - # List all subdirectories and then print only the file name - for version in /version/* ; do - text " ${version##*/}\n" - done -} - -### define variables for all image name in the given list -set_variables_images_list() { - IFS=$'\n' - REPLACEMENT='s/\(.*\)=\(.*\)/\1=${\1:-\2}/g' - for SINGLE_IMAGE in $1; do - INSTRUCTION="$(echo "${SINGLE_IMAGE}" | sed -e "${REPLACEMENT}")" - log "eval ${INSTRUCTION}" - eval "${INSTRUCTION}" - done - -} - -get_docker_install_type() { -# debug $FUNCNAME - if is_boot2docker; then - echo "boot2docker" - elif is_docker_for_windows; then - echo "docker4windows" - elif is_docker_for_mac; then - echo "docker4mac" - else - echo "native" - fi -} - -has_docker_for_windows_client(){ -# debug $FUNCNAME - if [[ "${GLOBAL_HOST_IP}" = "10.0.75.2" ]]; then - return 0 - else - return 1 - fi -} - -is_docker_for_windows() { -# debug $FUNCNAME - if $(echo ${UNAME_R} | grep -q 'linuxkit') && has_docker_for_windows_client; then - return 0 - elif $(echo ${UNAME_R} | grep -q 'moby') && has_docker_for_windows_client; then - return 0 - else - return 1 - fi -} - -is_docker_for_mac() { -# debug $FUNCNAME - if $(echo ${UNAME_R} | grep -q 'linuxkit') && ! has_docker_for_windows_client; then - return 0 - elif $(echo ${UNAME_R} | grep -q 'moby') && ! has_docker_for_windows_client; then - return 0 - else - return 1 - fi -} - -is_native() { -# debug $FUNCNAME - if [ $(get_docker_install_type) = "native" ]; then - return 0 - else - return 1 - fi -} - - -docker_run() { -# debug $FUNCNAME - # Setup options for connecting to docker host - if [ -z "${DOCKER_HOST+x}" ]; then - DOCKER_HOST="/var/run/docker.sock" - fi - - echo "" > /tmp/docker_run_vars - # Add environment variables for CHE - while IFS='=' read -r -d '' key value; do - if [[ ${key} == "CHE_"* ]]; then - echo ${key}=${value} >> /tmp/docker_run_vars - fi - done < <(env -0) - - # Add scripts global variables for CHE - while read key; do - if [[ ${key} == "CHE_"* ]]; then - local ENV_VAL="${!key}" - echo ${key}=${ENV_VAL} >> /tmp/docker_run_vars - fi - done < <(compgen -v) - - - if [ -S "$DOCKER_HOST" ]; then - docker run --rm --env-file /tmp/docker_run_vars \ - -v $DOCKER_HOST:$DOCKER_HOST \ - -v $HOME:$HOME \ - -w "$(pwd)" "$@" - else - docker run --rm --env-file /tmp/docker_run_vars \ - -e DOCKER_HOST -e DOCKER_TLS_VERIFY -e DOCKER_CERT_PATH \ - -v $HOME:$HOME \ - -w "$(pwd)" "$@" - fi -} - -has_curl() { - hash curl 2>/dev/null && return 0 || return 1 -} - -curl() { - - # In situations where we are performing internal pings using curl, then - # we should append the CHE_HOST as a no proxy. It seems that curl does - # not respect the NO_PROXY environment variable set on the system. - local NO_PROXY_CONFIG_FOR_CURL=("") - if [[ ! "${HTTP_PROXY}" = "" ]] || - [[ ! "${HTTPS_PROXY}" = "" ]]; then - if is_var_defined "${CHE_PRODUCT_NAME}_HOST"; then - NO_PROXY_CONFIG_FOR_CURL=("--noproxy" $(eval "echo \$${CHE_PRODUCT_NAME}_HOST")) - fi - fi - - if ! has_curl; then - log "docker run --rm --net=host appropriate/curl \"$@\"" - docker run --rm --net=host appropriate/curl ${NO_PROXY_CONFIG_FOR_CURL[@]} "$@" - else - log "$(which curl) ${NO_PROXY_CONFIG_FOR_CURL[@]} \"$@\"" - $(which curl) ${NO_PROXY_CONFIG_FOR_CURL[@]} "$@" - fi -} - -is_var_defined() { - if [ $# -ne 1 ] - then - echo "Expected exactly one argument: variable name as string, e.g., 'my_var'" - exit 1 - fi - eval "[ ! -z \${$1:-} ]" - return $? -} diff --git a/dockerfiles/base/scripts/base/startup_04_pre_cli_init.sh b/dockerfiles/base/scripts/base/startup_04_pre_cli_init.sh deleted file mode 100644 index b65ff44ac140..000000000000 --- a/dockerfiles/base/scripts/base/startup_04_pre_cli_init.sh +++ /dev/null @@ -1,413 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2017 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 -# - -cli_pre_init() { - : -} - -cli_post_init() { - : -} - -cli_init() { - CHE_HOST=$(eval "echo \$${CHE_PRODUCT_NAME}_HOST") - CHE_PORT=$(eval "echo \$${CHE_PRODUCT_NAME}_PORT") - - if [[ "$(eval "echo \$${CHE_PRODUCT_NAME}_HOST")" = "" ]]; then - info "Welcome to $CHE_FORMAL_PRODUCT_NAME!" - info "" - info "We did not auto-detect a valid HOST or IP address." - info "Pass ${CHE_PRODUCT_NAME}_HOST with your hostname or IP address." - info "" - info "Rerun the CLI:" - info " docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock" - info " -v :${CHE_CONTAINER_ROOT}" - info " -e ${CHE_PRODUCT_NAME}_HOST=" - info " $CHE_IMAGE_FULLNAME $*" - return 2; - fi - - CLI_ENV_ARRAY_LENGTH=$(docker inspect --format='{{json .Config.Env}}' $(get_this_container_id) | jq '. | length') - CLI_ENV_ARRAY=() - # fill an array - che_cli_env_arr_index="0" - while [ $che_cli_env_arr_index -lt $CLI_ENV_ARRAY_LENGTH ]; do - CLI_ENV_ARRAY[$che_cli_env_arr_index]=$(docker inspect --format='{{json .Config.Env}}' $(get_this_container_id) | jq -r .[$che_cli_env_arr_index]) - che_cli_env_arr_index=$[$che_cli_env_arr_index+1] - done - - CHE_HOST_PROTOCOL="http" - if is_initialized; then - CHE_HOST_LOCAL=$(get_value_of_var_from_env_file ${CHE_PRODUCT_NAME}_HOST) - CHE_HOST_ENV=$(get_value_of_var_from_env ${CHE_PRODUCT_NAME}_HOST) - if [[ "${CHE_HOST_ENV}" != "" ]] && - [[ "${CHE_HOST_ENV}" != "${CHE_HOST_LOCAL}" ]]; then - warning "cli" "'${CHE_PRODUCT_NAME}_HOST=${CHE_HOST_ENV}' from command line overriding '${CHE_PRODUCT_NAME}_HOST=${CHE_HOST_LOCAL}' from ${CHE_ENVIRONMENT_FILE}" - CHE_HOST=$CHE_HOST_ENV - fi - - CHE_HOST_PROTOCOL_ENV=$(get_value_of_var_from_env_file ${CHE_PRODUCT_NAME}_HOST_PROTOCOL) - if [[ "${CHE_HOST_PROTOCOL_ENV}" != "" ]]; then - CHE_HOST_PROTOCOL=${CHE_HOST_PROTOCOL_ENV} - fi - - if [[ "${CHE_HOST_ENV}" = "" ]] && - [[ "${CHE_HOST_LOCAL}" != "" ]]; then - CHE_HOST=${CHE_HOST_LOCAL} - - if [[ "${CHE_HOST}" != "${GLOBAL_HOST_IP}" ]]; then - warning "cli" "'${CHE_PRODUCT_NAME}_HOST=${CHE_HOST_LOCAL}' is != discovered IP '${GLOBAL_HOST_IP}'" - fi - fi - - CHE_PORT_LOCAL=$(get_value_of_var_from_env_file ${CHE_PRODUCT_NAME}_PORT) - CHE_PORT_ENV=$(get_value_of_var_from_env ${CHE_PRODUCT_NAME}_PORT) - - if [[ "${CHE_PORT_ENV}" != "" ]] && - [[ "${CHE_PORT_LOCAL}" != "" ]] && - [[ "${CHE_PORT_ENV}" != "${CHE_PORT_LOCAL}" ]]; then - warning "cli" "'${CHE_PRODUCT_NAME}_PORT=${CHE_PORT_ENV}' from command line overriding '${CHE_PRODUCT_NAME}_PORT=${CHE_PORT_LOCAL}' from ${CHE_ENVIRONMENT_FILE}" - CHE_PORT=$CHE_PORT_ENV - fi - - if [[ "${CHE_PORT_ENV}" = "" ]] && - [[ "${CHE_PORT_LOCAL}" != "" ]]; then - CHE_PORT=${CHE_PORT_LOCAL} - - if [[ "${CHE_PORT}" != "${DEFAULT_CHE_PORT}" ]]; then - CHE_PORT=${CHE_PORT_LOCAL} - fi - fi - fi -} - -cli_verify_nightly() { - # Per request of the engineers, check to see if the locally cached nightly version is older - # than the one stored on DockerHub. - if is_nightly; then - - if ! is_fast && ! skip_nightly; then - local CURRENT_DIGEST=$(docker images -q --no-trunc --digests ${CHE_IMAGE_FULLNAME}) - - update_image $CHE_IMAGE_FULLNAME - - local NEW_DIGEST=$(docker images -q --no-trunc --digests ${CHE_IMAGE_FULLNAME}) - if [[ "${CURRENT_DIGEST}" != "${NEW_DIGEST}" ]]; then - # Per CODENVY-1773 - removes orphaned nightly image - warning "Pulled new 'nightly' image - please rerun CLI" - docker rmi -f $(docker images --filter "dangling=true" -q $CHE_IMAGE_NAME) 2>/dev/null - return 2; - fi - fi - fi -} - -cli_verify_version() { - # Do not perform a version compatibility check if running upgrade command. - # The upgrade command has its own internal checks for version compatibility. - if [[ "$@" == *"upgrade"* ]]; then - verify_upgrade - elif ! is_fast; then - verify_version - fi -} - -is_nightly() { - if [[ $(get_image_version) = "nightly" ]]; then - return 0 - else - return 1 - fi -} - -verify_version() { - - ## If ! is_initialized, then the system hasn't been installed - ## First, compare the CLI image version to what version was initialized in /config/*.ver.donotmodify - ## - If they match, good - ## - If they don't match and one is nightly, fail - ## - If they don't match, then if CLI is older fail with message to get proper CLI - ## - If they don't match, then if CLLI is newer fail with message to run upgrade first - CHE_IMAGE_VERSION=$(get_image_version) - - # Only check for newer versions if not: skip network, offline, nightly. - if ! is_offline && ! is_nightly && ! is_fast && ! skip_network; then - NEWER=$(compare_versions $CHE_IMAGE_VERSION) - if [[ "${NEWER}" == "null" ]]; then - warning "Unable to retrieve version list from public Docker Hub for image named ${CHE_IMAGE_NAME}." - warning "Diagnose with 'docker run -it appropriate/curl -s https://hub.docker.com/v2/repositories/${CHE_IMAGE_NAME}/tags/'." - warning "Use '--skip:network' to ignore this check." - elif [[ "${NEWER}" != "" ]]; then - warning "Newer version '$NEWER' available" - fi - fi - - if is_initialized; then - COMPARE_CLI_ENV=$(compare_cli_version_to_installed_version) - INSTALLED_VERSION=$(get_installed_version) - case "${COMPARE_CLI_ENV}" in - "match") - ;; - "nightly") - error "" - error "Your CLI version '${CHE_IMAGE_FULLNAME}' does not match your installed version '$INSTALLED_VERSION' in ${DATA_MOUNT}." - error "" - error "The 'nightly' CLI is only compatible with 'nightly' installed versions." - error "You may use 'nightly' with a separate ${CHE_FORMAL_PRODUCT_NAME} installation by providing a different ':/data' volume mount." - error "You may not '${CHE_MINI_PRODUCT_NAME} upgrade' from 'nightly' to a numbered (tagged) version." - error "" - error "Run the CLI as '${CHE_IMAGE_NAME}:' to install a tagged version." - return 2 - ;; - "install-less-cli") - error "" - error "Your CLI version '${CHE_IMAGE_FULLNAME}' is newer than your installed version '$INSTALLED_VERSION'." - error "" - error "Run '${CHE_IMAGE_FULLNAME} upgrade' to migrate your installation to '$CHE_IMAGE_VERSION'." - error "Or, run the CLI with '${CHE_IMAGE_NAME}:$INSTALLED_VERSION' to match the CLI with your installed version." - return 2 - ;; - "cli-less-install") - error "" - error "Your CLI version '${CHE_IMAGE_FULLNAME}' is older than your installed version '$INSTALLED_VERSION'." - error "" - error "You cannot use an older CLI with a newer installation." - error "" - error "Run the CLI with '${CHE_IMAGE_NAME}:$INSTALLED_VERSION' to match the CLI with your existing installed version." - return 2 - ;; - esac - fi -} - -verify_upgrade() { - ## Two levels of checks - ## First, compare the CLI image version to what the admin has configured in /config/.env file - ## - If they match, nothing to upgrade - ## - If they don't match and one is nightly, fail upgrade is not supported for nightly - ## - If they don't match, then if CLI is older fail with message that we do not support downgrade - ## - If they don't match, then if CLI is newer then good - CHE_IMAGE_VERSION=$(get_image_version) - - if ! is_initialized || ! is_configured; then - info "upgrade" "$CHE_MINI_PRODUCT_NAME is not installed or configured. Nothing to upgrade." - return 2 - fi - - if is_initialized; then - COMPARE_CLI_ENV=$(compare_cli_version_to_installed_version) - CONFIGURED_VERSION=$(get_installed_version) - - case "${COMPARE_CLI_ENV}" in - "match") - error "" - error "Your CLI version '${CHE_IMAGE_FULLNAME}' is identical to your installed version '$CONFIGURED_VERSION'." - error "" - error "Run '${CHE_IMAGE_NAME}: upgrade' with a newer version to upgrade." - error "View available versions with '${CHE_IMAGE_FULLNAME} version'." - return 2 - ;; - "nightly") - error "" - error "Your CLI version '${CHE_IMAGE_FULLNAME}' or installed version '$CONFIGURED_VERSION' is nightly." - error "" - error "You may not '${CHE_IMAGE_NAME} upgrade' from 'nightly' to a numbered (tagged) version." - error "You can 'docker pull ${CHE_IMAGE_FULLNAME}' to get a newer nightly version." - return 2 - ;; - "install-less-cli") - ;; - "cli-less-install") - error "" - error "Your CLI version '${CHE_IMAGE_FULLNAME}' is older than your installed version '$CONFIGURED_VERSION'." - error "" - error "You cannot use '${CHE_IMAGE_NAME} upgrade' to downgrade versions." - error "" - error "Run '${CHE_IMAGE_NAME}: upgrade' with a newer version to upgrade." - error "View available versions with '${CHE_IMAGE_FULLNAME} version'." - return 2 - ;; - esac - fi -} - -get_installed_version() { - if ! is_initialized; then - echo "" - else - cat "${CHE_CONTAINER_INSTANCE}"/$CHE_VERSION_FILE - fi -} - -get_image_version() { - echo "$CHE_IMAGE_VERSION" -} - -# Check if a version is < than another version (provide like for example : version_lt 5.0 5.1) -version_lt() { - test "$(printf '%s\n' "$@" | sort -V | head -n 1)" == "$1"; - return $?; -} - -# return true if the provided version is an intermediate version (like a Milestone or a Release Candidate) -is_intermediate_version() { - if [[ "$1" =~ .*-M.* ]]; then - return 0 - fi - if [[ "$1" =~ .*-RC.* ]]; then - return 0 - fi - return 1 -} - -# Compares $1 version to the first 10 versions listed as tags on Docker Hub -# Returns "" if $1 is newest, otherwise returns the newest version available -# Does not work with nightly versions - do not use this to compare nightly to another version -compare_versions() { - - local VERSION_LIST_JSON=$(curl -s https://hub.docker.com/v2/repositories/${CHE_IMAGE_NAME}/tags/) - local NUMBER_OF_VERSIONS=$(echo $VERSION_LIST_JSON | jq '.count') - - if [[ "${NUMBER_OF_VERSIONS}" = "" ]] || [[ "${NUMBER_OF_VERSIONS}" = "null" ]]; then - echo "null" - return - fi - - DISPLAY_LIMIT=10 - if [ $DISPLAY_LIMIT -gt $NUMBER_OF_VERSIONS ]; then - DISPLAY_LIMIT=$NUMBER_OF_VERSIONS - fi - - # Strips off -M#, -latest version information - BASE_VERSION=$(echo $1 | cut -f1 -d"-") - - COUNTER=0 - RETURN_VERSION="" - while [ $COUNTER -lt $DISPLAY_LIMIT ]; do - TAG=$(echo $VERSION_LIST_JSON | jq ".results[$COUNTER].name") - TAG=${TAG//\"} - - if [ "$TAG" != "nightly" ] && [ "$TAG" != "latest" ] && [ "$TAG" != "${BASE_VERSION}" ]; then - if version_lt $BASE_VERSION $TAG; then - RETURN_VERSION=$TAG - break; - fi - fi - let COUNTER=COUNTER+1 - done - - echo $RETURN_VERSION -} - -compare_cli_version_to_installed_version() { - IMAGE_VERSION=$(get_image_version) - INSTALLED_VERSION=$(get_installed_version) - - # add -ZZ suffix if not intermediate version - # So for example 5.0.0 is transformed into 5.0.0-ZZ and is greater than 5.0.0-M8 - IMAGE_VERSION_SUFFIXED=${IMAGE_VERSION} - INSTALLED_VERSION_SUFFIXED=${INSTALLED_VERSION} - if ! is_intermediate_version ${IMAGE_VERSION}; then - IMAGE_VERSION_SUFFIXED="${IMAGE_VERSION}-ZZ" - fi - if ! is_intermediate_version ${INSTALLED_VERSION}; then - INSTALLED_VERSION_SUFFIXED="${INSTALLED_VERSION}-ZZ" - fi - - if [[ "$INSTALLED_VERSION" = "$IMAGE_VERSION" ]]; then - echo "match" - elif [ "$INSTALLED_VERSION" = "nightly" ] || - [ "$IMAGE_VERSION" = "nightly" ]; then - echo "nightly" - elif version_lt $INSTALLED_VERSION_SUFFIXED $IMAGE_VERSION_SUFFIXED; then - echo "install-less-cli" - else - echo "cli-less-install" - fi -} - -is_initialized() { - if [[ -d "${CHE_CONTAINER_INSTANCE}" ]] && \ - [[ -f "${CHE_CONTAINER_INSTANCE}"/$CHE_VERSION_FILE ]] && \ - [[ -f "${REFERENCE_CONTAINER_ENVIRONMENT_FILE}" ]]; then - return 0 - else - return 1 - fi -} - -is_configured() { - if [[ -d "${CHE_CONTAINER_INSTANCE}/config" ]] && \ - [[ -f "${CHE_CONTAINER_INSTANCE}/${CHE_VERSION_FILE}" ]]; then - return 0 - else - return 1 - fi -} - -update_image() { - if [ "${1}" == "--force" ]; then - shift - info "download" "Removing image $1" - log "docker rmi -f $1 >> \"${LOGS}\"" - docker rmi -f $1 >> "${LOGS}" 2>&1 || true - fi - - if [ "${1}" == "--pull" ]; then - shift - fi - - info "download" "Pulling image $1" - text "\n" - log "docker pull $1 >> \"${LOGS}\" 2>&1" - TEST="" - docker pull $1 || TEST=$? - if [ "$TEST" = "1" ]; then - error "Image $1 unavailable. Not on dockerhub or built locally." - return 2; - fi - text "\n" -} - -# Input is a variable that would exist in the che.env file such as CHE_HOST. -# We then lookup the vlaue of this variable and return it -get_value_of_var_from_env_file() { - local LOOKUP_LOCAL=$(docker_run --env-file="${REFERENCE_CONTAINER_ENVIRONMENT_FILE}" \ - ${BOOTSTRAP_IMAGE_ALPINE} sh -c "echo \$$1") - echo $LOOKUP_LOCAL -} - -# Returns the value of variable from environment array. -get_value_of_var_from_env() { - for element in "${CLI_ENV_ARRAY[@]}" - do - var1=$(echo $element | cut -f1 -d=) - var2=$(echo $element | cut -f2 -d=) - - if [ $var1 = $1 ]; then - echo $var2 - fi - done - echo "" -} - -# This will compare two same length strings, such as versions -less_than() { - for (( i=0; i<${#1}; i++ )); do - if [[ ${1:$i:1} != ${2:$i:1} ]]; then - if [ ${1:$i:1} -lt ${2:$i:1} ]; then - return 0 - else - return 1 - fi - fi - done - return 1 -} diff --git a/dockerfiles/base/scripts/base/startup_05_pre_exec.sh b/dockerfiles/base/scripts/base/startup_05_pre_exec.sh deleted file mode 100644 index 67ae3f5cec5a..000000000000 --- a/dockerfiles/base/scripts/base/startup_05_pre_exec.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2017 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 -# - -cli_load() { - # Library contains reusable functions - source "${SCRIPTS_BASE_CONTAINER_SOURCE_DIR}"/library.sh - - if [ -f "${SCRIPTS_CONTAINER_SOURCE_DIR}"/library.sh ]; then - source "${SCRIPTS_CONTAINER_SOURCE_DIR}"/library.sh - fi -} - -cli_parse () { - COMMAND="cmd_$1" - - case $1 in - init|config|start|stop|restart|backup|restore|info|offline|destroy|download|\ - rmi|upgrade|version|ssh|sync|action|test|compile|dir|help|archetype) - ;; - *) - error "You passed an unknown command: $1" - usage - return 2 - ;; - esac -} - -cli_execute() { - cmd_lifecycle "$@" -} - -cmd_lifecycle() { - local PRE_COMMAND="pre_cmd_$1" - local POST_COMMAND="post_cmd_$1" - local HELP_COMMAND="help_cmd_$1" - local COMMAND="cmd_$1" - - if [ -f "${SCRIPTS_BASE_CONTAINER_SOURCE_DIR}"/commands/cmd_$1.sh ]; then - source "${SCRIPTS_BASE_CONTAINER_SOURCE_DIR}"/commands/cmd_$1.sh - fi - - if [ -f "${SCRIPTS_CONTAINER_SOURCE_DIR}"/cmd_$1.sh ]; then - source "${SCRIPTS_CONTAINER_SOURCE_DIR}"/cmd_$1.sh - fi - - shift - - if get_command_help; then - ANSWER=$(declare -f $HELP_COMMAND > /dev/null) - if [ $? = "0" ]; then - eval $HELP_COMMAND "$@" - return 2 - else - error "No help function found for $1" - fi - fi - - local PRE_COMMAND_STATUS=0 - ANSWER=$(declare -f $PRE_COMMAND ) # > /dev/null) - if [ $? = "0" ]; then - eval $PRE_COMMAND "$@" - PRE_COMMAND_STATUS=$? - fi - - eval $COMMAND "$@" - local COMMAND_STATUS=$? - - - - local POST_COMMAND_STATUS=0 - ANSWER=$(declare -f $POST_COMMAND > /dev/null) - if [ $? = "0" ]; then - eval $POST_COMMAND "$@" - POST_COMMAND_STATUS=$? - fi - - if [[ POST_COMMAND_STATUS -ne 0 ]]; then - return ${POST_COMMAND_STATUS}; - else - return ${COMMAND_STATUS}; - fi -} diff --git a/dockerfiles/base/scripts/entrypoint.sh b/dockerfiles/base/scripts/entrypoint.sh deleted file mode 100644 index f198ce4e42e3..000000000000 --- a/dockerfiles/base/scripts/entrypoint.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2017 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 -# - -source /scripts/base/startup.sh -start "$@" - diff --git a/dockerfiles/bats/Dockerfile b/dockerfiles/bats/Dockerfile deleted file mode 100644 index fe8490bec621..000000000000 --- a/dockerfiles/bats/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2012-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 -# -# Contributors: -# Marian Labuda -FROM docker:1.11.2 - -# ncurses is used to use --pretty option of bats -RUN apk add --no-cache bash ncurses - -RUN curl -o /tmp/v0.4.0.tar.gz -L https://github.com/sstephenson/bats/archive/v0.4.0.tar.gz \ - && tar -x -z -f /tmp/v0.4.0.tar.gz -C /tmp \ - && bash /tmp/bats-0.4.0/install.sh /usr/local \ - && rm -rf /tmp/* \ - && curl -o /tmp/bats-support-v0.3.0.tar.gz -L https://github.com/ztombol/bats-support/archive/v0.3.0.tar.gz \ - && tar -x -z -f /tmp/bats-support-v0.3.0.tar.gz -C /tmp \ - && mv /tmp/bats-support-0.3.0/ /bats-support \ - && rm -rf /bats-support/test && rm -rf /bats-support/script \ - && rm -rf /tmp/* \ - && curl -o /tmp/bats-assert-v0.3.0.tar.gz -L https://github.com/ztombol/bats-assert/archive/v0.3.0.tar.gz \ - && tar -x -z -f /tmp/bats-assert-v0.3.0.tar.gz -C /tmp \ - && mv /tmp/bats-assert-0.3.0 /bats-assert \ - && rm -rf /bats-assert/test && rm -rf /bats-assert/script \ - && rm -rf /tmp/* diff --git a/dockerfiles/bats/build.sh b/dockerfiles/bats/build.sh deleted file mode 100755 index 7a784bf1c2f0..000000000000 --- a/dockerfiles/bats/build.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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:bats "$@" -build diff --git a/dockerfiles/cli/.dockerignore b/dockerfiles/cli/.dockerignore deleted file mode 100644 index 2b29f27645f8..000000000000 --- a/dockerfiles/cli/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -tests diff --git a/dockerfiles/cli/.gitignore b/dockerfiles/cli/.gitignore deleted file mode 100644 index b70f3c5ce35c..000000000000 --- a/dockerfiles/cli/.gitignore +++ /dev/null @@ -1 +0,0 @@ -tests/testrun/* diff --git a/dockerfiles/cli/.require b/dockerfiles/cli/.require deleted file mode 100644 index 82ae8bdc3a4c..000000000000 --- a/dockerfiles/cli/.require +++ /dev/null @@ -1,4 +0,0 @@ -base -bats -che -init diff --git a/dockerfiles/cli/Dockerfile b/dockerfiles/cli/Dockerfile deleted file mode 100644 index 785c9ed2237a..000000000000 --- a/dockerfiles/cli/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2017 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 -# -# build: -# docker build -t eclipse/che-cli . -# -# use: -# docker run -v $(pwd):/che eclipse/che-cli [command] -FROM ${BUILD_ORGANIZATION}/${BUILD_PREFIX}-base:${BUILD_TAG} - -COPY scripts /scripts/ -COPY version /version/ - -RUN mkdir /che -ENTRYPOINT ["/scripts/entrypoint.sh"] diff --git a/dockerfiles/cli/build.sh b/dockerfiles/cli/build.sh deleted file mode 100755 index feb8dab0b875..000000000000 --- a/dockerfiles/cli/build.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2017 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:cli "$@" - -# Define space separated list of aliases for the docker image -IMAGE_ALIASES="${ORGANIZATION}/${PREFIX}" - -if [[ ! -f "${base_dir}/version/$TAG/images" ]]; then - mkdir -p ${base_dir}/version/$TAG/ - cat ${base_dir}/images.template | sed s/\$\{BUILD_ORGANIZATION\}/${ORGANIZATION}/ | sed s/\$\{BUILD_PREFIX\}/${PREFIX}/ | sed s/\$\{BUILD_TAG\}/${TAG}/ > ${base_dir}/version/$TAG/images -fi - - -build - -if ! skip_tests; then - bash "${base_dir}"/test.sh "$@" -fi diff --git a/dockerfiles/cli/images.template b/dockerfiles/cli/images.template deleted file mode 100644 index 54d5e2bcb1d5..000000000000 --- a/dockerfiles/cli/images.template +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=${BUILD_ORGANIZATION}/${BUILD_PREFIX}-init:${BUILD_TAG} -IMAGE_CHE=${BUILD_ORGANIZATION}/${BUILD_PREFIX}-server:${BUILD_TAG} -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/scripts/post_init.sh b/dockerfiles/cli/scripts/post_init.sh deleted file mode 100644 index f5b4af57ca3f..000000000000 --- a/dockerfiles/cli/scripts/post_init.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2017 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 -# - -post_init() { - GLOBAL_HOST_IP=${GLOBAL_HOST_IP:=$(docker_run --net host ${BOOTSTRAP_IMAGE_CHEIP})} - DEFAULT_CHE_HOST=$GLOBAL_HOST_IP - CHE_HOST=${CHE_HOST:-${DEFAULT_CHE_HOST}} -} diff --git a/dockerfiles/cli/scripts/pre_init.sh b/dockerfiles/cli/scripts/pre_init.sh deleted file mode 100644 index c057302ca6e8..000000000000 --- a/dockerfiles/cli/scripts/pre_init.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2017 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 -# - -pre_init() { - ADDITIONAL_MANDATORY_PARAMETERS="" - ADDITIONAL_OPTIONAL_DOCKER_PARAMETERS=" - -e CHE_HOST= IP address or hostname where che will serve its users - -e CHE_PORT= Port where che will bind itself to - -e CHE_CONTAINER= Name for the che container - -u [:] (Linux Only) Runs che with specific user and group identity" - ADDITIONAL_OPTIONAL_DOCKER_MOUNTS="" - ADDITIONAL_COMMANDS="" - ADDITIONAL_GLOBAL_OPTIONS="" - - # This must be incremented when BASE is incremented by an API developer - CHE_CLI_API_VERSION=2 - - DEFAULT_CHE_PORT=8080 - CHE_PORT=${CHE_PORT:-${DEFAULT_CHE_PORT}} - CHE_MIN_RAM=1.5 - CHE_MIN_DISK=100 -} - diff --git a/dockerfiles/cli/test.sh b/dockerfiles/cli/test.sh deleted file mode 100755 index f91ed86a5a07..000000000000 --- a/dockerfiles/cli/test.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2012-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 -# -# Contributors: -# Marian Labuda - Initial Implementation - -BATS_BASE_DIR=$(cd "$(dirname "$0")"/..; pwd) -. "${BATS_BASE_DIR}"/build.include -BATS_BASE_DIR=$(get_mount_path "${BATS_BASE_DIR}") - -init --name:bats "$@" - -DOCKER_RUN_OPTIONS="" -BATS_OPTIONS="" -# run bats with terminal mode (pretty print) if supported by current shell -if [ -t 1 ]; then - DOCKER_RUN_OPTIONS="-t" - BATS_OPTIONS="--pretty" -else - BATS_OPTIONS="--tap" -fi - -# Runs functional CLI tests in a docker container. -# Pass a file name of functional bats tests as an argument. -# The file has to be placed in tests folder in directory containing this script -# (Optional) second argument is options for a docker run command. -run_test_in_docker_container() { - docker_exec run --rm ${DOCKER_RUN_OPTIONS} $2 \ - -v "${BATS_BASE_DIR}":/dockerfiles \ - -e CLI_IMAGE="$ORGANIZATION/$PREFIX-cli:$TAG" \ - -e BATS_BASE_DIR="${BATS_BASE_DIR}" \ - -v /var/run/docker.sock:/var/run/docker.sock \ - $IMAGE_NAME bats ${BATS_OPTIONS} /dockerfiles/cli/tests/$1 -} - -echo "Running tests in container from image $IMAGE_NAME" -echo "Running functionals bats tests for overriding images" -run_test_in_docker_container override_image_tests.bats "" -echo "Running functional bats tests for CLI prompts and usage" -run_test_in_docker_container cli_prompts_usage_tests.bats "" -echo "Running functionals bats tests for config command" -run_test_in_docker_container cmd_config_tests.bats "" -echo "Running functionals bats tests for info command" -run_test_in_docker_container cmd_info_tests.bats "" -echo "Running functional bats tests for init and destroy commands" -run_test_in_docker_container cmd_init_destroy_tests.bats "" -echo "Running functionals bats tests for start, stop, restart command" -run_test_in_docker_container cmd_start_stop_restart_tests.bats --net=host -echo "Running functionals bats tests for backup / restore commands" -run_test_in_docker_container cmd_backup_restore_tests.bats "" -echo "Running functionals bats tests for offline command" -run_test_in_docker_container cmd_offline_tests.bats "" -run_test_in_docker_container startup_03_pre_networking_tests.bats "" diff --git a/dockerfiles/cli/tests/cli_prompts_usage_tests.bats b/dockerfiles/cli/tests/cli_prompts_usage_tests.bats deleted file mode 100644 index 514145bc9c28..000000000000 --- a/dockerfiles/cli/tests/cli_prompts_usage_tests.bats +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env bats -# Copyright (c) 2012-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 -# -# Contributors: -# Marian Labuda - Initial Implementation - -load '/bats-support/load.bash' -load '/bats-assert/load.bash' -source /dockerfiles/cli/tests/test_base.sh - -@test "test CLI prompt to provide volume for docker sock" { - #GIVEN - prompt_substring="-v /var/run/docker.sock:/var/run/docker.sock" - - #WHEN - run execute_cli_command --che-cli-mount-scripts=false --che-cli-use-docker-sock=false --che-cli-command=start - - #THEN - assert_failure - assert_output --partial ${prompt_substring} -} - -@test "test CLI prompt to provide directory for user data" { - #GIVEN - prompt_substring="-v :/data" - - #WHEN - run execute_cli_command --che-cli-command=start - - #THEN - assert_failure - assert_output --partial ${prompt_substring} -} - -@test "test CLI 'usage' when running container without command" { - #GIVEN - expected_output="USAGE:" - - #WHEN - result=$(execute_cli_command || true) - - #THEN - [[ $result == *${expected_output}* ]] -} diff --git a/dockerfiles/cli/tests/cmd_backup_restore_tests.bats b/dockerfiles/cli/tests/cmd_backup_restore_tests.bats deleted file mode 100644 index 3fc441870385..000000000000 --- a/dockerfiles/cli/tests/cmd_backup_restore_tests.bats +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env bats -# Copyright (c) 2017 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: -# Roman Iuvshyn - -source /dockerfiles/cli/tests/test_base.sh - -# Kill running che server instance if there is any to be able to run tests -setup() { - kill_running_named_container che - remove_named_container che -} - -teardown() { - kill_running_named_container che - remove_named_container che -} - -@test "test cli 'backup' command: backup fail if che is running" { - #GIVEN - if [ ! port_is_free 8080 ]; then - [ "$status" -eq 1 ] - [ "$output" = "Default port 8080 for che server is used. Cannot run this test on default che server port" ] - fi - tmp_path="${TESTRUN_DIR}"/cli_cmd_backup_fail_if_che_is_running - mkdir -p "${tmp_path}" - execute_cli_command --che-data-path=${tmp_path} --che-cli-command=start --che-cli-extra-options="--skip:nightly --skip:pull" - check_che_state - #WHEN - result=$(execute_cli_command --che-data-path=${tmp_path} --che-cli-command=backup --che-cli-extra-options="--skip:nightly --skip:pull" || true) - - #THEN - [[ $result == *"che is running. Stop before performing a backup."* ]] -} - -@test "test cli 'restore' command: restore fail if che is running" { - #GIVEN - if [ ! port_is_free 8080 ]; then - [ "$status" -eq 1 ] - [ "$output" = "Default port 8080 for che server is used. Cannot run this test on default che server port" ] - fi - tmp_path="${TESTRUN_DIR}"/cli_cmd_restore_fail_if_che_is_running - mkdir -p "${tmp_path}" - execute_cli_command --che-data-path=${tmp_path} --che-cli-command=start --che-cli-extra-options="--skip:nightly --skip:pull" - check_che_state - #WHEN - result=$(execute_cli_command --che-data-path=${tmp_path} --che-cli-command=restore --che-cli-extra-options="--quiet --skip:nightly --skip:pull") - - #THEN - [[ $result == *"Eclipse Che is running. Stop before performing a restore."* ]] -} - -@test "test cli 'restore' command: restore fail if no backup found" { - #GIVEN - if [ ! port_is_free 8080 ]; then - [ "$status" -eq 1 ] - [ "$output" = "Default port 8080 for che server is used. Cannot run this test on default che server port" ] - fi - tmp_path="${TESTRUN_DIR}"/cli_cmd_restore_fail_if_no_backup_found - mkdir -p "${tmp_path}" - execute_cli_command --che-data-path=${tmp_path} --che-cli-command=start --che-cli-extra-options="--skip:nightly --skip:pull" - check_che_state - execute_cli_command --che-data-path=${tmp_path} --che-cli-command=stop --che-cli-extra-options="--skip:nightly --skip:pull" - - #WHEN - result=$(execute_cli_command --che-data-path=${tmp_path} --che-cli-command=restore --che-cli-extra-options="--quiet --skip:nightly --skip:pull") - - #THEN - [[ $result == *"Backup files not found. To do restore please do backup first."* ]] -} - -@test "test cli 'backup / restore' commands" { - # TEST BACKUP - #GIVEN - if [ ! port_is_free 8080 ]; then - [ "$status" -eq 1 ] - [ "$output" = "Default port 8080 for che server is used. Cannot run this test on default che server port" ] - fi - tmp_path="${TESTRUN_DIR}"/cli_cmd_backup_do_backup_restore - container_tmp_path="${CONTAINER_TESTRUN_DIR}"/cli_cmd_backup_do_backup_restore - workspace_name="backup-restore" - mkdir -p "${tmp_path}" - #start che - execute_cli_command --che-data-path=${tmp_path} --che-cli-command=start --che-cli-extra-options="--skip:nightly --skip:pull" - check_che_state - #create a workspace - - ws_create=$(curl 'http://'${ip_address}':8080/api/workspace?namespace=che&attribute=stackId:java-default' -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept: application/json, text/plain, */*' --data-binary '{"defaultEnv":"wksp-1p0b","environments":{"wksp-1p0b":{"recipe":{"location":"eclipse/ubuntu_jdk8","type":"dockerimage"},"machines":{"dev-machine":{"servers":{},"installers":["org.eclipse.che.exec","org.eclipse.che.terminal","org.eclipse.che.ws-agent","org.eclipse.che.ssh"],"attributes":{"memoryLimitBytes":"2147483648"}}}}},"projects":[],"commands":[{"commandLine":"mvn clean install -f ${current.project.path}","name":"build","type":"mvn","attributes":{"goal":"Build","previewUrl":""}}],"name":"backup-restore","links":[]}' --compressed) - [[ "$ws_create" == *"created"* ]] - [[ "$ws_create" == *"STOPPED"* ]] - #stop che - execute_cli_command --che-data-path=${tmp_path} --che-cli-command=stop --che-cli-extra-options="--skip:nightly --skip:pull" - - #WHEN - backup=$(execute_cli_command --che-data-path=${tmp_path} --che-cli-command=backup --che-cli-extra-options="--skip:nightly --skip:pull") - - #THEN - [[ "$backup" == *"Saving Eclipse Che data..."* ]] - [[ "$backup" == *"che data saved in ${tmp_path}/backup/che_backup.tar.gz"* ]] - [[ -f "${container_tmp_path}"/backup/che_backup.tar.gz ]] - - # TEST RESTORE - #GIVEN - #destroy to wipe data - execute_cli_command --che-data-path=${tmp_path} --che-cli-command=destroy --che-cli-extra-options="--quiet --skip:nightly --skip:pull" - [[ ! -d "${container_tmp_path}"/instance ]] - #WHEN - #perform restore from backup - restore=$(execute_cli_command --che-data-path=${tmp_path} --che-cli-command=restore --che-cli-extra-options="--quiet --skip:nightly --skip:pull") - - #THEN - [[ "$restore" == *"Recovering Eclipse Che data..."* ]] - [[ -d "${container_tmp_path}"/instance ]] - [[ -d "${container_tmp_path}"/instance/data ]] - - #WHEN - execute_cli_command --che-data-path=${tmp_path} --che-cli-command=start --che-cli-extra-options="--skip:nightly --skip:pull" - check_che_state - - #THEN - [[ "$(curl -fsS http://${ip_address}:8080/api/workspace)" == *"$workspace_name"* ]] -} diff --git a/dockerfiles/cli/tests/cmd_config_tests.bats b/dockerfiles/cli/tests/cmd_config_tests.bats deleted file mode 100644 index 70a887dba4e4..000000000000 --- a/dockerfiles/cli/tests/cmd_config_tests.bats +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bats -# Copyright (c) 2017 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: -# Roman Iuvshyn - -load '/bats-support/load.bash' -load '/bats-assert/load.bash' -source /dockerfiles/cli/tests/test_base.sh - -@test "test CLI 'config' command" { - #GIVEN - tmp_path="${TESTRUN_DIR}"/cli_cmd_config - container_tmp_path="${CONTAINER_TESTRUN_DIR}"/cli_cmd_config - - #WHEN - execute_cli_command --che-data-path=${tmp_path} --che-cli-command=config --che-cli-extra-options="--skip:nightly --skip:pull" - - #THEN - [[ -d "${container_tmp_path}"/docs ]] - [[ -e "${container_tmp_path}"/che.env ]] - [[ -e "${container_tmp_path}"/cli.log ]] - [[ -d "${container_tmp_path}"/instance ]] - [[ -d "${container_tmp_path}"/instance/config ]] - [[ -d "${container_tmp_path}"/instance/config/che ]] - [[ -f "${container_tmp_path}"/instance/config/che/che.env ]] - [[ -d "${container_tmp_path}"/instance/config/keycloak/che ]] - [[ -f "${container_tmp_path}"/instance/config/keycloak/che-realm.json ]] - [[ -f "${container_tmp_path}"/instance/config/postgres/init-che-user.sh ]] - [[ -f "${container_tmp_path}"/instance/config/traefik/traefik.toml ]] - [[ -d "${container_tmp_path}"/instance/data ]] - [[ -d "${container_tmp_path}"/instance/logs ]] - [[ -d "${container_tmp_path}"/instance/templates ]] - [[ -f "${container_tmp_path}"/instance/docker-compose-container.yml ]] - [[ -f "${container_tmp_path}"/instance/che.ver.do_not_modify ]] -} diff --git a/dockerfiles/cli/tests/cmd_info_tests.bats b/dockerfiles/cli/tests/cmd_info_tests.bats deleted file mode 100644 index 6d8f53e44e81..000000000000 --- a/dockerfiles/cli/tests/cmd_info_tests.bats +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bats -# Copyright (c) 2017 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: -# Roman Iuvshyn - -load '/bats-support/load.bash' -load '/bats-assert/load.bash' -source /dockerfiles/cli/tests/test_base.sh - -@test "test CLI 'info' command" { - #GIVEN - tmp_path="${TESTRUN_DIR}"/cli_cmd_info - expected_output_1="CLI:" - expected_output_2="Mounts:" - expected_output_3="System:" - expected_output_4="Internal:" - expected_output_5="Image Registry:" - - #WHEN - result=$(execute_cli_command --che-data-path=${tmp_path} --che-cli-command=info --che-cli-extra-options="--skip:nightly --skip:pull") - - #THEN - [[ $result == *${expected_output_1}* ]] - [[ $result == *${expected_output_2}* ]] - [[ $result == *${expected_output_3}* ]] - [[ $result == *${expected_output_4}* ]] - [[ $result == *${expected_output_5}* ]] -} diff --git a/dockerfiles/cli/tests/cmd_init_destroy_tests.bats b/dockerfiles/cli/tests/cmd_init_destroy_tests.bats deleted file mode 100644 index a6cc5bd9e378..000000000000 --- a/dockerfiles/cli/tests/cmd_init_destroy_tests.bats +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/env bats -# Copyright (c) 2012-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 -# -# Contributors: -# Marian Labuda - Initial Implementation - -source /dockerfiles/cli/tests/test_base.sh - -@test "test 'init' and 'destroy --quiet' with existing dir" { - - #GIVEN - tmp_path="${TESTRUN_DIR}"/init-destroy1 - container_tmp_path=""${CONTAINER_TESTRUN_DIR}""/init-destroy1 - mkdir -p "${tmp_path}" - - #WHEN - execute_cli_command --che-data-path=${tmp_path} --che-cli-command=init --che-cli-extra-options="--skip:nightly --skip:pull" - - #THEN - [[ -d "${container_tmp_path}"/docs ]] - [[ -d "${container_tmp_path}"/instance ]] - [[ -e "${container_tmp_path}"/che.env ]] - [[ -e "${container_tmp_path}"/cli.log ]] - - #WHEN - execute_cli_command --che-data-path=${tmp_path} --che-cli-command=destroy --che-cli-extra-options="--quiet --skip:nightly --skip:pull" - - #THEN - [[ ! -d "${container_tmp_path}"/docs ]] - [[ ! -d "${container_tmp_path}"/instance ]] - [[ ! -e "${container_tmp_path}"/che.env ]] - [[ -e "${container_tmp_path}"/cli.log ]] - rm -rf "${container_tmp_path}" -} - -@test "test 'init' and 'destroy --quiet' with non-existing dir" { - - #GIVEN - tmp_path="${TESTRUN_DIR}"/init-destroy2 - container_tmp_path="${CONTAINER_TESTRUN_DIR}"/init-destroy2 - - #WHEN - execute_cli_command --che-data-path=${tmp_path} --che-cli-command=init --che-cli-extra-options="--skip:nightly --skip:pull 1>/dev/null" - - #THEN - [[ -e "${container_tmp_path}" ]] - [[ -d "${container_tmp_path}"/docs ]] - [[ -d "${container_tmp_path}"/instance ]] - [[ -e "${container_tmp_path}"/che.env ]] - [[ -e "${container_tmp_path}"/cli.log ]] - - #WHEN - execute_cli_command --che-data-path=${tmp_path} --che-cli-command=destroy --che-cli-extra-options="--quiet --skip:nightly --skip:pull 1>/dev/null" - - #THEN - [[ ! -d "${container_tmp_path}"/docs ]] - [[ ! -d "${container_tmp_path}"/instance ]] - [[ ! -e "${container_tmp_path}"/che.env ]] - [[ -e "${container_tmp_path}"/cli.log ]] - rm -rf "${container_tmp_path}" - -} - -@test "test 'init' and 'destroy --quiet --cli' with existing dir" { - #GIVEN - tmp_path="${TESTRUN_DIR}"/init-destroy3 - container_tmp_path="${CONTAINER_TESTRUN_DIR}"/init-destroy3 - - mkdir -p "${tmp_path}" - - #WHEN - execute_cli_command --che-data-path=${tmp_path} --che-cli-command=init --che-cli-extra-options="--skip:nightly --skip:pull 1>/dev/null" - remove_named_container $CLI_CONTAINER - - #THEN - [[ -d "${container_tmp_path}"/docs ]] - [[ -d "${container_tmp_path}"/instance ]] - [[ -e "${container_tmp_path}"/che.env ]] - [[ -e "${container_tmp_path}"/cli.log ]] - - #WHEN - execute_cli_command --che-data-path=${tmp_path} --che-cli-command=destroy --che-cli-extra-options="--quiet --skip:nightly --skip:pull --cli 1>/dev/null" - - #THEN - [[ ! -d "${container_tmp_path}"/docs ]] - [[ ! -d "${container_tmp_path}"/instance ]] - [[ ! -e "${container_tmp_path}"/che.env ]] - [[ ! -e "${container_tmp_path}"/cli.log ]] - rm -rf "${container_tmp_path}" - -} - -@test "test 'init' and 'destroy --quiet --cli' with non-existing dir" { - - #GIVEN - tmp_path="${TESTRUN_DIR}"/init-destroy4 - container_tmp_path="${CONTAINER_TESTRUN_DIR}"/init-destroy4 - - #WHEN - execute_cli_command --che-data-path=${tmp_path} --che-cli-command=init --che-cli-extra-options="--skip:nightly --skip:pull 1>/dev/null" - - #THEN - [[ -d "${container_tmp_path}" ]] - [[ -d "${container_tmp_path}"/docs ]] - [[ -d "${container_tmp_path}"/instance ]] - [[ -e "${container_tmp_path}"/che.env ]] - [[ -e "${container_tmp_path}"/cli.log ]] - - #WHEN - execute_cli_command --che-data-path=${tmp_path} --che-cli-command=destroy --che-cli-extra-options="--skip:nightly --skip:pull --quiet --cli 1>/dev/null" - - #THEN - [[ ! -d "${container_tmp_path}"/docs ]] - [[ ! -d "${container_tmp_path}"/instance ]] - [[ ! -e "${container_tmp_path}"/che.env ]] - [[ ! -e "${container_tmp_path}"/cli.log ]] - rm -rf "${container_tmp_path}" -} diff --git a/dockerfiles/cli/tests/cmd_offline_tests.bats b/dockerfiles/cli/tests/cmd_offline_tests.bats deleted file mode 100644 index 8f0b3b1cc9a3..000000000000 --- a/dockerfiles/cli/tests/cmd_offline_tests.bats +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env bats -# Copyright (c) 2017 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: -# Roman Iuvshyn - -source /dockerfiles/cli/tests/test_base.sh - -@test "test cli 'offline' command: with default parameters" { - #GIVEN - tmp_path="${TESTRUN_DIR}"/cli_cmd_offline_with_default_parameters - container_tmp_path="${CONTAINER_TESTRUN_DIR}"/cli_cmd_offline_with_default_parameters - mkdir -p "${tmp_path}" - - #WHEN - result=$(execute_cli_command --che-data-path=${tmp_path} --che-cli-command=offline --che-cli-extra-options="--skip:nightly --skip:pull") - - #THEN - [[ $result == *"Saving che cli image..."* ]] - [[ $result == *"Saving che bootstrap images..."* ]] - [[ $result == *"Saving che system images..."* ]] - [[ $result == *"Saving utility images..."* ]] - [[ $result == *"Saving che stack images..."* ]] - - [[ -f $(ls "${container_tmp_path}"/backup/alpine*.tar) ]] - [[ -f $(ls "${container_tmp_path}"/backup/docker_compose*.tar) ]] - [[ -f $(ls "${container_tmp_path}"/backup/eclipse_che-action*.tar) ]] - [[ -f $(ls "${container_tmp_path}"/backup/eclipse_che-cli*.tar) ]] - [[ -f $(ls "${container_tmp_path}"/backup/eclipse_che-dir*.tar) ]] - [[ -f $(ls "${container_tmp_path}"/backup/eclipse_che-init*.tar) ]] - [[ -f $(ls "${container_tmp_path}"/backup/eclipse_che-ip*.tar) ]] - [[ -f $(ls "${container_tmp_path}"/backup/eclipse_che-mount*.tar) ]] - [[ -f $(ls "${container_tmp_path}"/backup/eclipse_che-test*.tar) ]] -} - -@test "test cli 'offline' command: include custom stack images" { - #GIVEN - tmp_path="${TESTRUN_DIR}"/cli_cmd_offline_with_custom_stack_images - container_tmp_path="${CONTAINER_TESTRUN_DIR}"/cli_cmd_offline_with_custom_stack_images - mkdir -p "${tmp_path}" - - #WHEN - result=$(execute_cli_command --che-data-path=${tmp_path} --che-cli-command=offline --che-cli-extra-options="--image:eclipse/alpine_jdk8 --image:eclipse/debian_jre --skip:nightly --skip:pull") - - #THEN - [[ $result == *"Saving che cli image..."* ]] - [[ $result == *"Saving che bootstrap images..."* ]] - [[ $result == *"Saving che system images..."* ]] - [[ $result == *"Saving utility images..."* ]] - [[ $result == *"Saving che stack images..."* ]] - - [[ -f $(ls "${container_tmp_path}"/backup/alpine*.tar) ]] - [[ -f $(ls "${container_tmp_path}"/backup/docker_compose*.tar) ]] - [[ -f $(ls "${container_tmp_path}"/backup/eclipse_che-action*.tar) ]] - [[ -f $(ls "${container_tmp_path}"/backup/eclipse_che-cli*.tar) ]] - [[ -f $(ls "${container_tmp_path}"/backup/eclipse_che-dir*.tar) ]] - [[ -f $(ls "${container_tmp_path}"/backup/eclipse_che-init*.tar) ]] - [[ -f $(ls "${container_tmp_path}"/backup/eclipse_che-ip*.tar) ]] - [[ -f $(ls "${container_tmp_path}"/backup/eclipse_che-mount*.tar) ]] - [[ -f $(ls "${container_tmp_path}"/backup/eclipse_che-test*.tar) ]] - [[ -f "${container_tmp_path}"/backup/eclipse_alpine_jdk8.tar ]] - [[ -f "${container_tmp_path}"/backup/eclipse_debian_jre.tar ]] -} diff --git a/dockerfiles/cli/tests/cmd_start_stop_restart_tests.bats b/dockerfiles/cli/tests/cmd_start_stop_restart_tests.bats deleted file mode 100644 index 80c23dc72c94..000000000000 --- a/dockerfiles/cli/tests/cmd_start_stop_restart_tests.bats +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env bats -# Copyright (c) 2012-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 -# -# Contributors: -# Marian Labuda - Initial Implementation -# Roman Iuvshyn - -source /dockerfiles/cli/tests/test_base.sh - -# Kill running che server instance if there is any to be able to run tests -setup() { - kill_running_named_container chetest - remove_named_container chetest -} - -teardown() { - kill_running_named_container chetest - remove_named_container chetest -} - -@test "test cli 'start' command with default settings" { - #GIVEN - if [ ! port_is_free 8080 ]; then - [ "$status" -eq 1 ] - [ "$output" = "Default port 8080 for che server is used. Cannot run this test on default che server port" ] - fi - tmp_path="${TESTRUN_DIR}"/cli_cmd_start_with_default_params - mkdir -p "${tmp_path}" - - #WHEN - execute_cli_command --che-data-path=${tmp_path} --che-container-name=chetest --che-cli-command=start --che-cli-extra-options="--skip:nightly --skip:pull" - - #THEN - check_che_state --che-container-name="chetest" -} - -@test "test cli 'stop' command with default settings" { - #GIVEN - if [ ! port_is_free 8080 ]; then - [ "$status" -eq 1 ] - [ "$output" = "Default port 8080 for che server is used. Cannot run this test on default che server port" ] - fi - tmp_path="${TESTRUN_DIR}"/cli_cmd_stop_with_default_settings - mkdir -p "${tmp_path}" - execute_cli_command --che-data-path=${tmp_path} --che-container-name=chetest --che-cli-command=start --che-cli-extra-options="--skip:nightly --skip:pull" - check_che_state --che-container-name="chetest" - #WHEN - execute_cli_command --che-data-path=${tmp_path} --che-container-name=chetest --che-cli-command=stop --che-cli-extra-options="--skip:nightly --skip:pull" - - #THEN - #check that container is stopped and removed - [[ "$(docker ps -a)" != *"chetest"* ]] -} - -@test "test cli 'restart' command with default settings" { - #GIVEN - if [ ! port_is_free 8080 ]; then - [ "$status" -eq 1 ] - [ "$output" = "Default port 8080 for che server is used. Cannot run this test on default che server port" ] - fi - tmp_path="${TESTRUN_DIR}"/cli_cmd_restart_with_default_settings - mkdir -p "${tmp_path}" - execute_cli_command --che-data-path=${tmp_path} --che-container-name=chetest --che-cli-command=start --che-cli-extra-options="--skip:nightly --skip:pull" - check_che_state --che-container-name="chetest" - che_container_id=$(docker inspect --format="{{.Id}}" chetest) - - #WHEN - execute_cli_command --che-data-path=${tmp_path} --che-container-name=chetest --che-cli-command=restart --che-cli-extra-options="--skip:nightly --skip:pull" - - #THEN - [[ "$(docker inspect --format="{{.Id}}" chetest)" != "$che_container_id" ]] - check_che_state --che-container-name="chetest" -} - -@test "test cli 'start' with custom port" { - #GIVEN - tmp_path=${TESTRUN_DIR}/cli_cmd_start_with_custom_port - free_port=$(get_free_port) - - #WHEN - execute_cli_command --che-data-path=${tmp_path} --che-port=$free_port --che-container-name=chetest --che-cli-command=start --che-cli-extra-options="--skip:nightly --skip:pull" - #THEN - check_che_state --che-container-name="chetest" --che-port="$free_port" -} diff --git a/dockerfiles/cli/tests/override_image_tests.bats b/dockerfiles/cli/tests/override_image_tests.bats deleted file mode 100644 index 75127c70b143..000000000000 --- a/dockerfiles/cli/tests/override_image_tests.bats +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env bats -# Copyright (c) 2017 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: -# David Festal - - -function log() { - echo "" -} - -load '/bats-support/load.bash' -load '/bats-assert/load.bash' -source /dockerfiles/cli/tests/test_base.sh -source /dockerfiles/base/scripts/base/startup_03_pre_networking.sh - -@test "test overriding the CLI images" { - #GIVEN - IMAGES="IMAGE_INIT=eclipse/che-init:nightly" - IMAGE_INIT="dfestal/che-init:nightly" - - #WHEN - set_variables_images_list "${IMAGES}" - - #THEN - [[ "${IMAGE_INIT}" == ""dfestal/che-init:nightly"" ]] -} - -@test "test not overriding the CLI images" { - #GIVEN - IMAGES="IMAGE_INIT=eclipse/che-init:nightly" - - #WHEN - set_variables_images_list "${IMAGES}" - - #THEN - [[ "${IMAGE_INIT}" == ""eclipse/che-init:nightly"" ]] -} diff --git a/dockerfiles/cli/tests/startup_03_pre_networking_tests.bats b/dockerfiles/cli/tests/startup_03_pre_networking_tests.bats deleted file mode 100644 index 92969971ba26..000000000000 --- a/dockerfiles/cli/tests/startup_03_pre_networking_tests.bats +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env bats -# Copyright (c) 2017 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: -# Florent Benoit - Initial Implementation -# - - -function log() { - echo "" -} - -load '/bats-support/load.bash' -load '/bats-assert/load.bash' -source /dockerfiles/cli/tests/test_base.sh -source /dockerfiles/base/scripts/base/startup_03_pre_networking.sh - - -@test "Check isDocker4Mac is true" { - # GIVEN - UNAME_R="4.9.4-moby" - - # WHEN - run is_docker_for_mac - - # THEN - assert_success -} - -@test "Check isDocker4Mac is true (new docker releases)" { - # GIVEN - UNAME_R="4.9.44-linuxkit-aufs" - - # WHEN - run is_docker_for_mac - - # THEN - assert_success -} - - -@test "Check isDocker4Mac is false on Linux kernel" { - # GIVEN - UNAME_R="4.4.0-21-generic" - - # WHEN - run is_docker_for_mac - - # THEN - assert_failure -} - - -@test "Check isDocker4Win is false on Linux kernel" { - # GIVEN - UNAME_R="4.4.0-21-generic" - - # WHEN - run is_docker_for_windows - - # THEN - assert_failure -} - - -@test "Check isDocker4Win is true" { - # GIVEN - UNAME_R="4.9.4-moby" - GLOBAL_HOST_IP="10.0.75.2" - - # WHEN - run is_docker_for_windows - - # THEN - assert_success -} - -@test "Check isDocker4Win is true (new docker releases)" { - # GIVEN - UNAME_R="4.9.44-linuxkit-aufs" - GLOBAL_HOST_IP="10.0.75.2" - - # WHEN - run is_docker_for_windows - - # THEN - assert_success -} \ No newline at end of file diff --git a/dockerfiles/cli/tests/test_base.sh b/dockerfiles/cli/tests/test_base.sh deleted file mode 100644 index 065242f2fb79..000000000000 --- a/dockerfiles/cli/tests/test_base.sh +++ /dev/null @@ -1,157 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Marian Labuda - Initial Implementation - -#export CLI_IMAGE=$IMAGE_NAME -source /dockerfiles/base/scripts/base/*.sh -export SCRIPTS_DIR="${BATS_BASE_DIR}"/base/scripts/base -export TESTS_DIR="${BATS_BASE_DIR}"/cli/tests -export TESTRUN_DIR="${TESTS_DIR}"/testrun -export CONTAINER_TESTRUN_DIR=/dockerfiles/cli/tests/testrun - -if [ -d "${CONTAINER_TESTRUN_DIR}" ]; then - rm -rf "${CONTAINER_TESTRUN_DIR}" -fi -mkdir "${TESTRUN_DIR}" -p - -kill_running_named_container() { - if [[ $(docker ps --format '{{.Names}}' | grep $1 | wc -l) -eq 1 ]]; then - echo "Stopping named container $1" - docker kill $1 1>/dev/null - fi -} - -remove_named_container() { - if [[ $(docker ps -a --format '{{.Names}}' | grep $1 | wc -l) -eq 1 ]]; then - echo "Removing named container $1" - docker rm $1 1>/dev/null - fi -} - -# Pass a port as an argument to check whether is free or not -# Returns 0 if port is free (not listening), 1 otherwise -port_is_free() { - if [[ $(netstat -lnt | awk -v port=$1 '$6 == "LISTEN" && $4 ~ "."port' | wc -l) -gt 0 ]]; then - return 1 - else - return 0 - fi -} - -# Get first free port from range of dynamic/private ports -get_free_port() { - local port=49200 - while [[ $(port_is_free $port) -eq 1 ]]; do - if [[ $port -eq 65535 ]]; then - echo "" - return 1 - fi - port=$((port+1)) - done - echo $port -} - -check_che_state() { - local CHE_CONTAINER_NAME="che" - local CHE_PORT="8080" - local IS_RUNNING="true" - for i in "${@}" - do - case $i in - --che-container-name=*) - CHE_CONTAINER_NAME="${i#*=}" - shift - ;; - --che-port=*) - CHE_PORT="${i#*=}" - shift - ;; - --is-running=*) - IS_RUNNING="${i#*=}" - shift - ;; - *) - echo "You've passed unknown option" - exit 2 - ;; - esac - done - [[ "$(docker inspect --format='{{.State.Running}}' $CHE_CONTAINER_NAME)" == "$IS_RUNNING" ]] - ip_address=$(docker inspect -f {{.NetworkSettings.Networks.bridge.IPAddress}} $CHE_CONTAINER_NAME) - curl -fsS http://${ip_address}:$CHE_PORT > /dev/null -} - -execute_cli_command() { - local CHE_CONTAINER_NAME="che" - local CHE_DATA_PATH="" - local CHE_CLI_COMMAND="" - local CHE_CLI_EXTRA_OPTIONS="" - local CHE_PORT="8080" - local DATA_VOLUME="" - local USE_DOCKER_SOCK="true" - local MOUNT_SCRIPTS="true" - - for i in "${@}" - do - case $i in - --che-container-name=*) - CHE_CONTAINER_NAME="${i#*=}" - shift - ;; - --che-port=*) - CHE_PORT="${i#*=}" - shift - ;; - --che-data-path=*) - CHE_DATA_PATH="${i#*=}" - shift - ;; - --che-cli-command=*) - CHE_CLI_COMMAND="${i#*=}" - shift - ;; - --che-cli-extra-options=*) - CHE_CLI_EXTRA_OPTIONS="${i#*=}" - shift - ;; - --che-cli-use-docker-sock=*) - USE_DOCKER_SOCK="${i#*=}" - shift - ;; - --che-cli-mount-scripts=*) - MOUNT_SCRIPTS="${i#*=}" - shift - ;; - *) - echo "You've passed unknown option" - exit 2 - ;; - esac - done - - if [ ! -z $CHE_DATA_PATH ]; then - DATA_VOLUME="-v ${CHE_DATA_PATH}:/data" - fi - if [ $USE_DOCKER_SOCK == "true" ]; then - DOCKER_SOCK_VOLUME="-v /var/run/docker.sock:/var/run/docker.sock" - fi - if [ $MOUNT_SCRIPTS == "true" ]; then - SCRIPTS_VOLUME="-v ${SCRIPTS_DIR}:/scripts/base" - fi - if [ $CHE_PORT -ne 8080 ]; then - CLI_CUSTOM_PORT="-e CHE_PORT=${CHE_PORT}" - fi - if [ $CHE_CONTAINER_NAME != "che" ]; then - CLI_CUSTOM_CHE_CONTAINER_NAME="-e CHE_CONTAINER=${CHE_CONTAINER_NAME}" - fi - - docker run --rm ${CLI_CUSTOM_PORT} ${SCRIPTS_VOLUME} ${DOCKER_SOCK_VOLUME} ${DATA_VOLUME} ${CLI_CUSTOM_CHE_CONTAINER_NAME} $CLI_IMAGE ${CHE_CLI_COMMAND} ${CHE_CLI_EXTRA_OPTIONS} -} diff --git a/dockerfiles/cli/version/4.7.2/images b/dockerfiles/cli/version/4.7.2/images deleted file mode 100644 index 538a741fdbc6..000000000000 --- a/dockerfiles/cli/version/4.7.2/images +++ /dev/null @@ -1,4 +0,0 @@ -IMAGE_PUPPET=puppet/puppet-agent-alpine:4.6.2 -IMAGE_REGISTRY=registry:2.5.0 -IMAGE_INIT=eclipse/che-init:nightly -IMAGE_CHE=eclipse/che-server:4.7.2 diff --git a/dockerfiles/cli/version/4.7.2/images-stacks b/dockerfiles/cli/version/4.7.2/images-stacks deleted file mode 100644 index 461e6e98fb59..000000000000 --- a/dockerfiles/cli/version/4.7.2/images-stacks +++ /dev/null @@ -1,22 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 diff --git a/dockerfiles/cli/version/5.0.0-M5/images b/dockerfiles/cli/version/5.0.0-M5/images deleted file mode 100644 index 67b4e3dce621..000000000000 --- a/dockerfiles/cli/version/5.0.0-M5/images +++ /dev/null @@ -1,4 +0,0 @@ -IMAGE_PUPPET=puppet/puppet-agent-alpine:4.6.2 -IMAGE_REGISTRY=registry:2.5.0 -IMAGE_INIT=eclipse/che-init:nightly -IMAGE_CHE=eclipse/che-server:5.0.0-M5 diff --git a/dockerfiles/cli/version/5.0.0-M5/images-stacks b/dockerfiles/cli/version/5.0.0-M5/images-stacks deleted file mode 100644 index 461e6e98fb59..000000000000 --- a/dockerfiles/cli/version/5.0.0-M5/images-stacks +++ /dev/null @@ -1,22 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 diff --git a/dockerfiles/cli/version/5.0.0-M6/images b/dockerfiles/cli/version/5.0.0-M6/images deleted file mode 100644 index 6189ba7962e1..000000000000 --- a/dockerfiles/cli/version/5.0.0-M6/images +++ /dev/null @@ -1,4 +0,0 @@ -IMAGE_PUPPET=puppet/puppet-agent-alpine:4.6.2 -IMAGE_REGISTRY=registry:2.5.0 -IMAGE_INIT=eclipse/che-init:nightly -IMAGE_CHE=eclipse/che-server:5.0.0-M6 diff --git a/dockerfiles/cli/version/5.0.0-M6/images-stacks b/dockerfiles/cli/version/5.0.0-M6/images-stacks deleted file mode 100644 index 461e6e98fb59..000000000000 --- a/dockerfiles/cli/version/5.0.0-M6/images-stacks +++ /dev/null @@ -1,22 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 diff --git a/dockerfiles/cli/version/5.0.0-M7/images b/dockerfiles/cli/version/5.0.0-M7/images deleted file mode 100644 index 74244c38d26a..000000000000 --- a/dockerfiles/cli/version/5.0.0-M7/images +++ /dev/null @@ -1,4 +0,0 @@ -IMAGE_PUPPET=puppet/puppet-agent-alpine:4.6.2 -IMAGE_REGISTRY=registry:2.5.0 -IMAGE_INIT=eclipse/che-init:nightly -IMAGE_CHE=eclipse/che-server:5.0.0-M7 diff --git a/dockerfiles/cli/version/5.0.0-M7/images-stacks b/dockerfiles/cli/version/5.0.0-M7/images-stacks deleted file mode 100644 index 461e6e98fb59..000000000000 --- a/dockerfiles/cli/version/5.0.0-M7/images-stacks +++ /dev/null @@ -1,22 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 diff --git a/dockerfiles/cli/version/5.0.0-M8/images b/dockerfiles/cli/version/5.0.0-M8/images deleted file mode 100644 index 62f7695b92dc..000000000000 --- a/dockerfiles/cli/version/5.0.0-M8/images +++ /dev/null @@ -1,4 +0,0 @@ -IMAGE_PUPPET=puppet/puppet-agent-alpine:4.6.2 -IMAGE_REGISTRY=registry:2.5.0 -IMAGE_INIT=eclipse/che-init:5.0.0-M8 -IMAGE_CHE=eclipse/che-server:5.0.0-M8 diff --git a/dockerfiles/cli/version/5.0.0-M8/images-stacks b/dockerfiles/cli/version/5.0.0-M8/images-stacks deleted file mode 100644 index 461e6e98fb59..000000000000 --- a/dockerfiles/cli/version/5.0.0-M8/images-stacks +++ /dev/null @@ -1,22 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 diff --git a/dockerfiles/cli/version/5.0.0/images b/dockerfiles/cli/version/5.0.0/images deleted file mode 100644 index 1bbbb2eb2a76..000000000000 --- a/dockerfiles/cli/version/5.0.0/images +++ /dev/null @@ -1,4 +0,0 @@ -IMAGE_PUPPET=puppet/puppet-agent-alpine:4.6.2 -IMAGE_REGISTRY=registry:2.5.0 -IMAGE_INIT=eclipse/che-init:5.0.0 -IMAGE_CHE=eclipse/che-server:5.0.0 diff --git a/dockerfiles/cli/version/5.0.0/images-stacks b/dockerfiles/cli/version/5.0.0/images-stacks deleted file mode 100644 index 461e6e98fb59..000000000000 --- a/dockerfiles/cli/version/5.0.0/images-stacks +++ /dev/null @@ -1,22 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 diff --git a/dockerfiles/cli/version/5.0.1/images b/dockerfiles/cli/version/5.0.1/images deleted file mode 100644 index fe421647777b..000000000000 --- a/dockerfiles/cli/version/5.0.1/images +++ /dev/null @@ -1,4 +0,0 @@ -IMAGE_PUPPET=puppet/puppet-agent-alpine:4.6.2 -IMAGE_REGISTRY=registry:2.5.0 -IMAGE_INIT=eclipse/che-init:5.0.1 -IMAGE_CHE=eclipse/che-server:5.0.1 diff --git a/dockerfiles/cli/version/5.0.1/images-stacks b/dockerfiles/cli/version/5.0.1/images-stacks deleted file mode 100644 index 461e6e98fb59..000000000000 --- a/dockerfiles/cli/version/5.0.1/images-stacks +++ /dev/null @@ -1,22 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 diff --git a/dockerfiles/cli/version/5.1.0/images b/dockerfiles/cli/version/5.1.0/images deleted file mode 100644 index fea01081d205..000000000000 --- a/dockerfiles/cli/version/5.1.0/images +++ /dev/null @@ -1,4 +0,0 @@ -IMAGE_PUPPET=puppet/puppet-agent-alpine:4.6.2 -IMAGE_REGISTRY=registry:2.5.0 -IMAGE_INIT=eclipse/che-init:5.1.0 -IMAGE_CHE=eclipse/che-server:5.1.0 diff --git a/dockerfiles/cli/version/5.1.0/images-stacks b/dockerfiles/cli/version/5.1.0/images-stacks deleted file mode 100644 index 461e6e98fb59..000000000000 --- a/dockerfiles/cli/version/5.1.0/images-stacks +++ /dev/null @@ -1,22 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 diff --git a/dockerfiles/cli/version/5.1.1/images b/dockerfiles/cli/version/5.1.1/images deleted file mode 100644 index 108cd8fcff2a..000000000000 --- a/dockerfiles/cli/version/5.1.1/images +++ /dev/null @@ -1,4 +0,0 @@ -IMAGE_PUPPET=puppet/puppet-agent-alpine:4.6.2 -IMAGE_REGISTRY=registry:2.5.0 -IMAGE_INIT=eclipse/che-init:5.1.1 -IMAGE_CHE=eclipse/che-server:5.1.1 diff --git a/dockerfiles/cli/version/5.1.1/images-stacks b/dockerfiles/cli/version/5.1.1/images-stacks deleted file mode 100644 index 461e6e98fb59..000000000000 --- a/dockerfiles/cli/version/5.1.1/images-stacks +++ /dev/null @@ -1,22 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 diff --git a/dockerfiles/cli/version/5.10.0/images b/dockerfiles/cli/version/5.10.0/images deleted file mode 100644 index ca76c6039690..000000000000 --- a/dockerfiles/cli/version/5.10.0/images +++ /dev/null @@ -1,3 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.10.0 -IMAGE_CHE=eclipse/che-server:5.10.0 -IMAGE_COMPOSE=docker/compose:1.8.1 diff --git a/dockerfiles/cli/version/5.10.0/images-stacks b/dockerfiles/cli/version/5.10.0/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.10.0/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.11.0/images b/dockerfiles/cli/version/5.11.0/images deleted file mode 100644 index be325465af92..000000000000 --- a/dockerfiles/cli/version/5.11.0/images +++ /dev/null @@ -1,4 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.11.0 -IMAGE_CHE=eclipse/che-server:5.11.0 -IMAGE_COMPOSE=docker/compose:1.8.1 -IMAGE_TRAEFIK=traefik:v1.3.0-rc1 diff --git a/dockerfiles/cli/version/5.11.0/images-stacks b/dockerfiles/cli/version/5.11.0/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.11.0/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.11.1/images b/dockerfiles/cli/version/5.11.1/images deleted file mode 100644 index 2b37b721b5ce..000000000000 --- a/dockerfiles/cli/version/5.11.1/images +++ /dev/null @@ -1,4 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.11.1 -IMAGE_CHE=eclipse/che-server:5.11.1 -IMAGE_COMPOSE=docker/compose:1.8.1 -IMAGE_TRAEFIK=traefik:v1.3.0-rc1 diff --git a/dockerfiles/cli/version/5.11.1/images-stacks b/dockerfiles/cli/version/5.11.1/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.11.1/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.11.2/images b/dockerfiles/cli/version/5.11.2/images deleted file mode 100644 index b07b5c13f848..000000000000 --- a/dockerfiles/cli/version/5.11.2/images +++ /dev/null @@ -1,4 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.11.2 -IMAGE_CHE=eclipse/che-server:5.11.2 -IMAGE_COMPOSE=docker/compose:1.8.1 -IMAGE_TRAEFIK=traefik:v1.3.0-rc1 diff --git a/dockerfiles/cli/version/5.11.2/images-stacks b/dockerfiles/cli/version/5.11.2/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.11.2/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.12.0/images b/dockerfiles/cli/version/5.12.0/images deleted file mode 100644 index 4764a0cd5a97..000000000000 --- a/dockerfiles/cli/version/5.12.0/images +++ /dev/null @@ -1,4 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.12.0 -IMAGE_CHE=eclipse/che-server:5.12.0 -IMAGE_COMPOSE=docker/compose:1.8.1 -IMAGE_TRAEFIK=traefik:v1.3.0-rc3 diff --git a/dockerfiles/cli/version/5.12.0/images-stacks b/dockerfiles/cli/version/5.12.0/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.12.0/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.13.0/images b/dockerfiles/cli/version/5.13.0/images deleted file mode 100644 index 1981e62dd769..000000000000 --- a/dockerfiles/cli/version/5.13.0/images +++ /dev/null @@ -1,4 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.13.0 -IMAGE_CHE=eclipse/che-server:5.13.0 -IMAGE_COMPOSE=docker/compose:1.8.1 -IMAGE_TRAEFIK=traefik:v1.3.0-rc3 diff --git a/dockerfiles/cli/version/5.13.0/images-stacks b/dockerfiles/cli/version/5.13.0/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.13.0/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.14.0/images b/dockerfiles/cli/version/5.14.0/images deleted file mode 100644 index de0cfc235a93..000000000000 --- a/dockerfiles/cli/version/5.14.0/images +++ /dev/null @@ -1,4 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.14.0 -IMAGE_CHE=eclipse/che-server:5.14.0 -IMAGE_COMPOSE=docker/compose:1.8.1 -IMAGE_TRAEFIK=traefik:v1.3.0-rc3 diff --git a/dockerfiles/cli/version/5.14.0/images-stacks b/dockerfiles/cli/version/5.14.0/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.14.0/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.15.0/images b/dockerfiles/cli/version/5.15.0/images deleted file mode 100644 index 5abd12a95ca6..000000000000 --- a/dockerfiles/cli/version/5.15.0/images +++ /dev/null @@ -1,4 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.15.0 -IMAGE_CHE=eclipse/che-server:5.15.0 -IMAGE_COMPOSE=docker/compose:1.8.1 -IMAGE_TRAEFIK=traefik:v1.3.0-rc3 diff --git a/dockerfiles/cli/version/5.15.0/images-stacks b/dockerfiles/cli/version/5.15.0/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.15.0/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.16.0/images b/dockerfiles/cli/version/5.16.0/images deleted file mode 100644 index 10be720a1081..000000000000 --- a/dockerfiles/cli/version/5.16.0/images +++ /dev/null @@ -1,4 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.16.0 -IMAGE_CHE=eclipse/che-server:5.16.0 -IMAGE_COMPOSE=docker/compose:1.8.1 -IMAGE_TRAEFIK=traefik:v1.3.0-rc3 diff --git a/dockerfiles/cli/version/5.16.0/images-stacks b/dockerfiles/cli/version/5.16.0/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.16.0/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.17.0/images b/dockerfiles/cli/version/5.17.0/images deleted file mode 100644 index 16a83e5baf8d..000000000000 --- a/dockerfiles/cli/version/5.17.0/images +++ /dev/null @@ -1,4 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.17.0 -IMAGE_CHE=eclipse/che-server:5.17.0 -IMAGE_COMPOSE=docker/compose:1.8.1 -IMAGE_TRAEFIK=traefik:v1.3.0-rc3 diff --git a/dockerfiles/cli/version/5.17.0/images-stacks b/dockerfiles/cli/version/5.17.0/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.17.0/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.18.0/images b/dockerfiles/cli/version/5.18.0/images deleted file mode 100644 index 01b0beb2bc09..000000000000 --- a/dockerfiles/cli/version/5.18.0/images +++ /dev/null @@ -1,4 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.18.0 -IMAGE_CHE=eclipse/che-server:5.18.0 -IMAGE_COMPOSE=docker/compose:1.8.1 -IMAGE_TRAEFIK=traefik:v1.3.0-rc3 diff --git a/dockerfiles/cli/version/5.18.0/images-stacks b/dockerfiles/cli/version/5.18.0/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.18.0/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.18.1/images b/dockerfiles/cli/version/5.18.1/images deleted file mode 100644 index a6822ff3917a..000000000000 --- a/dockerfiles/cli/version/5.18.1/images +++ /dev/null @@ -1,4 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.18.1 -IMAGE_CHE=eclipse/che-server:5.18.1 -IMAGE_COMPOSE=docker/compose:1.8.1 -IMAGE_TRAEFIK=traefik:v1.3.0-rc3 diff --git a/dockerfiles/cli/version/5.18.1/images-stacks b/dockerfiles/cli/version/5.18.1/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.18.1/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.19.0/images b/dockerfiles/cli/version/5.19.0/images deleted file mode 100644 index 67529e992048..000000000000 --- a/dockerfiles/cli/version/5.19.0/images +++ /dev/null @@ -1,7 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.19.0 -IMAGE_CHE=eclipse/che-server:5.19.0 -IMAGE_CHE_MULTIUSER=eclipse/che-server-multiuser:5.19.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.3.0-rc3 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.3.0.CR2-3 diff --git a/dockerfiles/cli/version/5.19.0/images-stacks b/dockerfiles/cli/version/5.19.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/5.19.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/5.2.0/images b/dockerfiles/cli/version/5.2.0/images deleted file mode 100644 index 0d6203f9f311..000000000000 --- a/dockerfiles/cli/version/5.2.0/images +++ /dev/null @@ -1,2 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.2.0 -IMAGE_CHE=eclipse/che-server:5.2.0 diff --git a/dockerfiles/cli/version/5.2.0/images-stacks b/dockerfiles/cli/version/5.2.0/images-stacks deleted file mode 100644 index 461e6e98fb59..000000000000 --- a/dockerfiles/cli/version/5.2.0/images-stacks +++ /dev/null @@ -1,22 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 diff --git a/dockerfiles/cli/version/5.2.1/images b/dockerfiles/cli/version/5.2.1/images deleted file mode 100644 index bf7b1e797cff..000000000000 --- a/dockerfiles/cli/version/5.2.1/images +++ /dev/null @@ -1,2 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.2.1 -IMAGE_CHE=eclipse/che-server:5.2.1 diff --git a/dockerfiles/cli/version/5.2.1/images-stacks b/dockerfiles/cli/version/5.2.1/images-stacks deleted file mode 100644 index 461e6e98fb59..000000000000 --- a/dockerfiles/cli/version/5.2.1/images-stacks +++ /dev/null @@ -1,22 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 diff --git a/dockerfiles/cli/version/5.2.2/images b/dockerfiles/cli/version/5.2.2/images deleted file mode 100644 index 5b50c2a3a00b..000000000000 --- a/dockerfiles/cli/version/5.2.2/images +++ /dev/null @@ -1,2 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.2.2 -IMAGE_CHE=eclipse/che-server:5.2.2 diff --git a/dockerfiles/cli/version/5.2.2/images-stacks b/dockerfiles/cli/version/5.2.2/images-stacks deleted file mode 100644 index 461e6e98fb59..000000000000 --- a/dockerfiles/cli/version/5.2.2/images-stacks +++ /dev/null @@ -1,22 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 diff --git a/dockerfiles/cli/version/5.20.0/images b/dockerfiles/cli/version/5.20.0/images deleted file mode 100644 index a1121bae90d0..000000000000 --- a/dockerfiles/cli/version/5.20.0/images +++ /dev/null @@ -1,7 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.20.0 -IMAGE_CHE=eclipse/che-server:5.20.0 -IMAGE_CHE_MULTIUSER=eclipse/che-server-multiuser:5.20.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.3.0-rc3 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.3.0.CR2-3 diff --git a/dockerfiles/cli/version/5.20.0/images-stacks b/dockerfiles/cli/version/5.20.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/5.20.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/5.20.1/images b/dockerfiles/cli/version/5.20.1/images deleted file mode 100644 index b434b8e6e705..000000000000 --- a/dockerfiles/cli/version/5.20.1/images +++ /dev/null @@ -1,7 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.20.1 -IMAGE_CHE=eclipse/che-server:5.20.1 -IMAGE_CHE_MULTIUSER=eclipse/che-server-multiuser:5.20.1 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.3.0-rc3 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.3.0.CR2-3 diff --git a/dockerfiles/cli/version/5.20.1/images-stacks b/dockerfiles/cli/version/5.20.1/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/5.20.1/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/5.21.0/images b/dockerfiles/cli/version/5.21.0/images deleted file mode 100644 index a5dcff3a25b2..000000000000 --- a/dockerfiles/cli/version/5.21.0/images +++ /dev/null @@ -1,7 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.21.0 -IMAGE_CHE=eclipse/che-server:5.21.0 -IMAGE_CHE_MULTIUSER=eclipse/che-server-multiuser:5.21.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.3.0-rc3 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.3.0.CR2-3 diff --git a/dockerfiles/cli/version/5.21.0/images-stacks b/dockerfiles/cli/version/5.21.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/5.21.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/5.22.0/images b/dockerfiles/cli/version/5.22.0/images deleted file mode 100644 index 91e3f79c7e4d..000000000000 --- a/dockerfiles/cli/version/5.22.0/images +++ /dev/null @@ -1,7 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.22.0 -IMAGE_CHE=eclipse/che-server:5.22.0 -IMAGE_CHE_MULTIUSER=eclipse/che-server-multiuser:5.22.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.3.0-rc3 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.3.0.CR2-3 diff --git a/dockerfiles/cli/version/5.22.0/images-stacks b/dockerfiles/cli/version/5.22.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/5.22.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/5.3.0/images b/dockerfiles/cli/version/5.3.0/images deleted file mode 100644 index 7cd61c357f51..000000000000 --- a/dockerfiles/cli/version/5.3.0/images +++ /dev/null @@ -1,3 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.3.0 -IMAGE_CHE=eclipse/che-server:5.3.0 -IMAGE_COMPOSE=docker/compose:1.8.1 diff --git a/dockerfiles/cli/version/5.3.0/images-stacks b/dockerfiles/cli/version/5.3.0/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.3.0/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.3.1/images b/dockerfiles/cli/version/5.3.1/images deleted file mode 100644 index 43ea257163fd..000000000000 --- a/dockerfiles/cli/version/5.3.1/images +++ /dev/null @@ -1,3 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.3.1 -IMAGE_CHE=eclipse/che-server:5.3.1 -IMAGE_COMPOSE=docker/compose:1.8.1 diff --git a/dockerfiles/cli/version/5.3.1/images-stacks b/dockerfiles/cli/version/5.3.1/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.3.1/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.4.0/images b/dockerfiles/cli/version/5.4.0/images deleted file mode 100644 index dce043f534de..000000000000 --- a/dockerfiles/cli/version/5.4.0/images +++ /dev/null @@ -1,3 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.4.0 -IMAGE_CHE=eclipse/che-server:5.4.0 -IMAGE_COMPOSE=docker/compose:1.8.1 diff --git a/dockerfiles/cli/version/5.4.0/images-stacks b/dockerfiles/cli/version/5.4.0/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.4.0/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.4.1/images b/dockerfiles/cli/version/5.4.1/images deleted file mode 100644 index 28d4d8c53fb7..000000000000 --- a/dockerfiles/cli/version/5.4.1/images +++ /dev/null @@ -1,3 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.4.1 -IMAGE_CHE=eclipse/che-server:5.4.1 -IMAGE_COMPOSE=docker/compose:1.8.1 diff --git a/dockerfiles/cli/version/5.4.1/images-stacks b/dockerfiles/cli/version/5.4.1/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.4.1/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.5.0/images b/dockerfiles/cli/version/5.5.0/images deleted file mode 100644 index d8d6456ed8a5..000000000000 --- a/dockerfiles/cli/version/5.5.0/images +++ /dev/null @@ -1,3 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.5.0 -IMAGE_CHE=eclipse/che-server:5.5.0 -IMAGE_COMPOSE=docker/compose:1.8.1 diff --git a/dockerfiles/cli/version/5.5.0/images-stacks b/dockerfiles/cli/version/5.5.0/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.5.0/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.6.0/images b/dockerfiles/cli/version/5.6.0/images deleted file mode 100644 index 81fa352a2358..000000000000 --- a/dockerfiles/cli/version/5.6.0/images +++ /dev/null @@ -1,3 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.6.0 -IMAGE_CHE=eclipse/che-server:5.6.0 -IMAGE_COMPOSE=docker/compose:1.8.1 diff --git a/dockerfiles/cli/version/5.6.0/images-stacks b/dockerfiles/cli/version/5.6.0/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.6.0/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.7.0/images b/dockerfiles/cli/version/5.7.0/images deleted file mode 100644 index fb766f66c02f..000000000000 --- a/dockerfiles/cli/version/5.7.0/images +++ /dev/null @@ -1,3 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.7.0 -IMAGE_CHE=eclipse/che-server:5.7.0 -IMAGE_COMPOSE=docker/compose:1.8.1 diff --git a/dockerfiles/cli/version/5.7.0/images-stacks b/dockerfiles/cli/version/5.7.0/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.7.0/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.7.1/images b/dockerfiles/cli/version/5.7.1/images deleted file mode 100644 index 76d7e4e36df7..000000000000 --- a/dockerfiles/cli/version/5.7.1/images +++ /dev/null @@ -1,3 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.7.1 -IMAGE_CHE=eclipse/che-server:5.7.1 -IMAGE_COMPOSE=docker/compose:1.8.1 diff --git a/dockerfiles/cli/version/5.7.1/images-stacks b/dockerfiles/cli/version/5.7.1/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.7.1/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.7.2/images b/dockerfiles/cli/version/5.7.2/images deleted file mode 100644 index 93bcb9eae8a6..000000000000 --- a/dockerfiles/cli/version/5.7.2/images +++ /dev/null @@ -1,3 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.7.2 -IMAGE_CHE=eclipse/che-server:5.7.2 -IMAGE_COMPOSE=docker/compose:1.8.1 diff --git a/dockerfiles/cli/version/5.7.2/images-stacks b/dockerfiles/cli/version/5.7.2/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.7.2/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.8.0/images b/dockerfiles/cli/version/5.8.0/images deleted file mode 100644 index fd8d6ebb9d41..000000000000 --- a/dockerfiles/cli/version/5.8.0/images +++ /dev/null @@ -1,3 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.8.0 -IMAGE_CHE=eclipse/che-server:5.8.0 -IMAGE_COMPOSE=docker/compose:1.8.1 diff --git a/dockerfiles/cli/version/5.8.0/images-stacks b/dockerfiles/cli/version/5.8.0/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.8.0/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.8.1/images b/dockerfiles/cli/version/5.8.1/images deleted file mode 100644 index cbd658a33d2d..000000000000 --- a/dockerfiles/cli/version/5.8.1/images +++ /dev/null @@ -1,3 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.8.1 -IMAGE_CHE=eclipse/che-server:5.8.1 -IMAGE_COMPOSE=docker/compose:1.8.1 diff --git a/dockerfiles/cli/version/5.8.1/images-stacks b/dockerfiles/cli/version/5.8.1/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.8.1/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.9.0/images b/dockerfiles/cli/version/5.9.0/images deleted file mode 100644 index c7fce5db5449..000000000000 --- a/dockerfiles/cli/version/5.9.0/images +++ /dev/null @@ -1,3 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.9.0 -IMAGE_CHE=eclipse/che-server:5.9.0 -IMAGE_COMPOSE=docker/compose:1.8.1 diff --git a/dockerfiles/cli/version/5.9.0/images-stacks b/dockerfiles/cli/version/5.9.0/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.9.0/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/5.9.1/images b/dockerfiles/cli/version/5.9.1/images deleted file mode 100644 index b68ed6f641cd..000000000000 --- a/dockerfiles/cli/version/5.9.1/images +++ /dev/null @@ -1,3 +0,0 @@ -IMAGE_INIT=eclipse/che-init:5.9.1 -IMAGE_CHE=eclipse/che-server:5.9.1 -IMAGE_COMPOSE=docker/compose:1.8.1 diff --git a/dockerfiles/cli/version/5.9.1/images-stacks b/dockerfiles/cli/version/5.9.1/images-stacks deleted file mode 100644 index 4630f02af66e..000000000000 --- a/dockerfiles/cli/version/5.9.1/images-stacks +++ /dev/null @@ -1,24 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx - diff --git a/dockerfiles/cli/version/6.0.0-M1/images b/dockerfiles/cli/version/6.0.0-M1/images deleted file mode 100644 index a5fd960c97f6..000000000000 --- a/dockerfiles/cli/version/6.0.0-M1/images +++ /dev/null @@ -1,7 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.0.0-M1 -IMAGE_CHE=eclipse/che-server:6.0.0-M1 -IMAGE_CHE_MULTIUSER=eclipse/che-server-multiuser:6.0.0-M1 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.3.0-rc3 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.3.0.CR2-3 diff --git a/dockerfiles/cli/version/6.0.0-M1/images-stacks b/dockerfiles/cli/version/6.0.0-M1/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.0.0-M1/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.0.0-M2/images b/dockerfiles/cli/version/6.0.0-M2/images deleted file mode 100644 index ec5e899217a6..000000000000 --- a/dockerfiles/cli/version/6.0.0-M2/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.0.0-M2 -IMAGE_CHE=eclipse/che-server:6.0.0-M2 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.3.0-rc3 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.3.0.CR2-3 diff --git a/dockerfiles/cli/version/6.0.0-M2/images-stacks b/dockerfiles/cli/version/6.0.0-M2/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.0.0-M2/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.0.0-M3/images b/dockerfiles/cli/version/6.0.0-M3/images deleted file mode 100644 index 75e47c777d48..000000000000 --- a/dockerfiles/cli/version/6.0.0-M3/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.0.0-M3 -IMAGE_CHE=eclipse/che-server:6.0.0-M3 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.3.0-rc3 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.3.0.CR2-3 diff --git a/dockerfiles/cli/version/6.0.0-M3/images-stacks b/dockerfiles/cli/version/6.0.0-M3/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.0.0-M3/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.0.0-M4/images b/dockerfiles/cli/version/6.0.0-M4/images deleted file mode 100644 index 45925d84f3ed..000000000000 --- a/dockerfiles/cli/version/6.0.0-M4/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.0.0-M4 -IMAGE_CHE=eclipse/che-server:6.0.0-M4 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.3.0-rc3 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.3.0.CR2-3 diff --git a/dockerfiles/cli/version/6.0.0-M4/images-stacks b/dockerfiles/cli/version/6.0.0-M4/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.0.0-M4/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.0.0/images b/dockerfiles/cli/version/6.0.0/images deleted file mode 100644 index 9403197843db..000000000000 --- a/dockerfiles/cli/version/6.0.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.0.0 -IMAGE_CHE=eclipse/che-server:6.0.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.3.0-rc3 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.3.0.CR2-3 diff --git a/dockerfiles/cli/version/6.0.0/images-stacks b/dockerfiles/cli/version/6.0.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.0.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.1.0/images b/dockerfiles/cli/version/6.1.0/images deleted file mode 100644 index ebee1e75e644..000000000000 --- a/dockerfiles/cli/version/6.1.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.1.0 -IMAGE_CHE=eclipse/che-server:6.1.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.3.0.CR2-3 diff --git a/dockerfiles/cli/version/6.1.0/images-stacks b/dockerfiles/cli/version/6.1.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.1.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.10.0/images b/dockerfiles/cli/version/6.10.0/images deleted file mode 100644 index 309557965705..000000000000 --- a/dockerfiles/cli/version/6.10.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.10.0 -IMAGE_CHE=eclipse/che-server:6.10.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/version/6.10.0/images-stacks b/dockerfiles/cli/version/6.10.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.10.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.11.0/images b/dockerfiles/cli/version/6.11.0/images deleted file mode 100644 index 46f96a515249..000000000000 --- a/dockerfiles/cli/version/6.11.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.11.0 -IMAGE_CHE=eclipse/che-server:6.11.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/version/6.11.0/images-stacks b/dockerfiles/cli/version/6.11.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.11.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.12.0/images b/dockerfiles/cli/version/6.12.0/images deleted file mode 100644 index 3d2ed9ddc3d9..000000000000 --- a/dockerfiles/cli/version/6.12.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.12.0 -IMAGE_CHE=eclipse/che-server:6.12.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/version/6.12.0/images-bootstrap b/dockerfiles/cli/version/6.12.0/images-bootstrap deleted file mode 100644 index 02fd7d9460ea..000000000000 --- a/dockerfiles/cli/version/6.12.0/images-bootstrap +++ /dev/null @@ -1,2 +0,0 @@ -BOOTSTRAP_IMAGE_ALPINE=alpine:3.4 -BOOTSTRAP_IMAGE_CHEIP=eclipse/che-ip:6.12.0 diff --git a/dockerfiles/cli/version/6.12.0/images-stacks b/dockerfiles/cli/version/6.12.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.12.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.12.0/images-utilities b/dockerfiles/cli/version/6.12.0/images-utilities deleted file mode 100644 index ea0da7b704d1..000000000000 --- a/dockerfiles/cli/version/6.12.0/images-utilities +++ /dev/null @@ -1,4 +0,0 @@ -UTILITY_IMAGE_CHEACTION=eclipse/che-action:6.12.0 -UTILITY_IMAGE_CHEDIR=eclipse/che-dir:6.12.0 -UTILITY_IMAGE_CHETEST=eclipse/che-test:6.12.0 -UTILITY_IMAGE_CHEMOUNT=eclipse/che-mount:6.12.0 diff --git a/dockerfiles/cli/version/6.13.0/images b/dockerfiles/cli/version/6.13.0/images deleted file mode 100644 index 3206068d8adf..000000000000 --- a/dockerfiles/cli/version/6.13.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.13.0 -IMAGE_CHE=eclipse/che-server:6.13.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/version/6.13.0/images-bootstrap b/dockerfiles/cli/version/6.13.0/images-bootstrap deleted file mode 100644 index b6cea95ced66..000000000000 --- a/dockerfiles/cli/version/6.13.0/images-bootstrap +++ /dev/null @@ -1,2 +0,0 @@ -BOOTSTRAP_IMAGE_ALPINE=alpine:3.4 -BOOTSTRAP_IMAGE_CHEIP=eclipse/che-ip:6.13.0 diff --git a/dockerfiles/cli/version/6.13.0/images-stacks b/dockerfiles/cli/version/6.13.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.13.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.13.0/images-utilities b/dockerfiles/cli/version/6.13.0/images-utilities deleted file mode 100644 index e81cdb700b68..000000000000 --- a/dockerfiles/cli/version/6.13.0/images-utilities +++ /dev/null @@ -1,4 +0,0 @@ -UTILITY_IMAGE_CHEACTION=eclipse/che-action:6.13.0 -UTILITY_IMAGE_CHEDIR=eclipse/che-dir:6.13.0 -UTILITY_IMAGE_CHETEST=eclipse/che-test:6.13.0 -UTILITY_IMAGE_CHEMOUNT=eclipse/che-mount:6.13.0 diff --git a/dockerfiles/cli/version/6.14.0/images b/dockerfiles/cli/version/6.14.0/images deleted file mode 100644 index 4ed95e5d3c84..000000000000 --- a/dockerfiles/cli/version/6.14.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.14.0 -IMAGE_CHE=eclipse/che-server:6.14.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/version/6.14.0/images-bootstrap b/dockerfiles/cli/version/6.14.0/images-bootstrap deleted file mode 100644 index 4a8641acbff4..000000000000 --- a/dockerfiles/cli/version/6.14.0/images-bootstrap +++ /dev/null @@ -1,2 +0,0 @@ -BOOTSTRAP_IMAGE_ALPINE=alpine:3.4 -BOOTSTRAP_IMAGE_CHEIP=eclipse/che-ip:6.14.0 diff --git a/dockerfiles/cli/version/6.14.0/images-stacks b/dockerfiles/cli/version/6.14.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.14.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.14.0/images-utilities b/dockerfiles/cli/version/6.14.0/images-utilities deleted file mode 100644 index 9e6b99df74ac..000000000000 --- a/dockerfiles/cli/version/6.14.0/images-utilities +++ /dev/null @@ -1,4 +0,0 @@ -UTILITY_IMAGE_CHEACTION=eclipse/che-action:6.14.0 -UTILITY_IMAGE_CHEDIR=eclipse/che-dir:6.14.0 -UTILITY_IMAGE_CHETEST=eclipse/che-test:6.14.0 -UTILITY_IMAGE_CHEMOUNT=eclipse/che-mount:6.14.0 diff --git a/dockerfiles/cli/version/6.15.0/images b/dockerfiles/cli/version/6.15.0/images deleted file mode 100644 index 052b08264876..000000000000 --- a/dockerfiles/cli/version/6.15.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.15.0 -IMAGE_CHE=eclipse/che-server:6.15.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/version/6.15.0/images-bootstrap b/dockerfiles/cli/version/6.15.0/images-bootstrap deleted file mode 100644 index 24c8626cded2..000000000000 --- a/dockerfiles/cli/version/6.15.0/images-bootstrap +++ /dev/null @@ -1,2 +0,0 @@ -BOOTSTRAP_IMAGE_ALPINE=alpine:3.4 -BOOTSTRAP_IMAGE_CHEIP=eclipse/che-ip:6.15.0 diff --git a/dockerfiles/cli/version/6.15.0/images-stacks b/dockerfiles/cli/version/6.15.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.15.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.15.0/images-utilities b/dockerfiles/cli/version/6.15.0/images-utilities deleted file mode 100644 index fc554fffd166..000000000000 --- a/dockerfiles/cli/version/6.15.0/images-utilities +++ /dev/null @@ -1,4 +0,0 @@ -UTILITY_IMAGE_CHEACTION=eclipse/che-action:6.15.0 -UTILITY_IMAGE_CHEDIR=eclipse/che-dir:6.15.0 -UTILITY_IMAGE_CHETEST=eclipse/che-test:6.15.0 -UTILITY_IMAGE_CHEMOUNT=eclipse/che-mount:6.15.0 diff --git a/dockerfiles/cli/version/6.16.0/images b/dockerfiles/cli/version/6.16.0/images deleted file mode 100644 index 347f7ed5f0e4..000000000000 --- a/dockerfiles/cli/version/6.16.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.16.0 -IMAGE_CHE=eclipse/che-server:6.16.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/version/6.16.0/images-bootstrap b/dockerfiles/cli/version/6.16.0/images-bootstrap deleted file mode 100644 index 71b58f365fe9..000000000000 --- a/dockerfiles/cli/version/6.16.0/images-bootstrap +++ /dev/null @@ -1,2 +0,0 @@ -BOOTSTRAP_IMAGE_ALPINE=alpine:3.4 -BOOTSTRAP_IMAGE_CHEIP=eclipse/che-ip:6.16.0 diff --git a/dockerfiles/cli/version/6.16.0/images-stacks b/dockerfiles/cli/version/6.16.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.16.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.16.0/images-utilities b/dockerfiles/cli/version/6.16.0/images-utilities deleted file mode 100644 index 5c787f10d83f..000000000000 --- a/dockerfiles/cli/version/6.16.0/images-utilities +++ /dev/null @@ -1,4 +0,0 @@ -UTILITY_IMAGE_CHEACTION=eclipse/che-action:6.16.0 -UTILITY_IMAGE_CHEDIR=eclipse/che-dir:6.16.0 -UTILITY_IMAGE_CHETEST=eclipse/che-test:6.16.0 -UTILITY_IMAGE_CHEMOUNT=eclipse/che-mount:6.16.0 diff --git a/dockerfiles/cli/version/6.17.0/images b/dockerfiles/cli/version/6.17.0/images deleted file mode 100644 index 97d4a1cba2bc..000000000000 --- a/dockerfiles/cli/version/6.17.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.17.0 -IMAGE_CHE=eclipse/che-server:6.17.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/version/6.17.0/images-bootstrap b/dockerfiles/cli/version/6.17.0/images-bootstrap deleted file mode 100644 index 84a480f69b93..000000000000 --- a/dockerfiles/cli/version/6.17.0/images-bootstrap +++ /dev/null @@ -1,2 +0,0 @@ -BOOTSTRAP_IMAGE_ALPINE=alpine:3.4 -BOOTSTRAP_IMAGE_CHEIP=eclipse/che-ip:6.17.0 diff --git a/dockerfiles/cli/version/6.17.0/images-stacks b/dockerfiles/cli/version/6.17.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.17.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.17.0/images-utilities b/dockerfiles/cli/version/6.17.0/images-utilities deleted file mode 100644 index 5724bbf0e39d..000000000000 --- a/dockerfiles/cli/version/6.17.0/images-utilities +++ /dev/null @@ -1,4 +0,0 @@ -UTILITY_IMAGE_CHEACTION=eclipse/che-action:6.17.0 -UTILITY_IMAGE_CHEDIR=eclipse/che-dir:6.17.0 -UTILITY_IMAGE_CHETEST=eclipse/che-test:6.17.0 -UTILITY_IMAGE_CHEMOUNT=eclipse/che-mount:6.17.0 diff --git a/dockerfiles/cli/version/6.18.0/images b/dockerfiles/cli/version/6.18.0/images deleted file mode 100644 index 3b1f1c04b546..000000000000 --- a/dockerfiles/cli/version/6.18.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.18.0 -IMAGE_CHE=eclipse/che-server:6.18.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/version/6.18.0/images-bootstrap b/dockerfiles/cli/version/6.18.0/images-bootstrap deleted file mode 100644 index 92185e237c9d..000000000000 --- a/dockerfiles/cli/version/6.18.0/images-bootstrap +++ /dev/null @@ -1,2 +0,0 @@ -BOOTSTRAP_IMAGE_ALPINE=alpine:3.4 -BOOTSTRAP_IMAGE_CHEIP=eclipse/che-ip:6.18.0 diff --git a/dockerfiles/cli/version/6.18.0/images-stacks b/dockerfiles/cli/version/6.18.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.18.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.18.0/images-utilities b/dockerfiles/cli/version/6.18.0/images-utilities deleted file mode 100644 index 595b248e09d7..000000000000 --- a/dockerfiles/cli/version/6.18.0/images-utilities +++ /dev/null @@ -1,4 +0,0 @@ -UTILITY_IMAGE_CHEACTION=eclipse/che-action:6.18.0 -UTILITY_IMAGE_CHEDIR=eclipse/che-dir:6.18.0 -UTILITY_IMAGE_CHETEST=eclipse/che-test:6.18.0 -UTILITY_IMAGE_CHEMOUNT=eclipse/che-mount:6.18.0 diff --git a/dockerfiles/cli/version/6.19.0/images b/dockerfiles/cli/version/6.19.0/images deleted file mode 100644 index de7db1cef6db..000000000000 --- a/dockerfiles/cli/version/6.19.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.19.0 -IMAGE_CHE=eclipse/che-server:6.19.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/version/6.19.0/images-bootstrap b/dockerfiles/cli/version/6.19.0/images-bootstrap deleted file mode 100644 index 2fde18313d4d..000000000000 --- a/dockerfiles/cli/version/6.19.0/images-bootstrap +++ /dev/null @@ -1,2 +0,0 @@ -BOOTSTRAP_IMAGE_ALPINE=alpine:3.4 -BOOTSTRAP_IMAGE_CHEIP=eclipse/che-ip:6.19.0 diff --git a/dockerfiles/cli/version/6.19.0/images-stacks b/dockerfiles/cli/version/6.19.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.19.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.19.0/images-utilities b/dockerfiles/cli/version/6.19.0/images-utilities deleted file mode 100644 index 479fb19c8211..000000000000 --- a/dockerfiles/cli/version/6.19.0/images-utilities +++ /dev/null @@ -1,4 +0,0 @@ -UTILITY_IMAGE_CHEACTION=eclipse/che-action:6.19.0 -UTILITY_IMAGE_CHEDIR=eclipse/che-dir:6.19.0 -UTILITY_IMAGE_CHETEST=eclipse/che-test:6.19.0 -UTILITY_IMAGE_CHEMOUNT=eclipse/che-mount:6.19.0 diff --git a/dockerfiles/cli/version/6.2.0/images b/dockerfiles/cli/version/6.2.0/images deleted file mode 100644 index a424b9a62bfa..000000000000 --- a/dockerfiles/cli/version/6.2.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.2.0 -IMAGE_CHE=eclipse/che-server:6.2.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.3.0.CR2-3 diff --git a/dockerfiles/cli/version/6.2.0/images-stacks b/dockerfiles/cli/version/6.2.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.2.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.3.0/images b/dockerfiles/cli/version/6.3.0/images deleted file mode 100644 index 45ba9a9f5f95..000000000000 --- a/dockerfiles/cli/version/6.3.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.3.0 -IMAGE_CHE=eclipse/che-server:6.3.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.3.0.CR2-3 diff --git a/dockerfiles/cli/version/6.3.0/images-stacks b/dockerfiles/cli/version/6.3.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.3.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.4.0/images b/dockerfiles/cli/version/6.4.0/images deleted file mode 100644 index 857e468fd6c0..000000000000 --- a/dockerfiles/cli/version/6.4.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.4.0 -IMAGE_CHE=eclipse/che-server:6.4.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.3.0.CR2-3 diff --git a/dockerfiles/cli/version/6.4.0/images-stacks b/dockerfiles/cli/version/6.4.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.4.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.4.1/images b/dockerfiles/cli/version/6.4.1/images deleted file mode 100644 index 13730b114688..000000000000 --- a/dockerfiles/cli/version/6.4.1/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.4.1 -IMAGE_CHE=eclipse/che-server:6.4.1 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.3.0.CR2-3 diff --git a/dockerfiles/cli/version/6.4.1/images-stacks b/dockerfiles/cli/version/6.4.1/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.4.1/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.5.0/images b/dockerfiles/cli/version/6.5.0/images deleted file mode 100644 index 8704fcfb6521..000000000000 --- a/dockerfiles/cli/version/6.5.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.5.0 -IMAGE_CHE=eclipse/che-server:6.5.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.3.0.CR2-3 diff --git a/dockerfiles/cli/version/6.5.0/images-stacks b/dockerfiles/cli/version/6.5.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.5.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.5.1/images b/dockerfiles/cli/version/6.5.1/images deleted file mode 100644 index 8855a9b52b8b..000000000000 --- a/dockerfiles/cli/version/6.5.1/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.5.1 -IMAGE_CHE=eclipse/che-server:6.5.1 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.3.0.CR2-3 diff --git a/dockerfiles/cli/version/6.5.1/images-stacks b/dockerfiles/cli/version/6.5.1/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.5.1/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.5.2/images b/dockerfiles/cli/version/6.5.2/images deleted file mode 100644 index 60479742d690..000000000000 --- a/dockerfiles/cli/version/6.5.2/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.5.2 -IMAGE_CHE=eclipse/che-server:6.5.2 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.3.0.CR2-3 diff --git a/dockerfiles/cli/version/6.5.2/images-stacks b/dockerfiles/cli/version/6.5.2/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.5.2/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.5.3/images b/dockerfiles/cli/version/6.5.3/images deleted file mode 100644 index 78a7049d7f7a..000000000000 --- a/dockerfiles/cli/version/6.5.3/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.5.3 -IMAGE_CHE=eclipse/che-server:6.5.3 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.3.0.CR2-3 diff --git a/dockerfiles/cli/version/6.5.3/images-stacks b/dockerfiles/cli/version/6.5.3/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.5.3/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.6.0/images b/dockerfiles/cli/version/6.6.0/images deleted file mode 100644 index 66efd53b00a6..000000000000 --- a/dockerfiles/cli/version/6.6.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.6.0 -IMAGE_CHE=eclipse/che-server:6.6.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.3.0.CR2-3 diff --git a/dockerfiles/cli/version/6.6.0/images-stacks b/dockerfiles/cli/version/6.6.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.6.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.6.1/images b/dockerfiles/cli/version/6.6.1/images deleted file mode 100644 index a9c0b8874aeb..000000000000 --- a/dockerfiles/cli/version/6.6.1/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.6.1 -IMAGE_CHE=eclipse/che-server:6.6.1 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.3.0.CR2-3 diff --git a/dockerfiles/cli/version/6.6.1/images-stacks b/dockerfiles/cli/version/6.6.1/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.6.1/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.7.0/images b/dockerfiles/cli/version/6.7.0/images deleted file mode 100644 index 07de409e8c37..000000000000 --- a/dockerfiles/cli/version/6.7.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.7.0 -IMAGE_CHE=eclipse/che-server:6.7.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.3.0.CR2-3 diff --git a/dockerfiles/cli/version/6.7.0/images-stacks b/dockerfiles/cli/version/6.7.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.7.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.8.0/images b/dockerfiles/cli/version/6.8.0/images deleted file mode 100644 index f78b860b5197..000000000000 --- a/dockerfiles/cli/version/6.8.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.8.0 -IMAGE_CHE=eclipse/che-server:6.8.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/version/6.8.0/images-stacks b/dockerfiles/cli/version/6.8.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.8.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/6.9.0/images b/dockerfiles/cli/version/6.9.0/images deleted file mode 100644 index 33412c4af3aa..000000000000 --- a/dockerfiles/cli/version/6.9.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:6.9.0 -IMAGE_CHE=eclipse/che-server:6.9.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/version/6.9.0/images-stacks b/dockerfiles/cli/version/6.9.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/6.9.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/7.0.0-RC-1.0/images b/dockerfiles/cli/version/7.0.0-RC-1.0/images deleted file mode 100644 index 1d709413848b..000000000000 --- a/dockerfiles/cli/version/7.0.0-RC-1.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:7.0.0-RC-1.0 -IMAGE_CHE=eclipse/che-server:7.0.0-RC-1.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/version/7.0.0-RC-1.0/images-bootstrap b/dockerfiles/cli/version/7.0.0-RC-1.0/images-bootstrap deleted file mode 100644 index 56a71323f907..000000000000 --- a/dockerfiles/cli/version/7.0.0-RC-1.0/images-bootstrap +++ /dev/null @@ -1,2 +0,0 @@ -BOOTSTRAP_IMAGE_ALPINE=alpine:3.4 -BOOTSTRAP_IMAGE_CHEIP=eclipse/che-ip:7.0.0-RC-1.0 diff --git a/dockerfiles/cli/version/7.0.0-RC-1.0/images-stacks b/dockerfiles/cli/version/7.0.0-RC-1.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/7.0.0-RC-1.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/7.0.0-RC-1.0/images-utilities b/dockerfiles/cli/version/7.0.0-RC-1.0/images-utilities deleted file mode 100644 index be00a5ea8dc9..000000000000 --- a/dockerfiles/cli/version/7.0.0-RC-1.0/images-utilities +++ /dev/null @@ -1,4 +0,0 @@ -UTILITY_IMAGE_CHEACTION=eclipse/che-action:7.0.0-RC-1.0 -UTILITY_IMAGE_CHEDIR=eclipse/che-dir:7.0.0-RC-1.0 -UTILITY_IMAGE_CHETEST=eclipse/che-test:7.0.0-RC-1.0 -UTILITY_IMAGE_CHEMOUNT=eclipse/che-mount:7.0.0-RC-1.0 diff --git a/dockerfiles/cli/version/7.0.0-RC-2.0/images b/dockerfiles/cli/version/7.0.0-RC-2.0/images deleted file mode 100644 index 79f4c97ef87c..000000000000 --- a/dockerfiles/cli/version/7.0.0-RC-2.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:7.0.0-RC-2.0 -IMAGE_CHE=eclipse/che-server:7.0.0-RC-2.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/version/7.0.0-RC-2.0/images-bootstrap b/dockerfiles/cli/version/7.0.0-RC-2.0/images-bootstrap deleted file mode 100644 index 6ef25b6d65c1..000000000000 --- a/dockerfiles/cli/version/7.0.0-RC-2.0/images-bootstrap +++ /dev/null @@ -1,2 +0,0 @@ -BOOTSTRAP_IMAGE_ALPINE=alpine:3.4 -BOOTSTRAP_IMAGE_CHEIP=eclipse/che-ip:7.0.0-RC-2.0 diff --git a/dockerfiles/cli/version/7.0.0-RC-2.0/images-stacks b/dockerfiles/cli/version/7.0.0-RC-2.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/7.0.0-RC-2.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/7.0.0-RC-2.0/images-utilities b/dockerfiles/cli/version/7.0.0-RC-2.0/images-utilities deleted file mode 100644 index d6296afe3f01..000000000000 --- a/dockerfiles/cli/version/7.0.0-RC-2.0/images-utilities +++ /dev/null @@ -1,4 +0,0 @@ -UTILITY_IMAGE_CHEACTION=eclipse/che-action:7.0.0-RC-2.0 -UTILITY_IMAGE_CHEDIR=eclipse/che-dir:7.0.0-RC-2.0 -UTILITY_IMAGE_CHETEST=eclipse/che-test:7.0.0-RC-2.0 -UTILITY_IMAGE_CHEMOUNT=eclipse/che-mount:7.0.0-RC-2.0 diff --git a/dockerfiles/cli/version/7.0.0-beta-1.0/images b/dockerfiles/cli/version/7.0.0-beta-1.0/images deleted file mode 100644 index ff1677cc2643..000000000000 --- a/dockerfiles/cli/version/7.0.0-beta-1.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:7.0.0-beta-1.0 -IMAGE_CHE=eclipse/che-server:7.0.0-beta-1.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/version/7.0.0-beta-1.0/images-bootstrap b/dockerfiles/cli/version/7.0.0-beta-1.0/images-bootstrap deleted file mode 100644 index e597834ccc51..000000000000 --- a/dockerfiles/cli/version/7.0.0-beta-1.0/images-bootstrap +++ /dev/null @@ -1,2 +0,0 @@ -BOOTSTRAP_IMAGE_ALPINE=alpine:3.4 -BOOTSTRAP_IMAGE_CHEIP=eclipse/che-ip:7.0.0-beta-1.0 diff --git a/dockerfiles/cli/version/7.0.0-beta-1.0/images-stacks b/dockerfiles/cli/version/7.0.0-beta-1.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/7.0.0-beta-1.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/7.0.0-beta-1.0/images-utilities b/dockerfiles/cli/version/7.0.0-beta-1.0/images-utilities deleted file mode 100644 index 0a8f0af75233..000000000000 --- a/dockerfiles/cli/version/7.0.0-beta-1.0/images-utilities +++ /dev/null @@ -1,4 +0,0 @@ -UTILITY_IMAGE_CHEACTION=eclipse/che-action:7.0.0-beta-1.0 -UTILITY_IMAGE_CHEDIR=eclipse/che-dir:7.0.0-beta-1.0 -UTILITY_IMAGE_CHETEST=eclipse/che-test:7.0.0-beta-1.0 -UTILITY_IMAGE_CHEMOUNT=eclipse/che-mount:7.0.0-beta-1.0 diff --git a/dockerfiles/cli/version/7.0.0-beta-2.0/images b/dockerfiles/cli/version/7.0.0-beta-2.0/images deleted file mode 100644 index 7d477f6f734e..000000000000 --- a/dockerfiles/cli/version/7.0.0-beta-2.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:7.0.0-beta-2.0 -IMAGE_CHE=eclipse/che-server:7.0.0-beta-2.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/version/7.0.0-beta-2.0/images-bootstrap b/dockerfiles/cli/version/7.0.0-beta-2.0/images-bootstrap deleted file mode 100644 index 96ccb923a108..000000000000 --- a/dockerfiles/cli/version/7.0.0-beta-2.0/images-bootstrap +++ /dev/null @@ -1,2 +0,0 @@ -BOOTSTRAP_IMAGE_ALPINE=alpine:3.4 -BOOTSTRAP_IMAGE_CHEIP=eclipse/che-ip:7.0.0-beta-2.0 diff --git a/dockerfiles/cli/version/7.0.0-beta-2.0/images-stacks b/dockerfiles/cli/version/7.0.0-beta-2.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/7.0.0-beta-2.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/7.0.0-beta-2.0/images-utilities b/dockerfiles/cli/version/7.0.0-beta-2.0/images-utilities deleted file mode 100644 index 263f9952e793..000000000000 --- a/dockerfiles/cli/version/7.0.0-beta-2.0/images-utilities +++ /dev/null @@ -1,4 +0,0 @@ -UTILITY_IMAGE_CHEACTION=eclipse/che-action:7.0.0-beta-2.0 -UTILITY_IMAGE_CHEDIR=eclipse/che-dir:7.0.0-beta-2.0 -UTILITY_IMAGE_CHETEST=eclipse/che-test:7.0.0-beta-2.0 -UTILITY_IMAGE_CHEMOUNT=eclipse/che-mount:7.0.0-beta-2.0 diff --git a/dockerfiles/cli/version/7.0.0-beta-3.0/images b/dockerfiles/cli/version/7.0.0-beta-3.0/images deleted file mode 100644 index 1d6e977c07e8..000000000000 --- a/dockerfiles/cli/version/7.0.0-beta-3.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:7.0.0-beta-3.0 -IMAGE_CHE=eclipse/che-server:7.0.0-beta-3.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/version/7.0.0-beta-3.0/images-bootstrap b/dockerfiles/cli/version/7.0.0-beta-3.0/images-bootstrap deleted file mode 100644 index 941feaf81e9b..000000000000 --- a/dockerfiles/cli/version/7.0.0-beta-3.0/images-bootstrap +++ /dev/null @@ -1,2 +0,0 @@ -BOOTSTRAP_IMAGE_ALPINE=alpine:3.4 -BOOTSTRAP_IMAGE_CHEIP=eclipse/che-ip:7.0.0-beta-3.0 diff --git a/dockerfiles/cli/version/7.0.0-beta-3.0/images-stacks b/dockerfiles/cli/version/7.0.0-beta-3.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/7.0.0-beta-3.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/7.0.0-beta-3.0/images-utilities b/dockerfiles/cli/version/7.0.0-beta-3.0/images-utilities deleted file mode 100644 index 2d42a6a3f58f..000000000000 --- a/dockerfiles/cli/version/7.0.0-beta-3.0/images-utilities +++ /dev/null @@ -1,4 +0,0 @@ -UTILITY_IMAGE_CHEACTION=eclipse/che-action:7.0.0-beta-3.0 -UTILITY_IMAGE_CHEDIR=eclipse/che-dir:7.0.0-beta-3.0 -UTILITY_IMAGE_CHETEST=eclipse/che-test:7.0.0-beta-3.0 -UTILITY_IMAGE_CHEMOUNT=eclipse/che-mount:7.0.0-beta-3.0 diff --git a/dockerfiles/cli/version/7.0.0-beta-4.0/images b/dockerfiles/cli/version/7.0.0-beta-4.0/images deleted file mode 100644 index f684cdc5c253..000000000000 --- a/dockerfiles/cli/version/7.0.0-beta-4.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:7.0.0-beta-4.0 -IMAGE_CHE=eclipse/che-server:7.0.0-beta-4.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/version/7.0.0-beta-4.0/images-bootstrap b/dockerfiles/cli/version/7.0.0-beta-4.0/images-bootstrap deleted file mode 100644 index 5046d0497215..000000000000 --- a/dockerfiles/cli/version/7.0.0-beta-4.0/images-bootstrap +++ /dev/null @@ -1,2 +0,0 @@ -BOOTSTRAP_IMAGE_ALPINE=alpine:3.4 -BOOTSTRAP_IMAGE_CHEIP=eclipse/che-ip:7.0.0-beta-4.0 diff --git a/dockerfiles/cli/version/7.0.0-beta-4.0/images-stacks b/dockerfiles/cli/version/7.0.0-beta-4.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/7.0.0-beta-4.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/7.0.0-beta-4.0/images-utilities b/dockerfiles/cli/version/7.0.0-beta-4.0/images-utilities deleted file mode 100644 index a5265446d7fe..000000000000 --- a/dockerfiles/cli/version/7.0.0-beta-4.0/images-utilities +++ /dev/null @@ -1,4 +0,0 @@ -UTILITY_IMAGE_CHEACTION=eclipse/che-action:7.0.0-beta-4.0 -UTILITY_IMAGE_CHEDIR=eclipse/che-dir:7.0.0-beta-4.0 -UTILITY_IMAGE_CHETEST=eclipse/che-test:7.0.0-beta-4.0 -UTILITY_IMAGE_CHEMOUNT=eclipse/che-mount:7.0.0-beta-4.0 diff --git a/dockerfiles/cli/version/7.0.0-beta-5.0/images b/dockerfiles/cli/version/7.0.0-beta-5.0/images deleted file mode 100644 index 0c24d9f9e42f..000000000000 --- a/dockerfiles/cli/version/7.0.0-beta-5.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:7.0.0-beta-5.0 -IMAGE_CHE=eclipse/che-server:7.0.0-beta-5.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/version/7.0.0-beta-5.0/images-bootstrap b/dockerfiles/cli/version/7.0.0-beta-5.0/images-bootstrap deleted file mode 100644 index de2873d72a34..000000000000 --- a/dockerfiles/cli/version/7.0.0-beta-5.0/images-bootstrap +++ /dev/null @@ -1,2 +0,0 @@ -BOOTSTRAP_IMAGE_ALPINE=alpine:3.4 -BOOTSTRAP_IMAGE_CHEIP=eclipse/che-ip:7.0.0-beta-5.0 diff --git a/dockerfiles/cli/version/7.0.0-beta-5.0/images-stacks b/dockerfiles/cli/version/7.0.0-beta-5.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/7.0.0-beta-5.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/7.0.0-beta-5.0/images-utilities b/dockerfiles/cli/version/7.0.0-beta-5.0/images-utilities deleted file mode 100644 index 04c593960d49..000000000000 --- a/dockerfiles/cli/version/7.0.0-beta-5.0/images-utilities +++ /dev/null @@ -1,4 +0,0 @@ -UTILITY_IMAGE_CHEACTION=eclipse/che-action:7.0.0-beta-5.0 -UTILITY_IMAGE_CHEDIR=eclipse/che-dir:7.0.0-beta-5.0 -UTILITY_IMAGE_CHETEST=eclipse/che-test:7.0.0-beta-5.0 -UTILITY_IMAGE_CHEMOUNT=eclipse/che-mount:7.0.0-beta-5.0 diff --git a/dockerfiles/cli/version/7.0.0/images b/dockerfiles/cli/version/7.0.0/images deleted file mode 100644 index 20c9ac3a43c9..000000000000 --- a/dockerfiles/cli/version/7.0.0/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:7.0.0 -IMAGE_CHE=eclipse/che-server:7.0.0 -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/version/7.0.0/images-bootstrap b/dockerfiles/cli/version/7.0.0/images-bootstrap deleted file mode 100644 index b3c3318511b0..000000000000 --- a/dockerfiles/cli/version/7.0.0/images-bootstrap +++ /dev/null @@ -1,2 +0,0 @@ -BOOTSTRAP_IMAGE_ALPINE=alpine:3.4 -BOOTSTRAP_IMAGE_CHEIP=eclipse/che-ip:7.0.0 diff --git a/dockerfiles/cli/version/7.0.0/images-stacks b/dockerfiles/cli/version/7.0.0/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/7.0.0/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/7.0.0/images-utilities b/dockerfiles/cli/version/7.0.0/images-utilities deleted file mode 100644 index 66672e30c0e5..000000000000 --- a/dockerfiles/cli/version/7.0.0/images-utilities +++ /dev/null @@ -1,4 +0,0 @@ -UTILITY_IMAGE_CHEACTION=eclipse/che-action:7.0.0 -UTILITY_IMAGE_CHEDIR=eclipse/che-dir:7.0.0 -UTILITY_IMAGE_CHETEST=eclipse/che-test:7.0.0 -UTILITY_IMAGE_CHEMOUNT=eclipse/che-mount:7.0.0 diff --git a/dockerfiles/cli/version/latest.ver b/dockerfiles/cli/version/latest.ver deleted file mode 100644 index ca686ea99b49..000000000000 --- a/dockerfiles/cli/version/latest.ver +++ /dev/null @@ -1 +0,0 @@ -7.0.0-RC-2.0 diff --git a/dockerfiles/cli/version/latest/images b/dockerfiles/cli/version/latest/images deleted file mode 100644 index 342ff92804cf..000000000000 --- a/dockerfiles/cli/version/latest/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:latest -IMAGE_CHE=eclipse/che-server:latest -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/version/latest/images-bootstrap b/dockerfiles/cli/version/latest/images-bootstrap deleted file mode 100644 index 95dce935f702..000000000000 --- a/dockerfiles/cli/version/latest/images-bootstrap +++ /dev/null @@ -1,2 +0,0 @@ -BOOTSTRAP_IMAGE_ALPINE=alpine:3.4 -BOOTSTRAP_IMAGE_CHEIP=eclipse/che-ip:rc diff --git a/dockerfiles/cli/version/latest/images-stacks b/dockerfiles/cli/version/latest/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/latest/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/latest/images-utilities b/dockerfiles/cli/version/latest/images-utilities deleted file mode 100644 index 240bca2546b5..000000000000 --- a/dockerfiles/cli/version/latest/images-utilities +++ /dev/null @@ -1,4 +0,0 @@ -UTILITY_IMAGE_CHEACTION=eclipse/che-action:rc -UTILITY_IMAGE_CHEDIR=eclipse/che-dir:rc -UTILITY_IMAGE_CHETEST=eclipse/che-test:rc -UTILITY_IMAGE_CHEMOUNT=eclipse/che-mount:rc diff --git a/dockerfiles/cli/version/nightly/images b/dockerfiles/cli/version/nightly/images deleted file mode 100644 index 96052d7cdf84..000000000000 --- a/dockerfiles/cli/version/nightly/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:nightly -IMAGE_CHE=eclipse/che-server:nightly -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/version/nightly/images-bootstrap b/dockerfiles/cli/version/nightly/images-bootstrap deleted file mode 100644 index 562b4fc61404..000000000000 --- a/dockerfiles/cli/version/nightly/images-bootstrap +++ /dev/null @@ -1,2 +0,0 @@ -BOOTSTRAP_IMAGE_ALPINE=alpine:3.4 -BOOTSTRAP_IMAGE_CHEIP=eclipse/che-ip:nightly diff --git a/dockerfiles/cli/version/nightly/images-stacks b/dockerfiles/cli/version/nightly/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/nightly/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/nightly/images-utilities b/dockerfiles/cli/version/nightly/images-utilities deleted file mode 100644 index 596e10b45ef8..000000000000 --- a/dockerfiles/cli/version/nightly/images-utilities +++ /dev/null @@ -1,4 +0,0 @@ -UTILITY_IMAGE_CHEACTION=eclipse/che-action:nightly -UTILITY_IMAGE_CHEDIR=eclipse/che-dir:nightly -UTILITY_IMAGE_CHETEST=eclipse/che-test:nightly -UTILITY_IMAGE_CHEMOUNT=eclipse/che-mount:nightly diff --git a/dockerfiles/cli/version/rc/images b/dockerfiles/cli/version/rc/images deleted file mode 100644 index 74161c607de4..000000000000 --- a/dockerfiles/cli/version/rc/images +++ /dev/null @@ -1,6 +0,0 @@ -IMAGE_INIT=eclipse/che-init:rc -IMAGE_CHE=eclipse/che-server:rc -IMAGE_COMPOSE=docker/compose:1.10.1 -IMAGE_TRAEFIK=traefik:v1.5.0 -IMAGE_POSTGRES=centos/postgresql-96-centos7:9.6 -IMAGE_KEYCLOACK=jboss/keycloak-openshift:3.4.3.Final diff --git a/dockerfiles/cli/version/rc/images-bootstrap b/dockerfiles/cli/version/rc/images-bootstrap deleted file mode 100644 index 95dce935f702..000000000000 --- a/dockerfiles/cli/version/rc/images-bootstrap +++ /dev/null @@ -1,2 +0,0 @@ -BOOTSTRAP_IMAGE_ALPINE=alpine:3.4 -BOOTSTRAP_IMAGE_CHEIP=eclipse/che-ip:rc diff --git a/dockerfiles/cli/version/rc/images-stacks b/dockerfiles/cli/version/rc/images-stacks deleted file mode 100644 index 73398d4dd94d..000000000000 --- a/dockerfiles/cli/version/rc/images-stacks +++ /dev/null @@ -1,23 +0,0 @@ -eclipse/alpine_jdk8 -eclipse/aspnet -eclipse/centos_jdk8 -eclipse/cpp_gcc -eclipse/debian_jdk8 -eclipse/debian_jdk8_node -eclipse/debian_jre -eclipse/dotnet_core -eclipse/hadoop-dev -eclipse/meteor -eclipse/node -eclipse/php -eclipse/platformio -eclipse/ruby_rails -eclipse/selenium -eclipse/ubuntu_android -eclipse/ubuntu_go -eclipse/ubuntu_gradle -eclipse/ubuntu_jdk8 -eclipse/ubuntu_jre -eclipse/ubuntu_python -eclipse/ubuntu_wildfly8 -registry.centos.org/che-stacks/vertx diff --git a/dockerfiles/cli/version/rc/images-utilities b/dockerfiles/cli/version/rc/images-utilities deleted file mode 100644 index 240bca2546b5..000000000000 --- a/dockerfiles/cli/version/rc/images-utilities +++ /dev/null @@ -1,4 +0,0 @@ -UTILITY_IMAGE_CHEACTION=eclipse/che-action:rc -UTILITY_IMAGE_CHEDIR=eclipse/che-dir:rc -UTILITY_IMAGE_CHETEST=eclipse/che-test:rc -UTILITY_IMAGE_CHEMOUNT=eclipse/che-mount:rc diff --git a/dockerfiles/dir/.require b/dockerfiles/dir/.require deleted file mode 100644 index a65b41774ad5..000000000000 --- a/dockerfiles/dir/.require +++ /dev/null @@ -1 +0,0 @@ -lib diff --git a/dockerfiles/dir/Dockerfile b/dockerfiles/dir/Dockerfile deleted file mode 100644 index cdbb4ab05bee..000000000000 --- a/dockerfiles/dir/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2017 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 -# -# build: -# docker build -t eclipse/che-dir . -# -# use: -# docker run -v /var/run/docker.sock:/var/run/docker.sock eclipse/che-dir [command] - -FROM ${BUILD_ORGANIZATION}/${BUILD_PREFIX}-lib:${BUILD_TAG} - -ENTRYPOINT ["node", "/che-lib/index.js", "che-dir"] diff --git a/dockerfiles/dir/README.md b/dockerfiles/dir/README.md deleted file mode 100644 index 81097d885f3c..000000000000 --- a/dockerfiles/dir/README.md +++ /dev/null @@ -1,33 +0,0 @@ -### Creating an Eclipse Che instance from a local directory - -## Build Docker container -``` -$ build.sh (on Unix) -> build.bat (on Windows) -``` - -## Run container - -Check no docker Eclipse Che container is alive and kill it if any -``` -$ docker ps -a -``` - -Clone a folder -``` -$ git clone https://github.com/che-samples/web-java-spring-petclinic -``` - -Go into this checkout directory -``` -$ cd web-java-spring-petclinic -``` - -Run script -``` -docker run -v /var/run/docker.sock:/var/run/docker.sock \ - -v "$PWD":"$PWD" --rm eclipse/che-file \ - $PWD -``` - -note: if Eclipse Che is already started, it does not handle yet this state diff --git a/dockerfiles/dir/build.sh b/dockerfiles/dir/build.sh deleted file mode 100755 index bc7daa0a6e0a..000000000000 --- a/dockerfiles/dir/build.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2017 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:dir "$@" -build diff --git a/dockerfiles/init/Dockerfile b/dockerfiles/init/Dockerfile deleted file mode 100644 index 7d898e7d4cc7..000000000000 --- a/dockerfiles/init/Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -# Initializes an empty directory with the templates needed to configure and run Che. -# -# build: -# docker build -t eclipse/che-init: . -# -# use (to copy files onto folder): -# docker run -v $(pwd):/che eclipse/che-init: -# -# use (to run puppet config): -# docker run --entrypoint=/usr/bin/puppet eclipse/che-init: apply - - -FROM puppet/puppet-agent-alpine:4.6.2 - -# install openssh needed to generate ssh keys -RUN apk --update add openssh \ - && rm -rf /var/cache/apk/* \ - && mkdir -p /files \ - && mkdir -p /etc/puppet/modules \ - && mkdir -p /etc/puppet/manifests \ - && mkdir -p /files/docs - -COPY manifests /etc/puppet/manifests -COPY modules /etc/puppet/modules -COPY entrypoint.sh / -RUN chmod +x entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] diff --git a/dockerfiles/init/build.sh b/dockerfiles/init/build.sh deleted file mode 100755 index bde076ef260a..000000000000 --- a/dockerfiles/init/build.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2017 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:init "$@" -build diff --git a/dockerfiles/init/entrypoint.sh b/dockerfiles/init/entrypoint.sh deleted file mode 100644 index bfb5da8b2428..000000000000 --- a/dockerfiles/init/entrypoint.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial Implementation -# - -cp -rf /files/docs /copy - -# do not copy che.env if exist -if [ ! -f /copy/che.env ]; then - # if exist add addon env values to main env file. - if [ -f /etc/puppet/addon.env ]; then - cat /etc/puppet/addon.env >> /etc/puppet/manifests/che.env - fi - cp /etc/puppet/manifests/che.env /copy -fi diff --git a/dockerfiles/init/manifests/che.env b/dockerfiles/init/manifests/che.env deleted file mode 100644 index b353388e8f8f..000000000000 --- a/dockerfiles/init/manifests/che.env +++ /dev/null @@ -1,668 +0,0 @@ -######################################################################################## -##### ##### -##### CHE SYSTEM ##### -##### ##### -# -# Parameters that affect the initial system operation. -# - -# IP address, hostname, or DNS -# The IP address or DNS name of where the Che endpoint will service your users. -# If you are running this on a local system, we auto-detect this value as the IP -# address of your Docker daemon. On many systems, especially those from cloud hosters -# like DigitalOcean, you must explicitly set this to the external IP address or -# DNS entry provided by the provider. This value can be overridden on the command -# line with '-e CHE_HOST='. -#CHE_HOST=localhost - -# Port -# The port on the host Che will bind itself to. This value can be overridden on the -# command line with '-e CHE_PORT='. -#CHE_PORT=8080 - -# Proxies -# Che's internal services such as Java & curl need system properties applied -# so they can reach the Internet. Che uses the Internet to reach DockerHub -# and to route workspace activity. Che is configured to inherit proxy -# parameters from your Docker daemon settings. Those settings are applied -# to these variables automatically during initialization, but you can override -# them here. -# -# Please be mindful of proxy URL formatting. Proxies are unforgiving if the URL is -# not typed properly, including the protocol and a trailing slash '/'. -#CHE_HTTP_PROXY=http://myproxy.com:8001/ -#CHE_HTTPS_PROXY=http://myproxy.com:8001/ -#CHE_NO_PROXY= - -# Proxies for Workspaces -# The proxy values that will be set as environment variables within each user's. -# workspace. Set these to allow users Internet access if they are behind a proxy. -#CHE_WORKSPACE_HTTP__PROXY=http://myproxy.com:8001/ -#CHE_WORKSPACE_HTTPS__PROXY=http://myproxy.com:8001/ -#CHE_WORKSPACE_NO__PROXY= - -# DNS resolving servers -# Comma separate list of IP address that point to DNS resolving servers. In -# some secure environments or those behind a proxy, custom DNS resolution -# is required to resolve DNS names. You can set internal DNS servers or external -# ones to this configuration. This applies DNS resolution to the Che server and -# to the runtimes of the workspaces created from this Che server. This value -# defaults to inheriting DNS resolver list from host running Che. -#CHE_DNS_RESOLVERS= - -# JPDA -# If using Che in development mode, activate this property to enable JPDA -# mode within Che's internal Tomcat -#CHE_DEBUG_SUSPEND=false -#CHE_DEBUG_PORT=8000 - -# Che master logs -# -# Choose variant of Che master logs encoding and storing. Default is `plaintext`. -# Another supported value is `json` which makes Che master produce JSON encoded logs -# in system output of PID 1 process of container. Useful for storing logs in systems such as Logstash. -# CHE_LOGS_APPENDERS_IMPL=plaintext - -# Sets configuration for listed loggers. -# It is comma separated list of =. -# In case if some logger name or logger level are omitted this pair will be silently ignored. -#CHE_LOGGER_CONFIG==,= - - -######################################################################################## -##### ##### -##### WORKSPACES ##### -##### ##### -# -# User workspaces have their own runtimes. Those runtimes are composed of 1..n containers. -# We call each container a 'machine' as it is a dedicated runtime. One of the machines for -# a workspace must be designated as the 'development' machine, which installs Che agents to -# provide additional services to the user. These parameters configure how Che manages user -# machines and the agents that are deployed within them. -# -# Since workspaces have their own runtimes, they have separate proxies that do not inherit -# from system proxies that you have configured for your Docker daemon. -# -# Extra Hosts for Workspaces -# Comma separated list of : entries that will be added to the user's -# /etc/hosts file within their workspace runtimes. Configure this to give user -# access to systems within your network. This is set when DNS resolvers do not -# parse hostname entries properly. -#CHE_WORKSPACE_HOSTS=:,: - -# Memory -# The recommended RAM limit for new workspaces when created from the dashboard. -#CHE_WORKSPACE_DEFAULT__MEMORY__LIMIT__MB=1024 -# The recommended RAM allocation request for new workspaces when created from the dashboard. -#CHE_WORKSPACE_DEFAULT__MEMORY__REQUEST__MB=512 - -# Memory Swap -# Adjust machine swap memory by multiplication current machnine memory on provided -# value. Default is 0 which means disabled swap, if set multiplier value equal to 0.5 -# machine swap will be configured with size that equal to half of current machine memory. -# It should be rare that you would configure this. See Docker memory swap online -# for background. -#CHE_DOCKER_SWAP=0 - -# Host Volume Mounts -# Semicolon separated list of volume mounts. Che will volume mount these host folders -# into each workspace. This is a way to allow you to provide access to NAS shared -# across many workspaces. -#CHE_WORKSPACE_VOLUME=/path/on/host:/path/in/workspace:ro,Z;/path/to/host2:/path/in/workspace2:ro,Z; - -# Privileged Mode -# Set to `true` if you would like user workspaces to be started with Docker's -# privileged mode. Please be careful when setting this property. This allows -# user workspaces to gain access to the underly host with root privileges. -# However, privileged mode is needed if users want to launch their own Docker -# containers from within their Docker-powered workspace. -#CHE_DOCKER_PRIVILEGED=false - -# HostConfig SecurityOpt Parameters -# This parameter allows to specify custom security options for the created docker container. -# seccomp:unconfined is the default for kubernetes, but not for docker. This is needed -# for debugging with gdbserver. See https://github.com/eclipse/che/issues/4284 for details. -# Parameters are passed as an array, so you can add multiple -# values comma seperated. Please also see https://docs.docker.com/engine/api/v1.21/#2-endpoints, -# in particular the "HostConfig":{"SecurityOpt": []} entry. If this parameter is empty, -# docker blocks certain Syscalls by default https://docs.docker.com/engine/security/seccomp/ -# WARNING: if you give incorrect values, docker gives an error and doesn't start the container -# Example: che.docker.securityopt=seccomp:unconfined,apparmor:unconfined -#CHE_DOCKER_SECURITYOPT=seccomp:unconfined - -# Workspace logs root -# Defines the directory inside the machine where all the workspace logs are placed. -# The value of this folder should be provided into machine e.g. like environment variable -# so agents developers can use this directory for backup agents logs. -#CHE_WORKSPACE_LOGS_ROOT__DIR=/workspace_logs - - -# Workspace Java Options -# Java command line options to be added to JVM's that running within workspaces. -#CHE_WORKSPACE_JAVA__OPTIONS=-XX:MaxRAM=150m -XX:MaxRAMFraction=2 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom - -# Workspace Agent Maven Options -# Maven command line options added to JVM's that run agents within workspaces. -#CHE_WORKSPACE_MAVEN__OPTIONS=-XX:MaxRAM=150m -XX:MaxRAMFraction=2 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom - -# Workspace Agent Java Options -# Default java command line options to be added to JVM that run workspace agent. -#CHE_WORKSPACE_WSAGENT__JAVA__OPTIONS=-XX:MaxRAM=600m -XX:MaxRAMFraction=1 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xms50m -Dfile.encoding=UTF8 -Djava.security.egd=file:/dev/./urandom - -######################################################################################## -##### ##### -##### NETWORKING FOR CHE ON DOCKER ##### -##### ##### -# -# Affects how the Che server connects to the Docker Daemon, how the Che server and -# workspaces establish connections to one another, and also how remote browser clients -# should discover and connect to workspaces. -# -# Che goes through a progression algorithm to establish the protocol, IP address and -# port to establish communications with it is booting or starting a workspace. -# -# Browser --> Che Server -# 1. Default is 'http://localhost:${SERVER_PORT}/api'. -# 2. Else use the value of CHE_API -# -# Che Server --> Docker Daemon Progression: -# 1. Use the value of CHE_INFRA_DOCKER_DAEMON__URL -# 2. Else, use the value of DOCKER_HOST system variable -# 3. Else, use Unix socket over unix:///var/run/docker.sock -# -# Che Server --> Workspace Connection: - -# - If CHE_DOCKER_IP is set use its value -# - Else use the address of the workspace container within the docker network and exposed ports -# -# Browser --> Workspace Connection: -# - If set use the value of CHE_DOCKER_IP_EXTERNAL -# - Else, if Docker for Mac or Windows use localhost -# - Else, if set use the value of CHE_DOCKER_IP -# - Else use the address of the workspace container within the docker network and exposed ports -# -# Workspace Agent --> Che Server -# 1. Default is 'http://che-host:${SERVER_PORT}/api', where 'che-host' -# is IP of server. -# 2. Else, use value of CHE_INFRA_DOCKER_MASTER__API__ENDPOINT -# 3. Else, if 'docker0' interface is unreachable, then 'che-host' replaced with -# 172.17.42.1 or 192.168.99.1 -# 4. Else, print connection exception - -# Che Server API Endpoint -# The location of the API end point where dashboard and IDE clients will look for -# interacting with the Che server, which we also call the workspace master. -#CHE_API=http://${CHE_HOST}:${CHE_PORT}/api - -# Che Server default websocket endpoint. -# Provides basic communication endpoint where clients can get/push statuses/output. -#CHE_WEBSOCKET_ENDPOINT=ws://${CHE_HOST}:${CHE_PORT}/api/websocket - -# Docker Daemon URL -# How the Che server will discover the location of the Docker daemon. If this is -# not set, then Che will use DOCKER_HOST or the default unix:///var/run/docker.sock. -# It would be rare to need to set this as most clients set DOCKER_HOST or volume -# mount a Docker socket when starting the Che CLI. -#CHE_INFRA_DOCKER_DAEMON__URL=NULL - -# Docker Host -# How Che will connect to the Docker host if CHE_INFRA_DOCKER_DAEMON__URL is not set. This -# value can be provided on the command line as well. If this value is not set, then -# Che will use the volume mount of unix:///var/run/docker.sock. -#DOCKER_HOST=tcp://localhost:2375 - -# Docker IP Address -# The IP address of the Docker daemon that is running on your host. The Che server -# uses this IP address to establish a connection to your workspaces when they -# first boot. This is different from how the Che server first establishes a -# connection to the Docker daemon. After a Che server has instructed a Docker -# Daemon to create a workspace, the Che server then discovers the location of the -# workspace using the value of this IP address. We use auto-discovery to determine -# this IP address. You can provide this value to override the default discovery -# which searches Unix sockets and DOCKER_HOST. -#CHE_DOCKER_IP=172.17.0.1 - -# External Docker IP Address -# The external IP address used by browsers to connect to workspace containers that -# are running on a Docker network. After Che has created a workspace runtime, those -# Docker containers need to be reachable by remote browsers. Browsers will default -# to using CHE_DOCKER_IP, then unix sockets, or DOCKER_HOST if this is not set. -# This will generally work if the browser and the workspace are on the same network. -# However, if the browser and the workspaces are on different networks, then you -# may need to set this value to the external IP address of your host or Docker to -# make workspaces reachable. -#CHE_DOCKER_IP_EXTERNAL=NULL - -# Usage of single-port routing. -# By enabling single-port, all browser traffic to Che or any workspace will be routed -# through the value that you have set to CHE_PORT`, or 8080 if not set. Setting this -# property will transform the launch sequence of Che to launch a Traefik reverse proxy. -# The reverse proxy will act as the traffic endpoint for all browser communications. -# When a new workspace is started or stopped, Che will update Traefik's configuration -# with rules for how browser traffic should be routed to Che or a workspace. -# -# With single-port, each service running in a workspace and exposing ports has its own hostname. -# Example : workspace agent will have a hostname like : ws-agent.workspace-id....domain.name -# By default the domain name will use nip.io which allow to provide wildcard DNS without any -# user configuration. -CHE_SINGLE_PORT=false - -# Wildcard DNS host and port for the single port mode. Default is nip.io. -# Only http protocol is currently supported. -#CHE_SINGLEPORT_WILDCARD__DOMAIN_HOST=NULL -#CHE_SINGLEPORT_WILDCARD__DOMAIN_PORT=NULL - -# IP-less wildcard dns in single mode. This needs a *.domain.tld DNS entry. (Use it instead of -# nip.io) -#CHE_SINGLEPORT_WILDCARD__DOMAIN_IPLESS=false - -# Default rewriter for URLs in links. -# This variable is automatically overridden in single port mode. -#CHE_INFRA_DOCKER_URL__REWRITER=DEFAULT - -# Time(in seconds) that limits the docker build process. -# The default value is 8 minutes, after which the build will be considered as failed. -# CHE_INFRA_DOCKER_BUILD__TIMEOUT__SEC=480 - -######################################################################################## -##### ##### -##### DOCKER ##### -##### ##### -# -# Docker Registry for Workspace Snapshots -# Docker is the default machine implementation within Che. Workspaces are powered -# by machines that are constructed when the workspace is started. The images used to -# generate containers for the machines can come from DockerHub or a private -# Docker registry. You can configure this property with a URL to your -# registry to alter the location. -#CHE_DOCKER_REGISTRY=${CHE_REGISTRY_HOST}:5000 -# -# Specify workspace-master container memory limit. -#CHE_MASTER_CONTAINER_RAM=750m -# -# By default, if a user accesses a workspace from its unique URL (instead of the -# dashboard interface), then the workspace is automatically started by Che. -# You can set this property to false to disable this behavior. -#CHE_WORKSPACE_AUTO__START=true - -# Private Docker Images -# If pushing snap images to a registry requires authenticated access to the -# registry. Or, if your stacks reference private images which require authenticated -# access to a registry in order to pull, then you can configure 1..n registries -# with authentication access. We will perform a `docker login` with this -# credentials before performing a snap or a pull. -#CHE_DOCKER_REGISTRY_AUTH__URL=https://index.docker.io/v1/ -#CHE_DOCKER_REGISTRY_AUTH__USERNAME= -#CHE_DOCKER_REGISTRY_AUTH__PASSWORD= -#CHE_DOCKER_REGISTRY_AWS_REGISTRY1_ID=id1 -#CHE_DOCKER_REGISTRY_AWS_REGISTRY1_REGION=region1 -#CHE_DOCKER_REGISTRY_AWS_REGISTRY1_ACCESS__KEY__ID=key_id1 -#CHE_DOCKER_REGISTRY_AWS_REGISTRY1_SECRET__ACCESS__KEY=secret1 - -# Force Image Update -# If true, then Che always pulls an image from a registry even if it is cached -# If false, Docker only pulls the image if it does not exist locally. This can -# create situations where images are not current, but a forced pull is slower. -#CHE_DOCKER_ALWAYS__PULL__IMAGE=true - -# Control User Processes -# Limits the number of processes that can be forked inside a cgroup. Set -1 for -# unlimited. Requires Docker running on a 4.3 Linux kernel. -#CHE_DOCKER_PIDS__LIMIT=-1 - -# CPU Core Limits -# Limit the CPU cores used for running Che workspaces as containers. -# Example: -# CHE_DOCKER_CPUSET__CPUS=0-3 -# CHE_DOCKER_CPUSET__CPUS=0,2 -# See more at https://docs.docker.com/engine/reference/run/#/cpuset-constraint -#CHE_DOCKER_CPUSET__CPUS=NULL - -# CPU Consumption Limit -# Limit the CPU utilitization given to containers powering workspaces started -# by Che. 'period' sets the amount of units for each CPU core. 'quota' sets the -# sets amount of units available per whole CPU. -# Max value of quota could be period * number of CPU cores in a system. -# Example: -# These values allows usage of 100% of 2 cores on 2+ cores system. -# Period declares that 100% is equal to 5000 units -# and container is allowed to use 2x more than 1 core. -# Although max consumption is explained in cores performance workload will be -# split between several cores. -# CHE_DOCKER_CPU__PERIOD=5000 -# CHE_DOCKER_CPU__QUOTA=10000 -# In this example limit is set to half of a CPU core. -# CHE_DOCKER_CPU__PERIOD=10000 -# CHE_DOCKER_CPU__QUOTA=5000 -# See more at https://docs.docker.com/engine/reference/run/#/cpu-period-constraint -# https://docs.docker.com/engine/reference/run/#/cpu-quota-constraint -#CHE_DOCKER_CPU__PERIOD=0 -#CHE_DOCKER_CPU__QUOTA=0 - -# CGroup Parent -# CGroups allow admins to to configure limits on nodes in a system in a specific -# way. The value can start with a slash which means it will be absolute or -# without a slash for relative value. Docker will create this cgroup if it is missing. -# Admin can configure limits on this cgroup on all nodes in a system specific way. -# Example: -# On Ubuntu 16.04 use CHE_DOCKER_PARENT__CGROUP=/my_group. Then let container -# create cgoup by running Che. Then edit -# /sys/fs/cgroup//my_group/ -# For example to limit CPU cores to 0-1 put value "0-1" into file -# /sys/fs/cgroup/cpuset/my_group/cpuset.cpus -# See more at https://docs.docker.com/engine/reference/run/#/specifying-custom-cgroups -#CHE_DOCKER_PARENT__CGROUP=NULL - -# SELinux Options -# By default, your source code is mounted into a workspace into /projects folder. -# On SELinux and other OS, you may need to add additional mounting attributes. -#CHE_DOCKER_VOLUMES__PROJECTS__OPTIONS=Z -#CHE_DOCKER_VOLUMES__AGENT__OPTIONS=ro,Z - -# Docker Cleanup -# Unused containers and networks from Che and workspaces need to be cleaned up -# periodically. -#CHE_DOCKER_CLEANUP__PERIOD__MIN=60 - - -######################################################################################## -##### ##### -##### OAUTH ##### -##### ##### -# -# You can configure a 3rd party provider's oAuth, which will be used for your users when -# they initiate Git actions from within Che. -# -# GitHub -#CHE_OAUTH_GITHUB_CLIENTID=your_github_client_id -#CHE_OAUTH_GITHUB_CLIENTSECRET=your_github_client_secret -#CHE_OAUTH_GITHUB_AUTHURI=https://github.com/login/oauth/authorize -#CHE_OAUTH_GITHUB_TOKENURI=https://github.com/login/oauth/access_token -#CHE_OAUTH_GITHUB_REDIRECTURIS=http://localhost:${CHE_PORT}/api/oauth/callback - - - -######################################################################################## -##### ##### -##### JMX ##### -##### ##### -# -# JMX provides a management interface point to within the Che container. JMX is not -# use by other containers such as haproxy or nginx. While Che is running, grab the -# IP address of the Che container and you can connect to its embedded JMX server. -# JMX is disabled by default, uncomment CHE_JMX_ENABLED=true to enable it. -# -#CHE_JMX_ENABLED=true -#CHE_JMX_USERNAME=admin -#CHE_JMX_PASSWORD=Che - - - -######################################################################################## -##### ##### -##### CUSTOM ##### -##### ##### -# Custom che.properties Property -# Che's server loads name=value properties in a .properties file. Those values can -# be seen by custom extensions that are packaged within a Che server. There are -# also Che properties that are rarely configured that are shown in documentation -# that can be added with a custom format here. You can add as many as you would like. -# -# Add a new property in the format of CHE_=value. If in your -# you have a single underscore '_', that will be replaced with a -# dot '.'. A double underscore '__' will be replaced with a single underscore '_'. -# -# System Super Privileged Mode -# Grants users with the manageSystem permission additional permissions for -# getByKey, getByNameSpace, stopWorkspaces, and getResourcesInformation. -# These are not given to admins by default and these permissions allow -# admins gain visibility to any workspace along with naming themselves -# with admin privileges to those workspaces. -#SYSTEM_SUPER__PRIVILEGED__MODE=false - -# A complete list of internal properties used by Che are available in the default -# properties file that is embedded in the server's runtime. You can view it in our -# GitHub repository: https://github.com/eclipse/che/blob/master/assembly/assembly-wsmaster-war/src/main/webapp/WEB-INF/classes/codenvy/che.properties - -######################################################################################## -##### ##### -##### STACKS ##### -##### ##### -# -# Defines whether stacks loaded once or each time server starts. -# If value is 'false' stacks will be loaded once after database is initialized, -# otherwise stacks will be loaded each time server starts. -# Stacks loading overrides existing predefined stacks with new data -# defined in stacks.json. -# - 'default' : false -# Note that this property is needed for backward compatibility and will be removed soon. -#CHE_PREDEFINED_STACKS_RELOAD__ON__START=false - -######################################################################################## -##### ##### -##### Kubernetes Infrastructure ##### -##### ##### -# - -#Configuration of Kubernetes client that Infra will use -#CHE_INFRA_KUBERNETES_MASTER__URL= -#CHE_INFRA_KUBERNETES_TRUST__CERTS= - -# Defines Kubernetes namespace in which all workspaces will be created. -# If not set, every workspace will be created in a new namespace, where namespace = workspace id -# -# Ignored for OpenShift infra. Use `CHE_INFRA_OPENSHIFT_PROJECT` instead -#CHE_INFRA_KUBERNETES_NAMESPACE= - -#CHE_INFRA_KUBERNETES_MACHINE__START__TIMEOUT__MIN=5 - -# Defines whether use the Persistent Volume Claim for che workspace needs -# e.g backup projects, logs etc or disable it. -#CHE_INFRA_KUBERNETES_PVC_ENABLED=true - -# Defined which strategy will be used while choosing PVC for workspaces. -# -# Supported strategies: -# - 'common' -# PVC with name that is configured by 'che.infra.kubernetes.pvc.name' -# the property will be used for storing workspaces data of each workspace -# in an OpenShift project. -# Existing PVC will be used or new one will be created if it doesn't exist. -# -# - 'unique' -# PVC with name that is evaluated as '{che.infra.kubernetes.pvc.name} + '-' + {generated_8_chars}' -# will be used for storing of workspaces data. -# Existing PVC will be used or a new one will be created if it doesn't exist. -#CHE_INFRA_KUBERNETES_PVC_STRATEGY=common - -# Defines whether to run a job that creates workspace's subpath directories in persistent volume for the 'common' strategy before launching a workspace. -# Necessary in some versions of OpenShift/Kubernetes as workspace subpath volume mounts are created with root permissions, -# and thus cannot be modified by workspaces running as a user (presents an error importing projects into a workspace in Che). -# The default is "true", but should be set to false if the version of Kubernetes/Kubernetes creates subdirectories with user permissions. -# Relevant issue: https://github.com/kubernetes/kubernetes/issues/41638 -# Note that this property has effect only if the 'common' PVC strategy used. -#CHE_INFRA_KUBERNETES_PVC_PRECREATE__SUBPATHS=true - -# Defines the name of Persistent Volume Claim for che workspace. -#CHE_INFRA_KUBERNETES_PVC_NAME=claim-che-workspace - -# Defines the size of Persistent Volume Claim of che workspace. -# Format described here: -# https://docs.kubernetes.com/container-platform/latest/dev_guide/compute_resources.html#dev-compute-resources -#CHE_INFRA_KUBERNETES_PVC_QUANTITY=10Gi - -# Defines Persistent Volume Claim access mode. -# Note that for common PVC strategy changing of access mode affects the number of simultaneously running workspaces. -# If OpenShift flavor where che running is using PVs with RWX access mode then a limit of running workspaces at the same time -# bounded only by che limits configuration like(RAM, CPU etc). -# Detailed information about access mode is described here: -# https://docs.kubernetes.com/container-platform/latest/architecture/additional_concepts/storage.html#pv-access-modes -#CHE_INFRA_KUBERNETES_PVC_ACCESS__MODE=ReadWriteOnce - -# Defines annotations for ingresses which are used for servers exposing. Value depends on ingress controller. -# For example for nginx ingress controller 0.9.0-beta17 the following value is recommended: -# {"ingress.kubernetes.io/rewrite-target": "/","ingress.kubernetes.io/ssl-redirect": "false",\ -# "ingress.kubernetes.io/proxy-connect-timeout": "3600","ingress.kubernetes.io/proxy-read-timeout": "3600"} -# -# OpenShift infrastructure ignores this property because it uses Routes instead of ingresses. -#CHE_INFRA_KUBERNETES_INGRESS_ANNOTATIONS__JSON=NULL - -# Creates Ingresses with Transport Layer Security (TLS) enabled -# In OpenShift infrastructure, Routes will be TLS-enabled -#CHE_INFRA_KUBERNETES_TLS_ENABLED=false - -# Name of a secret that should be used when creating workspace ingresses with TLS -# Ignored by OpenShift infrastructure -#CHE_INFRA_KUBERNETES_TLS_SECRET= - -######################################################################################## -##### ##### -##### Openshift Infrastructure ##### -##### ##### -# -# Since OpenShift infrastructure reuse Kubernetes infrastructure components -# OpenShift infrastructure reuse most of the Kubernetes configuration attributes. - -# Defines OpenShift namespace in which all workspaces will be created. -# If not set, every workspace will be created in a new project, where project name = workspace id -#CHE_INFRA_OPENSHIFT_PROJECT= - - -######################################################################################## -##### ##### -##### MAIL SERVER ##### -##### ##### -# -# CHE uses email to notify admins and users of events in the system such as error -# reports invitations, or workspace unusual activity. -# -#CHE_MAIL_HOST=smtp.example.com -#CHE_MAIL_HOST_PORT=465 -#CHE_MAIL_USE_SSL=true -#CHE_MAIL_TRANSPORT_PROTOCOL=smtp -#CHE_MAIL_SMTP_AUTH=true -#CHE_MAIL_SMTP_SOCKETFACTORY_CLASS=javax.net.ssl.SSLSocketFactory -#CHE_MAIL_SMTP_SOCKETFACTORY_FALLBACK=false -#CHE_MAIL_SMTP_SOCKETFACTORY_PORT=465 -#CHE_MAIL_SMTP_AUTH_USERNAME=smtp_username -#CHE_MAIL_SMTP_AUTH_PASSWORD=smtp_password - - - -######################################################################################## -##### ##### -##### CHE MULTIUSER ##### -##### ##### -# -# Enable multiuser CHE -# - 'default' : false -#CHE_MULTIUSER=false -# -# Postgres config -# Value NULL is treated in the same way as when environment variable is unset -#CHE_JDBC_USERNAME=pgche -#CHE_JDBC_PASSWORD=pgchepassword -#CHE_JDBC_DATABASE=dbche -#CHE_JDBC_URL=jdbc:postgresql://postgres:5432/dbche -#CHE_JDBC_DRIVER__CLASS__NAME=org.postgresql.Driver -#CHE_JDBC_MAX__TOTAL=20 -#CHE_JDBC_MAX__IDLE=10 -#CHE_JDBC_MAX__WAIT__MILLIS=-1 - -# Grant system permission for 'che.system.admin_name' user. If the user already exists it'll happen on -# component startup, if not - during the first login when user is persisted in the database. -#CHE_SYSTEM_ADMIN__NAME=admin - -# -#CHE_KEYCLOAK_OSO_ENDPOINT=NULL -#CHE_KEYCLOAK_GITHUB_ENDPOINT=NULL -#CHE_KEYCLOAK_ALLOWED__CLOCK__SKEW__SEC=3 -#CHE_KEYCLOAK_ADMIN_REQUIRE_UPDATE_PASSWORD=true - -# -# Url to keycloak identity provider server -# Can be set to NULL only if `CHE_KEYCLOAK_OIDC__PROVIDER` -# is used -#CHE_KEYCLOAK_AUTH__SERVER__URL=http://172.17.0.1:5050/auth - -# Keycloak realm is used to authenticate users -# Can be set to NULL only if `CHE_KEYCLOAK_OIDC__PROVIDER` -# is used -#CHE_KEYCLOAK_REALM=che - -# Keycloak or OIDC client id used by dashboard, -# ide and cli to authenticate users -#CHE_KEYCLOAK_CLIENT__ID=che-public - -# Use the OIDC optional `nonce` feature to increase security. -#CHE_KEYCLOAK_USE__NONCE=true - -# URL to the Keycloak Javascript adapter we want to use. -# if set to NULL, then the default used value is -# `${CHE_KEYCLOAK_AUTH__SERVER__URL}/js/keycloak.js`, -# or `/api/keycloak/OIDCKeycloak.js` -# if an alternate `oidc_provider` is used -#CHE_KEYCLOAK_JS__ADAPTER__URL=NULL - -# Base URL of an alternate OIDC provider that provides -# a discovery endpoint as detailed in the following specification -# https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfig -#CHE_KEYCLOAK_OIDC__PROVIDER=NULL - -# Set to true when using an alternate OIDC provider that -# only supports fixed redirect Urls -#. -# This property is ignored when `CHE_KEYCLOAK_OIDC__PROVIDER` is NULL -CHE_KEYCLOAK_USE__FIXED__REDIRECT__URLS=false - -######################################################################################## -##### ##### -##### WORKSPACE LIMITS ##### -##### ##### -# -# Workspaces are the fundamental runtime for users when doing development. You can set -# parameters that limit how workspaces are created and the resources that are consumed. -# -# The maximum number of workspaces that a user is allowed to create. The user will -# be presented with an error message if they try to create additional workspaces. -# This applies to the total number of both running and stopped workspaces. -#CHE_LIMITS_USER_WORKSPACES_COUNT=-1 - -# The maximum number of running workspaces that a single user is allowed to have. -# If the user has reached this threshold and they try to start an additional -# workspace, they will be prompted with an error message. The user will need to -# stop a running workspace to activate another. -#CHE_LIMITS_USER_WORKSPACES_RUN_COUNT=-1 - -# The total amount of RAM that a single user is allowed to allocate to running -# workspaces. A user can allocate this RAM to a single workspace or spread it -# across multiple workspaces. -#CHE_LIMITS_USER_WORKSPACES_RAM=-1 - -# The total amount of RAM that a single organization (team) is allowed to allocate -# to running workspaces. An organization owner can allocate this RAM however they -# see fit across the team's workspaces. -#CHE_LIMITS_ORGANIZATION_WORKSPACES_RAM=-1 - -# The maximum number of workspaces that a organization is allowed to own. The -# organization will be presented an error message if they try to create -# additional workspaces. This applies to the total number of both running -# and stopped workspaces. -#CHE_LIMITS_ORGANIZATION_WORKSPACES_COUNT=-1 - -# The maximum number of running workspaces that a single organization is allowed. -# If the organization has reached this threshold and they try to start an -# additional workspace, they will be prompted with an error message. The -# organization will need to stop a running workspace to activate another. -#CHE_LIMITS_ORGANIZATION_WORKSPACES_RUN_COUNT=-1 - -# The length of time that a user is idle with their workspace when the system will -# suspend the workspace and then stopping it. Idleness is the -# length of time that the user has not interacted with the workspace, meaning that -# one of our agents has not received interaction. Leaving a browser window open -# counts toward idleness. Value is provided in milliseconds -#CHE_LIMITS_WORKSPACE_IDLE_TIMEOUT=-1 - -# The maximum amount of RAM that a user can allocate to a workspace when they -# create a new workspace. The RAM slider is adjusted to this maximum value. -#CHE_LIMITS_WORKSPACE_ENV_RAM=16gb diff --git a/dockerfiles/init/manifests/che.pp b/dockerfiles/init/manifests/che.pp deleted file mode 100644 index e615c10e4e33..000000000000 --- a/dockerfiles/init/manifests/che.pp +++ /dev/null @@ -1,74 +0,0 @@ -node default { - ################################################################################################## - $che_ip = getValue("CHE_HOST", "localhost") - $che_protocol = getValue("CHE_HOST_PROTOCOL","http") - $che_port = getValue("CHE_PORT", "8080") - $che_instance = getValue("CHE_INSTANCE","/tmp/che") - $che_config = getValue("CHE_CONFIG","/path/to/che/che/puppet/sources") - $che_assembly = getValue("CHE_ASSEMBLY","/home/user/che") - $che_env = getValue("CHE_ENVIRONMENT","production") - $che_dev_env = getValue("CHE_REPO","off") - $che_debug_port = getValue("CHE_DEBUG_PORT","8000") - $che_debug_suspend = getValue("CHE_DEBUG_SUSPEND","false") - $docker_ip = getValue("CHE_DOCKER_IP","172.17.0.1") - $docker_host = getValue("DOCKER_HOST","tcp://localhost:2375") - $che_user = getValue("CHE_USER","root") - $che_server_url = getValue("CHE_SERVER_URL", "${che_protocol}://${che_ip}:${che_port}") - $che_master_container_ram = getValue("CHE_MASTER_CONTAINER_RAM", "750m") - $che_docker_ip_external = getValue("CHE_DOCKER_IP_EXTERNAL","") - - ############################### - # Http proxy configuration - # leave those fields empty if no configuration needed - # - # http proxy for CHE - $che_http_proxy = getValue("CHE_HTTP_PROXY","") - $che_https_proxy = getValue("CHE_HTTPS_PROXY","") - # provide dns which proxy should not be used for. - # please leave this empty if you don't need no_proxy configuration - $che_no_proxy = getValue("CHE_NO_PROXY","") - # - # http proxy for CHE workspaces - $http_proxy_for_che_workspaces = getValue("CHE_WORKSPACE_HTTP__PROXY","") - $https_proxy_for_che_workspaces = getValue("CHE_WORKSPACE_HTTPS__PROXY","") - # provide dns which proxy should not be used for. - # please leave this as it is if you don't need no_proxy configuration - $no_proxy_for_che_workspaces = getValue("CHE_WORKSPACE_NO__PROXY","") - - ############################### - # Single port configuration - # - $che_single_port = getValue("CHE_SINGLE_PORT","false") - $che_single_port_wildcard_domain_host = getValue("CHE_SINGLEPORT_WILDCARD__DOMAIN_HOST","nip.io") - $che_single_port_wildcard_domain_ipless = getValue("CHE_SINGLEPORT_WILDCARD__DOMAIN_IPLESS","false") - - ############################### - # Che multiuser - # - $che_multiuser = getValue("CHE_MULTIUSER","false") - - ################################ - # DNS resolver configuration - $dns_resolvers = getValue("CHE_DNS_RESOLVERS","") - - ############################### - # Workspace configuration - - $che_jmx_enabled = getValue("CHE_JMX_ENABLED", "false") - $che_jmx_username = getValue("CHE_JMX_USERNAME", "admin") - $che_jmx_password = getValue("CHE_JMX_PASSWORD", "Che") - - $che_pg_host = getValue("CHE_POSTGRES_HOST", "postgres") - $che_pg_port = getValue("CHE_POSTGRES_PORT", "5432") - $che_pg_username = getValue("CHE_POSTGRES_USERNAME", "pgche") - $che_pg_password = getValue("CHE_POSTGRES_PASSWORD", "pgchepassword") - $che_pg_database = getValue("CHE_POSTGRES_DATABASE", "dbche") - - $system_super_privileged_mode=getValue("SYSTEM_SUPER__PRIVILEGED__MODE", "false") - - $che_keycloak_admin_require_update_password=getValue("CHE_KEYCLOAK_ADMIN_REQUIRE_UPDATE_PASSWORD", "true") - - ############################### - # Include base module - include base -} diff --git a/dockerfiles/init/modules/base/manifests/init.pp b/dockerfiles/init/modules/base/manifests/init.pp deleted file mode 100644 index fcc33f9a0364..000000000000 --- a/dockerfiles/init/modules/base/manifests/init.pp +++ /dev/null @@ -1,30 +0,0 @@ -class base { - $dirs = [ - "/opt/che", - "/opt/che/data", - "/opt/che/config", - "/opt/che/logs", - "/opt/che/templates" ] - file { $dirs: - ensure => "directory", - mode => "755", - } -> - file { "/opt/che/logs/keycloak": - ensure => "directory", - owner => "1000", - group => "1000", - mode => "755", - } -> - file { "/opt/che/data/keycloak": - ensure => "directory", - owner => "1000", - group => "1000", - mode => "755", - } - - include che - include compose - include traefik - include postgres - include keycloak -} diff --git a/dockerfiles/init/modules/che/manifests/init.pp b/dockerfiles/init/modules/che/manifests/init.pp deleted file mode 100644 index b9da7438014a..000000000000 --- a/dockerfiles/init/modules/che/manifests/init.pp +++ /dev/null @@ -1,33 +0,0 @@ -class che { - file { "/opt/che/config/che": - ensure => "directory", - mode => "755", - } -> - # creating che.env - file { "/opt/che/config/che/che.env": - ensure => "present", - content => template("che/che.env.erb"), - mode => "644", - } - - if $che_dev_env == "on" { - file { "/opt/che/che.sh": - ensure => "present", - content => template("che/che.sh.erb"), - mode => "644", - } - } - - # JMX - file { "/opt/che/config/che/jmxremote.access": - ensure => "present", - content => "$che_jmx_username readwrite", - mode => "644", - } - - file { "/opt/che/config/che/jmxremote.password": - ensure => "present", - content => "$che_jmx_username $che_jmx_password", - mode => "644", - } -} diff --git a/dockerfiles/init/modules/che/templates/che.env.erb b/dockerfiles/init/modules/che/templates/che.env.erb deleted file mode 100644 index 08b962aa7f5a..000000000000 --- a/dockerfiles/init/modules/che/templates/che.env.erb +++ /dev/null @@ -1,101 +0,0 @@ -# Include all custom CHE_* properties that user may has defined in its che.env file -<% ENV.each do |k,v| -%> -<% if k.include? "CHE_" then -%> -<%= k + '=' + v %> -<% end -%> -<% end -%> - - -CHE_IP=<%= scope.lookupvar('che::che_ip') %> -CHE_PORT=<%= scope.lookupvar('che::che_port') %> -#DOCKER_HOST=<%= scope.lookupvar('che::docker_host') %> -#DOCKER_MACHINE_HOST=<%= scope.lookupvar('che::docker_ip') %> - -<% if @che_jmx_enabled == "true" -%> -CATALINA_OPTS=-Dcom.sun.management.jmxremote=true -Djava.rmi.server.hostname=localhost -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=/conf/jmxremote.password -Dcom.sun.management.jmxremote.access.file=/conf/jmxremote.access -Dcom.sun.management.jmxremote.ssl=false -<% end -%> - -<% if scope.lookupvar('che::che_env') != "production" -%> -CHE_DEBUG_SERVER=true -JPDA=jpda -CHE_ASSEMBLY=<%= scope.lookupvar('che::che_assembly') %> -JPDA_ADDRESS=<%= scope.lookupvar('che::che_debug_port') %> -<% if scope.lookupvar('che::che_debug_suspend') == "true" %>JPDA_SUSPEND=y<% end %> -<% end -%> - -CHE_MULTIUSER=<%= scope.lookupvar('che::che_multiuser') %> -<% if scope.lookupvar('che::che_multiuser') == 'true' -%> -<% if scope.lookupvar('che::che_port') == '8080' -%> -CHE_DOCKER_NETWORK=che_che-network -<% else -%> -CHE_DOCKER_NETWORK=che<%= scope.lookupvar('che::che_port') %>_che-network -<% end -%> -<% else -%> -CHE_DOCKER_NETWORK=bridge -<% end -%> - -<% if scope.lookupvar('che::che_single_port') == 'true' -%> -<% if ! @che_docker_ip_external.empty? -%> -CHE_INFRA_DOCKER_MASTER__API__ENDPOINT=http://<%= scope.lookupvar('che::che_docker_ip_external') -%>:<%= scope.lookupvar('che::che_port') -%>/api -CHE_INFRA_DOCKER_MASTER__WEBSOCKET__ENDPOINT=ws://<%= scope.lookupvar('che::che_docker_ip_external') -%>:<%= scope.lookupvar('che::che_port') -%>/api/websocket -<% else -%> -CHE_INFRA_DOCKER_MASTER__API__ENDPOINT=http://<%= scope.lookupvar('che::docker_ip') -%>:<%= scope.lookupvar('che::che_port') -%>/api -CHE_INFRA_DOCKER_MASTER__WEBSOCKET__ENDPOINT=ws://<%= scope.lookupvar('che::docker_ip') -%>:<%= scope.lookupvar('che::che_port') -%>/api/websocket -<% end -%> -<% end -%> - -CHE_DATABASE=/data/storage -CHE_WORKSPACE_STORAGE=<%= scope.lookupvar('che::che_instance') %>/data/workspaces -CHE_WORKSPACE_STORAGE__MASTER__PATH=/data/workspaces -CHE_LOGS_DIR=/logs -CHE_WORKSPACE_LOGS=/logs/machines -CHE_TEMPLATE_STORAGE=/data/templates - - -<% if ! @che_http_proxy.empty? or ! @che_https_proxy.empty? -%> -JAVA_HTTP_PROXY_SET=-Dhttp.proxySet=true -<% end -%> -<% if ! @che_http_proxy.empty? -%> -<% if ! @che_http_proxy.empty? and @che_http_proxy.include? '@' -%> -JAVA_HTTP_USER_NAME=-Dhttp.proxyUser=<%= @che_http_proxy.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[0].split(':')[0] %> -JAVA_HTTP_USER_PASSWORD=-Dhttp.proxyPassword=<%= @che_http_proxy.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[0].split(':')[1] %> -JAVA_HTTP_PROXY_HOST=-Dhttp.proxyHost=<%= @che_http_proxy.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[1].split(':')[0] %> -JAVA_HTTP_PROXY_PORT=-Dhttp.proxyPort=<%= @che_http_proxy.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[1].split(':')[1].gsub(/\/.*/,'') %> -<% else -%> -JAVA_HTTP_PROXY_HOST=-Dhttp.proxyHost=<%= @che_http_proxy.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split(':')[0] %> -JAVA_HTTP_PROXY_PORT=-Dhttp.proxyPort=<%= @che_http_proxy.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split(':')[1].gsub(/\/.*/,'') %> -<% end -%> -<% end -%> -<% if ! @che_https_proxy.empty? -%> -<% if @che_https_proxy.include? '@' -%> -JAVA_HTTPS_USER_NAME=-Dhttps.proxyUser=<%= @che_https_proxy.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[0].split(':')[0] %> -JAVA_HTTPS_USER_PASSWORD=-Dhttps.proxyPassword=<%= @che_https_proxy.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[0].split(':')[1] %> -JAVA_HTTPS_PROXY_HOST=-Dhttps.proxyHost=<%= @che_https_proxy.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[1].split(':')[0] %> -JAVA_HTTPS_PROXY_PORT=-Dhttps.proxyPort=<%= @che_https_proxy.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[1].split(':')[1].gsub(/\/.*/,'') %> -<% else -%> -JAVA_HTTPS_PROXY_HOST=-Dhttps.proxyHost=<%= @che_https_proxy.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split(':')[0] %> -JAVA_HTTPS_PROXY_PORT=-Dhttps.proxyPort=<%= @che_https_proxy.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split(':')[1].gsub(/\/.*/,'') %> -<% end -%> -<% end -%> -<% if ! @che_no_proxy.empty? -%> -JAVA_NO_PROXY=-Dhttp.nonProxyHosts='<%= @che_no_proxy.gsub(/^https?\:\/\//, '').gsub(/^www./,'').gsub(/[[:space:]]/,'').split(",").uniq.join("|") %>' -<% end -%> -JAVA_OPTS=-XX:MaxRAMFraction=2 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Dsun.zip.disableMemoryMapping=true -Xms20m <% if ! @che_http_proxy.empty? or ! @che_https_proxy.empty? -%>$JAVA_HTTP_PROXY_SET<% end -%> <% if ! @che_http_proxy.empty? -%>$JAVA_HTTP_PROXY_HOST $JAVA_HTTP_PROXY_PORT<% end -%> <% if ! @che_https_proxy.empty? -%>$JAVA_HTTPS_PROXY_HOST $JAVA_HTTPS_PROXY_PORT<% end -%><%- if ! @che_no_proxy.empty? -%> $JAVA_NO_PROXY<% end -%><% if @che_http_proxy.include? '@' -%> $JAVA_HTTP_USER_NAME $JAVA_HTTP_USER_PASSWORD<% end -%><% if @che_https_proxy.include? '@' -%> $JAVA_HTTPS_USER_NAME $JAVA_HTTPS_USER_PASSWORD<% end %> - -# http proxy options for jvm -CHE_WORKSPACE_HTTP__PROXY__JAVA__OPTIONS=<% if ! @http_proxy_for_che_workspaces.empty? or ! @https_proxy_for_che_workspaces.empty? -%>-Dhttp.proxySet=true<% end -%><% if ! @http_proxy_for_che_workspaces.empty? -%><% if ! @http_proxy_for_che_workspaces.empty? and @http_proxy_for_che_workspaces.include? '@' -%> -Dhttp.proxyUser=<%= @http_proxy_for_che_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[0].split(':')[0] %> -Dhttp.proxyPassword=<%= @http_proxy_for_che_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[0].split(':')[1] %> -Dhttp.proxyHost=<%= @http_proxy_for_che_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[1].split(':')[0] %> -Dhttp.proxyPort=<%= @http_proxy_for_che_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[1].split(':')[1].gsub(/\/.*/,'') %><% else -%> -Dhttp.proxyHost=<%= @http_proxy_for_che_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split(':')[0] %> -Dhttp.proxyPort=<%= @http_proxy_for_che_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split(':')[1].gsub(/\/.*/,'') %><% end -%><% end -%><% if ! @https_proxy_for_che_workspaces.empty? -%><% if @https_proxy_for_che_workspaces.include? '@' -%> -Dhttps.proxyUser=<%= @https_proxy_for_che_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[0].split(':')[0] %> -Dhttps.proxyPassword=<%= @https_proxy_for_che_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[0].split(':')[1] %> -Dhttps.proxyHost=<%= @https_proxy_for_che_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[1].split(':')[0] %> -Dhttps.proxyPort=<%= @https_proxy_for_che_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split('@')[1].split(':')[1].gsub(/\/.*/,'') %><% else -%> -Dhttps.proxyHost=<%= @https_proxy_for_che_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split(':')[0] %> -Dhttps.proxyPort=<%= @https_proxy_for_che_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split(':')[1].gsub(/\/.*/,'') %><% end -%><% end -%><% if ! @che_no_proxy.empty? -%> -Dhttp.nonProxyHosts='<%= @no_proxy_for_che_workspaces.gsub(/^https?\:\/\//, '').gsub(/^www./,'').split(",").uniq.join("|") %>|'<% end -%> - -# Enable single port options -<% if scope.lookupvar('che::che_single_port') == "true" -%> -CHE_INFRA_DOCKER_URL__REWRITER=singleport - -<% if scope.lookupvar('che::che_multiuser') == 'true' -%> -<% if scope.lookupvar('che::che_single_port') == 'true' and scope.lookupvar('che::che_single_port_wildcard_domain_ipless') == 'true' -%> -CHE_KEYCLOAK_AUTH__SERVER__URL=http://keycloak.<%= scope.lookupvar('che::che_single_port_wildcard_domain_host') -%>/auth -<% elsif ! @che_docker_ip_external.empty? -%> -CHE_KEYCLOAK_AUTH__SERVER__URL=http://keycloak.<%= scope.lookupvar('che::che_docker_ip_external') -%>.<%= scope.lookupvar('che::che_single_port_wildcard_domain_host') -%>:<%= scope.lookupvar('che::che_port') -%>/auth -<% else -%> -CHE_KEYCLOAK_AUTH__SERVER__URL=http://keycloak.<%= scope.lookupvar('che::docker_ip') -%>.<%= scope.lookupvar('che::che_single_port_wildcard_domain_host') -%>:<%= scope.lookupvar('che::che_port') -%>/auth -<% end -%> -<% end -%> -<% end -%> diff --git a/dockerfiles/init/modules/che/templates/che.sh.erb b/dockerfiles/init/modules/che/templates/che.sh.erb deleted file mode 100644 index 9f7219cf6972..000000000000 --- a/dockerfiles/init/modules/che/templates/che.sh.erb +++ /dev/null @@ -1,247 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012-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 -# -# Contributors: -# Red Hat, Inc.- initial API and implementation -# - -set -e -set +o posix - -determine_os () { - case "${OSTYPE}" in - linux*|freebsd*) - HOST="linux" - ;; - darwin*) - HOST="mac" - ;; - cygwin|msys|win32) - HOST="windows" - ;; - *) - # unknown option - error "We could not detect your operating system. Che is unlikely to work properly." - return 1 - ;; - esac -} - -init_global_variables () { - # For coloring console output - BLUE='\033[1;34m' - GREEN='\033[0;32m' - NC='\033[0m' - - USAGE=" -Usage: bash che.sh COMMAND - -Starts and stops Che's natively with Tomcat - this method is for developers and unsupported - -COMMANDS: - start Starts server with output in the background - stop Stops ${CHE_MINI_PRODUCT_NAME} server - run Starts server with output in the foreground - -Variables: - CHE_PORT The port the Che server will listen on - CHE_IP The IP address of the host - must be set if remote clients connecting - CHE_BLOCKING_ENTROPY Starts Tomcat with blocking entropy: -Djava.security.egd=file:/dev/./urandom - CHE_LOG_LEVEL [INFO | DEBUG] Sets the output level of Tomcat messages - CHE_DEBUG_SERVER If true, activates Tomcat's JPDA debugging mode - CHE_HOME Where the Che assembly resides - self-determining if not set -" - - # Use blocking entropy -- needed for some servers - DEFAULT_CHE_BLOCKING_ENTROPY=false - CHE_BLOCKING_ENTROPY=${CHE_BLOCKING_ENTROPY:-${DEFAULT_CHE_BLOCKING_ENTROPY}} - - DEFAULT_CHE_SERVER_ACTION=run - CHE_SERVER_ACTION=${CHE_SERVER_ACTION:-${DEFAULT_CHE_SERVER_ACTION}} - - # Must be exported as this will be needed by Tomcat's JVM - DEFAULT_CHE_REGISTRY_HOST=localhost - export CHE_REGISTRY_HOST=${CHE_REGISTRY_HOST:-${DEFAULT_CHE_REGISTRY_HOST}} - - DEFAULT_CHE_PORT=8080 - CHE_PORT=${CHE_PORT:-${DEFAULT_CHE_PORT}} - - DEFAULT_CHE_IP= - CHE_IP=${CHE_IP:-${DEFAULT_CHE_IP}} - - DEFAULT_CHE_LOG_LEVEL=INFO - CHE_LOG_LEVEL=${CHE_LOG_LEVEL:-${DEFAULT_CHE_LOG_LEVEL}} - - DEFAULT_CHE_DEBUG_SERVER=false - CHE_DEBUG_SERVER=${CHE_DEBUG_SERVER:-${DEFAULT_CHE_DEBUG_SERVER}} - - DEFAULT_CHE_HOME="${PWD}/dev/che-tomcat" - export CHE_HOME=${CHE_HOME:-${DEFAULT_CHE_HOME}} -} - -error() { - printf "${RED}ERROR:${NC} %s\n" "${1}" -} - -parse_command_line () { - if [ $# -gt 1 ]; then - usage - return 1 - fi - - case $1 in - start|stop|run) - CHE_SERVER_ACTION=$1 - ;; - -h|--help) - usage - return 1 - ;; - *) - # unknown option - usage - return 1 - ;; - esac -} - -usage () { - echo "${USAGE}" -} - -set_environment_variables () { - ### Set value of derived environment variables. - - # CHE_DOCKER_MACHINE_HOST is used internally by Che to set its IP address - if [[ -n "${CHE_IP}" ]]; then - export CHE_DOCKER_MACHINE_HOST="${CHE_IP}" - fi - - # Convert Tomcat environment variables to POSIX format. - if [[ "${JAVA_HOME}" == *":"* ]]; then - JAVA_HOME=$(echo /"${JAVA_HOME}" | sed 's|\\|/|g' | sed 's|:||g') - fi - - # Convert Che environment variables to POSIX format. - if [[ "${CHE_HOME}" == *":"* ]]; then - CHE_HOME=$(echo /"${CHE_HOME}" | sed 's|\\|/|g' | sed 's|:||g') - fi - - if [[ "${CHE_HOME}" =~ \ |\' ]] && [[ "${HOST}" == "windows" ]]; then - echo "!!!" - echo "!!! Ohhhhh boy." - echo "!!! You are on Windows and installed Che into a directory that contains a space." - echo "!!! Tomcat behaves badly because of this." - echo "!!!" - echo "!!! We attempted to work around this by converting your path to one without a space." - echo "!!! However, it seems that the drive where Che is installed does not allow this." - echo "!!! So we seem to be buggered." - echo "!!!" - echo "!!! You can fix this issue by installing Che into a directory without spaces in the name." - echo "!!! Isn't Windows fun? Long live William Shatner." - echo "!!!" - return 1 - fi - - # Sets the location of the application server and its executables - # Internal property - should generally not be overridden - export CATALINA_HOME="${CHE_HOME}/tomcat" - - # Convert windows path name to POSIX - if [[ "${CATALINA_HOME}" == *":"* ]]; then - CATALINA_HOME=$(echo /"${CATALINA_HOME}" | sed 's|\\|/|g' | sed 's|:||g') - fi - - # Internal properties - should generally not be overridden - export CATALINA_BASE="${CHE_HOME}/tomcat" - export ASSEMBLY_BIN_DIR="${CATALINA_HOME}/bin" - export CHE_LOGS_LEVEL="${CHE_LOG_LEVEL}" - export CHE_LOGS_DIR="${CATALINA_HOME}/logs/" -} - - -start_che_server () { - ######################################### - # Launch Che natively as a tomcat server - call_catalina -} - -stop_che_server () { - echo -e "Stopping Che server running on localhost:${CHE_PORT}" - call_catalina >/dev/null 2>&1 -} - -call_catalina () { - # Test to see that Che application server is where we expect it to be - if [ ! -d "${ASSEMBLY_BIN_DIR}" ]; then - error "Could not find Che's application server." - return 1; - fi - - if [ -z "${JAVA_HOME}" ]; then - error "JAVA_HOME is not set." - return 1; - fi - - # Test to see that Java is installed and working - "${JAVA_HOME}"/bin/java &>/dev/null || JAVA_EXIT=$? || true - if [ "${JAVA_EXIT}" != "1" ]; then - error "We could not find a working Java JVM. 'java' command fails." - return 1; - fi - - if [[ "${CHE_SKIP_JAVA_VERSION_CHECK}" == false ]]; then - # Che requires Java version 1.8 or higher. - JAVA_VERSION=$("${JAVA_HOME}"/bin/java -version 2>&1 | awk -F '"' '/version/ {print $2}') - if [ -z "${JAVA_VERSION}" ]; then - error "Failure running JAVA_HOME/bin/java -version. We received ${JAVA_VERSION}." - return 1; - fi - - if [[ "${JAVA_VERSION}" < "1.8" ]]; then - error "Che requires Java version 1.8 or higher. We found ${JAVA_VERSION}." - return 1; - fi - fi - - ### Initialize default JVM arguments to run che - if [[ "${CHE_BLOCKING_ENTROPY}" == true ]]; then - [ -z "${JAVA_OPTS}" ] && JAVA_OPTS="-Xms256m -Xmx1024m" - else - [ -z "${JAVA_OPTS}" ] && JAVA_OPTS="-Xms256m -Xmx1024m -Djava.security.egd=file:/dev/./urandom" - fi - - ### Cannot add this in setenv.sh. - ### We do the port mapping here, and this gets inserted into server.xml when tomcat boots - export JAVA_OPTS="${JAVA_OPTS} -Dport.http=${CHE_PORT} -Dche.home=${CHE_HOME}" - export SERVER_PORT=${CHE_PORT} - - # Launch the Che application server, passing in command line parameters - if [[ "${CHE_DEBUG_SERVER}" == true ]]; then - "${ASSEMBLY_BIN_DIR}"/catalina.sh jpda ${CHE_SERVER_ACTION} - else - "${ASSEMBLY_BIN_DIR}"/catalina.sh ${CHE_SERVER_ACTION} - fi -} - -execute_che () { - determine_os - init_global_variables - parse_command_line "$@" - set_environment_variables - - if [ "${CHE_SERVER_ACTION}" == "stop" ]; then - stop_che_server - else - start_che_server - fi -} - -# Run the finish function if exit signal initiated -execute_che "$@" diff --git a/dockerfiles/init/modules/compose/manifests/init.pp b/dockerfiles/init/modules/compose/manifests/init.pp deleted file mode 100644 index 08a7cf95348a..000000000000 --- a/dockerfiles/init/modules/compose/manifests/init.pp +++ /dev/null @@ -1,17 +0,0 @@ -class compose { - define generate_compose_file($compose_file_name = $name, $compose_file_for_containers = false) { - file { "/opt/che/$compose_file_name": - ensure => "present", - content => template("compose/docker-compose.yml.erb"), - mode => '644', - } - } - - compose::generate_compose_file { "docker-compose-container.yml" : - compose_file_for_containers => true - } - - compose::generate_compose_file { "docker-compose.yml" : - compose_file_for_containers => false - } -} diff --git a/dockerfiles/init/modules/compose/templates/docker-compose.yml.erb b/dockerfiles/init/modules/compose/templates/docker-compose.yml.erb deleted file mode 100644 index 4e4037445b87..000000000000 --- a/dockerfiles/init/modules/compose/templates/docker-compose.yml.erb +++ /dev/null @@ -1,194 +0,0 @@ -# ################################### -# This file is generated by puppet -# PLEASE DON'T MODIFY BY HAND -# ################################### - -<% if scope.lookupvar('che::che_multiuser') == 'true' -%> -version: '2.1' -services: -<% end -%> - - ######################## - # CHE - ######################## - che: - image: <%= ENV["IMAGE_CHE"] %> - mem_limit: <%= scope.lookupvar('che::che_master_container_ram') %> - memswap_limit: 0 - env_file: -<% if @compose_file_for_containers == true -%> - - '<%= ENV["CHE_CONTAINER_ROOT"] %>/instance/config/che/che.env' -<% else -%> - - '<%= ENV["CHE_ENV_FILE"] %>' -<% end -%> -<% if scope.lookupvar('che::che_multiuser') == 'true' -%> - links: - - postgres:postgres - depends_on: - postgres: - condition: service_healthy - keycloak: - condition: service_healthy - networks: - - default - - che-network -<% end -%> - volumes: - - '/var/run/docker.sock:/var/run/docker.sock' - - '<%= scope.lookupvar('che::che_instance') -%>/data:/data' - - '<%= scope.lookupvar('che::che_instance') -%>/logs:/logs' - - '<%= scope.lookupvar('che::che_instance') -%>/config/che:/conf' -<% if scope.lookupvar('che::che_dev_env') == 'on' -%> - - '<%= scope.lookupvar('che::che_assembly') -%>:/assembly' -<% end -%> -<% if scope.lookupvar('che::che_user') != 'root' -%> - - '/etc/group:/etc/group:ro' - - '/etc/passwd:/etc/passwd:ro' -<% end -%> - ports: -<% if @che_jmx_enabled == 'true' -%> - - '32001:32001' - - '32101:32101' -<% end -%> -<% if scope.lookupvar('che::che_single_port') == 'true' -%> - - 8080 -<% else -%> - - '<%= scope.lookupvar('che::che_port') -%>:<%= scope.lookupvar('che::che_port') -%>' -<% end -%> -<% if scope.lookupvar('che::che_env') == 'development' -%> - - '<%= scope.lookupvar('che::che_debug_port') -%>:<%= scope.lookupvar('che::che_debug_port') -%>' -<% end -%> -<% if scope.lookupvar('che::che_single_port') == 'true' -%> - labels: - traefik.che.frontend.backend: "che-server" - traefik.che.frontend.entryPoints: "http" - traefik.che.port: "<%= scope.lookupvar('che::che_port') -%>" - traefik.che.frontend.rule: "PathPrefix:/" -<% if scope.lookupvar('che::che_multiuser') == 'true' -%> - traefik.docker.network: "che_default" -<% end -%> -<% end -%> - restart: always - container_name: <%= ENV["CHE_CONTAINER_NAME"] %> -<% if scope.lookupvar('che::che_user') != 'root' -%> - user: <%= scope.lookupvar('che::che_user') -%> -<% end -%> -<% if ! @dns_resolvers.empty? -%> -<%= " dns:" + "\n" + @dns_resolvers.split(",").map { |val| " - #{val}" }.join("\n") %> -<% end -%> - -<% if scope.lookupvar('che::che_single_port') == 'true' -%> - ######################## - # TRAEFIK - ######################## - traefik: - image: <%= ENV["IMAGE_TRAEFIK"] %> - command: --logLevel=DEBUG - links: - - che:che -<% if scope.lookupvar('che::che_multiuser') == 'true' -%> - networks: - - default - - che-network -<% end -%> - labels: - traefik.enable: "false" - ports: - - '<%= scope.lookupvar('che::che_port') -%>:<%= scope.lookupvar('che::che_port') -%>' -<% if scope.lookupvar('che::che_env') == 'development' -%> - - '7070:7070' -<% end -%> - volumes: - - /var/run/docker.sock:/var/run/docker.sock - - '<%= scope.lookupvar('che::che_instance') -%>/config/traefik:/etc/traefik' - restart: always -<% end -%> - -<% if scope.lookupvar('che::che_multiuser') == 'true' -%> - ######################## - # POSTGRES - ######################## - postgres: - image: <%= ENV["IMAGE_POSTGRES"] %> - command: [ "/var/lib/pgsql/init-che-user-and-run.sh" ] - environment: - - POSTGRESQL_USER=keycloak - - POSTGRESQL_PASSWORD=keycloak - - POSTGRESQL_DATABASE=keycloak - - CHE_POSTGRES_USERNAME=<%= scope.lookupvar('postgres::che_pg_username') %> - - CHE_POSTGRES_PASSWORD=<%= scope.lookupvar('postgres::che_pg_password') %> - - CHE_POSTGRES_DATABASE=<%= scope.lookupvar('postgres::che_pg_database') %> - volumes: - - '<%= scope.lookupvar('che::che_instance') -%>/data/postgres:/var/lib/pgsql/data' - - '<%= scope.lookupvar('che::che_instance') -%>/config/postgres/init-che-user.sh:/var/lib/pgsql/init-che-user.sh' - - '<%= scope.lookupvar('che::che_instance') -%>/config/postgres/init-che-user-and-run.sh:/var/lib/pgsql/init-che-user-and-run.sh' -<% if scope.lookupvar('che::che_single_port') == 'false' -%> - expose: - - '5432' -<% if scope.lookupvar('che::che_env') == 'development' -%> - ports: - - '5432:5432' -<% end -%> -<% end -%> - restart: always - healthcheck: - test: [ "CMD", "/bin/sh", "-i", "-c", "psql -h 127.0.0.1 -U keycloak -q -d keycloak -c 'SELECT 1'" ] - interval: 10s - timeout: 10s - retries: 10 - - ######################## - # KEYCLOAK - ######################## - keycloak: - image: <%= ENV["IMAGE_KEYCLOACK"] %> - depends_on: - postgres: - condition: service_healthy -<% if scope.lookupvar('che::che_single_port') == 'false' -%> - ports: - - '5050:8080' -<% end -%> - entrypoint: - - start-keycloak.sh - - -Dkeycloak.migration.action=import - - -Dkeycloak.migration.provider=dir - - -Dkeycloak.migration.strategy=IGNORE_EXISTING - - -Dkeycloak.migration.dir=/opt/jboss/keycloak/realms/ - - -Djboss.bind.address=0.0.0.0 - environment: - - POSTGRES_PORT_5432_TCP_ADDR=postgres - - POSTGRES_PORT_5432_TCP_PORT=5432 - - POSTGRES_DATABASE=keycloak - - POSTGRES_USER=keycloak - - POSTGRES_PASSWORD=keycloak - links: - - postgres:postgres -<% if scope.lookupvar('che::che_single_port') == 'true' -%> - labels: - traefik.keycloak.frontend.entryPoints: "http" - traefik.keycloak.port: "8080" -<% if scope.lookupvar('che::che_single_port') == 'true' and scope.lookupvar('che::che_single_port_wildcard_domain_ipless') == 'true' -%> - traefik.keycloak.frontend.rule: "Host:keycloak.<%= scope.lookupvar('che::che_single_port_wildcard_domain_host') -%>" -<% elsif ! @che_docker_ip_external.empty? -%> - traefik.keycloak.frontend.rule: "Host:keycloak.<%= scope.lookupvar('che::che_docker_ip_external') -%>.<%= scope.lookupvar('che::che_single_port_wildcard_domain_host') -%>" -<% else -%> - traefik.keycloak.frontend.rule: "Host:keycloak.<%= scope.lookupvar('che::docker_ip') -%>.<%= scope.lookupvar('che::che_single_port_wildcard_domain_host') -%>" -<% end -%> - traefik.docker.network: "che_default" -<% end -%> - volumes: - - '<%= scope.lookupvar('che::che_instance') -%>/config/keycloak/che:/opt/jboss/keycloak/themes/che' - - '<%= scope.lookupvar('che::che_instance') -%>/config/keycloak/:/opt/jboss/keycloak/realms/' - - '<%= scope.lookupvar('che::che_instance') -%>/data/keycloak:/opt/jboss/keycloak/standalone/data' - - '<%= scope.lookupvar('che::che_instance') -%>/logs/keycloak:/opt/jboss/keycloak/standalone/log' - restart: always - healthcheck: - test: [ "CMD", "curl", "-f", "http://localhost:8080/auth/" ] - interval: 10s - timeout: 10s - retries: 10 - -networks: - che-network: -<% end -%> diff --git a/dockerfiles/init/modules/keycloak/manifests/init.pp b/dockerfiles/init/modules/keycloak/manifests/init.pp deleted file mode 100644 index 7d1350cae421..000000000000 --- a/dockerfiles/init/modules/keycloak/manifests/init.pp +++ /dev/null @@ -1,32 +0,0 @@ -class keycloak { - file { "/opt/che/config/keycloak": - ensure => "directory", - mode => "755", - } -> - file { "/opt/che/config/keycloak/che-realm.json": - ensure => "present", - content => template("keycloak/che-realm.json.erb"), - mode => "644", - } -> - file { "/opt/che/config/keycloak/che-users-0.json": - ensure => "present", - content => template("keycloak/che-users-0.json.erb"), - mode => "644", - } -> - file { "/opt/che/config/keycloak/master-realm.json": - ensure => "present", - content => template("keycloak/master-realm.json.erb"), - mode => "644", - } -> - file { "/opt/che/config/keycloak/master-users-0.json": - ensure => "present", - content => template("keycloak/master-users-0.json.erb"), - mode => "644", - } -> - file { 'keycloak theme custom login page': - path => '/opt/che/config/keycloak/che', - ensure => "present", - source => 'puppet:///modules/keycloak/che', - recurse => true, - } -} diff --git a/dockerfiles/init/modules/postgres/manifests/init.pp b/dockerfiles/init/modules/postgres/manifests/init.pp deleted file mode 100644 index 30acea9ce8e1..000000000000 --- a/dockerfiles/init/modules/postgres/manifests/init.pp +++ /dev/null @@ -1,22 +0,0 @@ -class postgres { - file { "/opt/che/data/postgres": - ensure => "directory", - owner => 26, - group => 0, - mode => "755", - } -> - file { "/opt/che/config/postgres": - ensure => "directory", - mode => "755", - } -> - file { "/opt/che/config/postgres/init-che-user.sh": - content => template('postgres/init-che-user.sh.erb'), - ensure => file, - mode => "755", - } -> - file { "/opt/che/config/postgres/init-che-user-and-run.sh": - content => template('postgres/init-che-user-and-run.sh.erb'), - ensure => file, - mode => "755", - } -} diff --git a/dockerfiles/init/modules/puppet_plugins/lib/puppet/parser/functions/getValue.rb b/dockerfiles/init/modules/puppet_plugins/lib/puppet/parser/functions/getValue.rb deleted file mode 100644 index 5edaa815a6ff..000000000000 --- a/dockerfiles/init/modules/puppet_plugins/lib/puppet/parser/functions/getValue.rb +++ /dev/null @@ -1,12 +0,0 @@ -module Puppet::Parser::Functions - newfunction(:getValue, :type => :rvalue) do |args| - envname = args[0] - default_value = args[1] - if ENV[envname].nil? - actual_value = default_value - else - actual_value = ENV[envname] - end - return actual_value - end -end \ No newline at end of file diff --git a/dockerfiles/init/modules/traefik/manifests/init.pp b/dockerfiles/init/modules/traefik/manifests/init.pp deleted file mode 100644 index d4ee00aed9c4..000000000000 --- a/dockerfiles/init/modules/traefik/manifests/init.pp +++ /dev/null @@ -1,12 +0,0 @@ -class traefik { - file { "/opt/che/config/traefik": - ensure => "directory", - mode => "755", - } -> - # creating traefik.toml - file { "/opt/che/config/traefik/traefik.toml": - ensure => "present", - content => template("traefik/traefik.toml.erb"), - mode => "644", - } -} diff --git a/dockerfiles/init/modules/traefik/templates/traefik.toml.erb b/dockerfiles/init/modules/traefik/templates/traefik.toml.erb deleted file mode 100644 index 8a2bbc84798d..000000000000 --- a/dockerfiles/init/modules/traefik/templates/traefik.toml.erb +++ /dev/null @@ -1,91 +0,0 @@ -################################################################ -# Global configuration -################################################################ - -# Timeout in seconds. -# Duration to give active requests a chance to finish during hot-reloads -# -# Optional -# Default: 10 -# -# graceTimeOut = 10 - -# Enable debug mode -# -# Optional -# Default: false -# -debug = true - -# Periodically check if a new version has been released -# -# Optional -# Default: true -# -checkNewVersion = false - -# Traefik logs file -# If not defined, logs to stdout -# -# Optional -# -# traefikLogsFile = "log/traefik.log" - -# Access logs file -# -# Optional -# -#accessLogsFile = "/tmp/log/access.log" - -# Log level -# -# Optional -# Default: "ERROR" -# Accepted values, in order of severity: "DEBUG", "INFO", "WARN", "ERROR", "FATAL", "PANIC" -# Messages at and above the selected level will be logged. -# -# logLevel = "ERROR" - -# Backends throttle duration: minimum duration in seconds between 2 events from providers -# before applying a new configuration. It avoids unnecessary reloads if multiples events -# are sent in a short amount of time. -# -# Optional -# Default: "2" -# -# ProvidersThrottleDuration = "5" - -# If non-zero, controls the maximum idle (keep-alive) to keep per-host. If zero, DefaultMaxIdleConnsPerHost is used. -# If you encounter 'too many open files' errors, you can either change this value, or change `ulimit` value. -# -# Optional -# Default: http.DefaultMaxIdleConnsPerHost -# -# MaxIdleConnsPerHost = 200 - -# If set to true invalid SSL certificates are accepted for backends. -# Note: This disables detection of man-in-the-middle attacks so should only be used on secure backend networks. -# Optional -# Default: false -# -# InsecureSkipVerify = true - -# Entrypoints to be used by frontends that do not specify any entrypoint. -# Each frontend can specify its own entrypoints. -# -# Optional -# Default: ["http"] -# -# defaultEntryPoints = ["http", "https"] - -<% if scope.lookupvar('che::che_env') == 'development' -%> -[web] -address = ":7070" -<% end -%> - -[entryPoints] - [entryPoints.http] - address = ":<%= scope.lookupvar('che::che_port') -%>" - -[docker] -watch = true diff --git a/dockerfiles/ip/Dockerfile b/dockerfiles/ip/Dockerfile deleted file mode 100644 index e6dc7b1f951b..000000000000 --- a/dockerfiles/ip/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2017 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 -# -# build: -# docker build -t eclipse/che-ip . -# -# use: -# docker run --rm --net=host eclipse/che-ip - -FROM alpine:3.4 - -COPY /src/ /ip/ -ENTRYPOINT ["/ip/entrypoint.sh"] diff --git a/dockerfiles/ip/build.sh b/dockerfiles/ip/build.sh deleted file mode 100755 index 0ce5c2c00847..000000000000 --- a/dockerfiles/ip/build.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2016-2017 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:ip "$@" -build - -if ! skip_tests; then - bash "${base_dir}"/test.sh "$@" -fi diff --git a/dockerfiles/ip/run.sh b/dockerfiles/ip/run.sh deleted file mode 100755 index 6c7e8b08ea27..000000000000 --- a/dockerfiles/ip/run.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2017 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: -# Florent Benoit - Initial Implementation -# - -IMAGE_NAME="eclipse/che-ip" -. $(cd "$(dirname "$0")"; pwd)/../build.include - -init "$@" - -# use -x to display run command -set -x -docker run --rm --net host ${IMAGE_NAME}:${TAG} diff --git a/dockerfiles/ip/src/entrypoint.sh b/dockerfiles/ip/src/entrypoint.sh deleted file mode 100755 index 9d9b93a51285..000000000000 --- a/dockerfiles/ip/src/entrypoint.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2016-2017 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: -# Florent Benoit - Initial Implementation -# - -# Load library -. /ip/library.sh - -# print ip computed -get_ip_of_docker diff --git a/dockerfiles/ip/src/library.sh b/dockerfiles/ip/src/library.sh deleted file mode 100644 index b3e3e259ee37..000000000000 --- a/dockerfiles/ip/src/library.sh +++ /dev/null @@ -1,153 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2016-2017 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: -# Florent Benoit - Initial Implementation -# - -# Global variables -UNAME_R=${UNAME_R:-$(uname -r)} -IP_A_SHOW=${IP_A_SHOW:-$(ip a show)} - -# Helper function that check if we're running with boot2docker or not -# Global variables used inside this function : -# ${UNAME_R} : output of $(uname -r) -is_boot2docker() { - if $(echo ${UNAME_R} | grep -q 'boot2docker'); then - return 0 - else - return 1 - fi -} - -# Helper function that check if we're running with docker 4 mac / windows or not -# Global variables used inside this function : -# ${UNAME_R} : output of $(uname -r) -is_docker4MacOrWin() { - if $(echo ${UNAME_R} | grep -q 'linuxkit'); then - return 0 - elif $(echo ${UNAME_R} | grep -q 'moby'); then - return 0 - else - return 1 - fi -} - -# Helper function that check if given arg is present in the list of network interfaces -# Global variables used inside this function : -# ${IP_A_SHOW} : output of $(ip a show) -# Function Arguments : -# $1 : name of the network interface -has_network_interface() { - get_network_interfaces_list | grep -Fxq "${1}" -} - -# Helper function that check if given network interface has an ip defined or not -# interface may exists nut no ip is attached -# Global variables used inside this function : -# ${IP_A_SHOW} : output of $(ip a show) -# Function Arguments : -# $1 : name of the network interface -has_ip_on_network_interface() { - local IP_OF_INTERFACE=$(get_ip_from_network_interface $1) - if [ ! -z ${IP_OF_INTERFACE} ]; then - return 0 - fi - return 1 -} - - -# Helper function that search for a given network interface -# 1. If docker4mac/windows -# - check for windows hvint0 -# - or use default eth0 -# 2. If boot2docker -# - use default eth1 -# 3. Native case -# - search one of the matching eth* interface -# - search for ubuntu ens** interface -# - default to docker0 interface -# Global variables used inside this function : -# ${IP_A_SHOW} : output of $(ip a show) -# ${UNAME_R} : output of $(uname -r) -find_network_interface() { - - # handle docker for windows/mac - if is_docker4MacOrWin; then - if has_network_interface "hvint0"; then - NETWORK_IF=hvint0 - elif has_network_interface "eth0"; then - NETWORK_IF=eth0 - fi - # handle boot2docker - elif is_boot2docker; then - if has_network_interface "eth1"; then - NETWORK_IF=eth1 - fi - else - # native mode - if test -z ${NETWORK_IF}; then - for i in $(get_network_interfaces_list); do - if [ ${i:0:3} = eth ] || [ ${i:0:3} = enp ] || [ ${i:0:3} = ens ] || [ ${i:0:4} = wlan ] ;then - if has_ip_on_network_interface $i; then - NETWORK_IF=$i - break - fi - fi - done - fi - # else, default to docker0 interface - if test -z ${NETWORK_IF}; then - if has_network_interface "docker0"; then - NETWORK_IF="docker0" - fi - fi - fi - - echo ${NETWORK_IF} -} - -# Extract ip interface from the given argument -# Global variables used inside this function : -# ${IP_A_SHOW} : output of $(ip a show) -# Function Arguments : -# $1 : Name of the interface : like eth0 -get_ip_from_network_interface() { - echo "${IP_A_SHOW}" | grep -e "scope.*${1}" | \ - grep -v ':' | \ - cut -d/ -f1 | \ - awk 'NR==1{print $2}' -} - - -# Helper functions that extract from $(ip a show) the network interfaces -# It returns list separated with newline like: -# eth0 -# eth1 -# eth2 -# Global variables used inside this function : -# ${IP_A_SHOW} : output of $(ip a show) -get_network_interfaces_list() { - echo "${IP_A_SHOW}" | grep -e "^.*:.*: <" | cut -d':' -f2 | cut -d'@' -f1 | awk '{print $1}' -} - -# Root function that will print ip of external docker -# by first finding the network interface -# Global variables used inside this function : -# ${IP_A_SHOW} : output of $(ip a show) -# ${UNAME_R} : output of $(uname -r) -get_ip_of_docker() { - NETWORK_IF=$(find_network_interface) - - if [[ ! -z ${NETWORK_IF} ]]; then - echo $(get_ip_from_network_interface "${NETWORK_IF}") - else - echo "" - fi -} diff --git a/dockerfiles/ip/test.sh b/dockerfiles/ip/test.sh deleted file mode 100755 index b4c247db49b3..000000000000 --- a/dockerfiles/ip/test.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2017 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: -# Florent Benoit - Initial Implementation -# - -# Name of the image to use to run the tests -BASE_DIR=$(cd "$(dirname "$0")"/..; pwd) -. $BASE_DIR/build.include - -init --name:bats "$@" - -echo "Launching unit tests of $BASE_DIR/ip with docker image ${IMAGE_NAME}:${TAG}" - -DOCKER_RUN_OPTIONS="" -BATS_OPTIONS="" -# run bats with terminal mode (pretty print) if supported by current shell -if [ -t 1 ]; then - DOCKER_RUN_OPTIONS="-t" - BATS_OPTIONS="--pretty" -else - BATS_OPTIONS="--tap" -fi - -set -x -docker run --rm ${DOCKER_RUN_OPTIONS} -v /var/run/docker.sock:/var/run/docker.sock -v $BASE_DIR/ip:/ip $IMAGE_NAME bats ${BATS_OPTIONS} /ip/tests/library_tests.bats diff --git a/dockerfiles/ip/tests/ip-results/centos-native.expected b/dockerfiles/ip/tests/ip-results/centos-native.expected deleted file mode 100644 index 8e5ddf767f6c..000000000000 --- a/dockerfiles/ip/tests/ip-results/centos-native.expected +++ /dev/null @@ -1 +0,0 @@ -172.30.21.70 diff --git a/dockerfiles/ip/tests/ip-results/centos-native.interface b/dockerfiles/ip/tests/ip-results/centos-native.interface deleted file mode 100644 index 614e8deecda5..000000000000 --- a/dockerfiles/ip/tests/ip-results/centos-native.interface +++ /dev/null @@ -1 +0,0 @@ -eth0 diff --git a/dockerfiles/ip/tests/ip-results/centos-native.output b/dockerfiles/ip/tests/ip-results/centos-native.output deleted file mode 100644 index 98ffa6e79026..000000000000 --- a/dockerfiles/ip/tests/ip-results/centos-native.output +++ /dev/null @@ -1,69 +0,0 @@ -1: lo: mtu 65536 qdisc noqueue state UNKNOWN - link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 - inet 127.0.0.1/8 scope host lo - valid_lft forever preferred_lft forever - inet6 ::1/128 scope host - valid_lft forever preferred_lft forever -2: eth0: mtu 9001 qdisc pfifo_fast state UP qlen 1000 - link/ether 06:81:cd:14:be:b0 brd ff:ff:ff:ff:ff:ff - inet 172.30.21.70/24 brd 172.30.21.255 scope global dynamic eth0 - valid_lft 2583sec preferred_lft 2583sec - inet6 fe80::481:cdff:fe14:beb0/64 scope link - valid_lft forever preferred_lft forever -3: br-64241850e9cf: mtu 1500 qdisc noqueue state DOWN - link/ether 02:42:96:ae:8b:14 brd ff:ff:ff:ff:ff:ff - inet 172.18.0.1/16 scope global br-64241850e9cf - valid_lft forever preferred_lft forever - inet6 fe80::42:96ff:feae:8b14/64 scope link - valid_lft forever preferred_lft forever -4: docker0: mtu 1500 qdisc noqueue state DOWN - link/ether 02:42:f7:a5:e1:80 brd ff:ff:ff:ff:ff:ff - inet 172.17.42.1/16 scope global docker0 - valid_lft forever preferred_lft forever - inet6 fe80::42:f7ff:fea5:e180/64 scope link - valid_lft forever preferred_lft forever -5785: vethd38001c@if5784: mtu 1500 qdisc noqueue master br-4770a54d50f0 state UP - link/ether ce:96:ab:87:85:51 brd ff:ff:ff:ff:ff:ff - inet6 fe80::cc96:abff:fe87:8551/64 scope link - valid_lft forever preferred_lft forever -5787: vetha4cd0c7@if5786: mtu 1500 qdisc noqueue master br-4770a54d50f0 state UP - link/ether aa:8e:d0:82:49:d3 brd ff:ff:ff:ff:ff:ff - inet6 fe80::a88e:d0ff:fe82:49d3/64 scope link - valid_lft forever preferred_lft forever -5789: veth784f0a5@if5788: mtu 1500 qdisc noqueue master br-4770a54d50f0 state UP - link/ether f6:23:3d:0d:11:22 brd ff:ff:ff:ff:ff:ff - inet6 fe80::f423:3dff:fe0d:1122/64 scope link - valid_lft forever preferred_lft forever -5791: vethb7e8eb7@if5790: mtu 1500 qdisc noqueue master br-4770a54d50f0 state UP - link/ether 7a:af:c0:89:67:da brd ff:ff:ff:ff:ff:ff - inet6 fe80::78af:c0ff:fe89:67da/64 scope link - valid_lft forever preferred_lft forever -5793: veth4afdbe2@if5792: mtu 1500 qdisc noqueue master br-4770a54d50f0 state UP - link/ether ca:3f:1d:ba:e2:c6 brd ff:ff:ff:ff:ff:ff - inet6 fe80::c83f:1dff:feba:e2c6/64 scope link - valid_lft forever preferred_lft forever -5795: vethc5a890f@if5794: mtu 1500 qdisc noqueue master br-4770a54d50f0 state UP - link/ether 9e:b1:f3:ff:b8:55 brd ff:ff:ff:ff:ff:ff - inet6 fe80::9cb1:f3ff:feff:b855/64 scope link - valid_lft forever preferred_lft forever -5797: vethf6060e0@if5796: mtu 1500 qdisc noqueue master br-4770a54d50f0 state UP - link/ether f6:e3:af:71:9f:00 brd ff:ff:ff:ff:ff:ff - inet6 fe80::f4e3:afff:fe71:9f00/64 scope link - valid_lft forever preferred_lft forever -5799: vethe9f72b5@if5798: mtu 1500 qdisc noqueue master br-4770a54d50f0 state UP - link/ether 92:e5:70:94:eb:d9 brd ff:ff:ff:ff:ff:ff - inet6 fe80::90e5:70ff:fe94:ebd9/64 scope link - valid_lft forever preferred_lft forever -5801: vethb2884a1@if5800: mtu 1500 qdisc noqueue master br-4770a54d50f0 state UP - link/ether 8e:c5:1c:9a:be:11 brd ff:ff:ff:ff:ff:ff - inet6 fe80::8cc5:1cff:fe9a:be11/64 scope link - valid_lft forever preferred_lft forever -3753: br-4770a54d50f0: mtu 1500 qdisc noqueue state UP - link/ether 02:42:1c:a4:35:cd brd ff:ff:ff:ff:ff:ff - inet 172.19.0.1/16 scope global br-4770a54d50f0 - valid_lft forever preferred_lft forever - inet6 fe80::42:1cff:fea4:35cd/64 scope link - valid_lft forever preferred_lft forever -5803: veth6de36e1@if5802: mtu 1500 qdisc noqueue master br-4770a54d50f0 state UP - link/ether aa:e7:35:dc:70:28 brd ff:ff:ff:ff:ff:ff - inet6 fe80::a8e7:35ff:fedc:7028/64 scope link diff --git a/dockerfiles/ip/tests/ip-results/centos-native.uname b/dockerfiles/ip/tests/ip-results/centos-native.uname deleted file mode 100644 index 3514b906cd07..000000000000 --- a/dockerfiles/ip/tests/ip-results/centos-native.uname +++ /dev/null @@ -1 +0,0 @@ -4.4.0-21-generic diff --git a/dockerfiles/ip/tests/ip-results/fedora-multiple-ips.expected b/dockerfiles/ip/tests/ip-results/fedora-multiple-ips.expected deleted file mode 100644 index d05984841b83..000000000000 --- a/dockerfiles/ip/tests/ip-results/fedora-multiple-ips.expected +++ /dev/null @@ -1 +0,0 @@ -138.197.83.152 diff --git a/dockerfiles/ip/tests/ip-results/fedora-multiple-ips.interface b/dockerfiles/ip/tests/ip-results/fedora-multiple-ips.interface deleted file mode 100644 index 614e8deecda5..000000000000 --- a/dockerfiles/ip/tests/ip-results/fedora-multiple-ips.interface +++ /dev/null @@ -1 +0,0 @@ -eth0 diff --git a/dockerfiles/ip/tests/ip-results/fedora-multiple-ips.output b/dockerfiles/ip/tests/ip-results/fedora-multiple-ips.output deleted file mode 100644 index d399b0f33d94..000000000000 --- a/dockerfiles/ip/tests/ip-results/fedora-multiple-ips.output +++ /dev/null @@ -1,20 +0,0 @@ -1: lo: mtu 65536 qdisc noqueue state UNKNOWN qlen 1 - link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 - inet 127.0.0.1/8 scope host lo - valid_lft forever preferred_lft forever - inet6 ::1/128 scope host - valid_lft forever preferred_lft forever -2: eth0: mtu 1500 qdisc fq_codel state UP qlen 1000 - link/ether 4a:78:c5:b3:a3:2e brd ff:ff:ff:ff:ff:ff - inet 138.197.83.152/20 brd 138.197.95.255 scope global eth0 - valid_lft forever preferred_lft forever - inet 10.17.0.5/16 brd 10.17.255.255 scope global eth0 - valid_lft forever preferred_lft forever -3: eth1: mtu 1500 qdisc noop state DOWN qlen 1000 - link/ether 76:fb:55:d5:a2:25 brd ff:ff:ff:ff:ff:ff -4: docker0: mtu 1500 qdisc noqueue state DOWN - link/ether 02:42:93:62:8b:ac brd ff:ff:ff:ff:ff:ff - inet 172.17.0.1/16 scope global docker0 - valid_lft forever preferred_lft forever - inet6 fe80::42:93ff:fe62:8bac/64 scope link - valid_lft forever preferred_lft forever diff --git a/dockerfiles/ip/tests/ip-results/fedora-multiple-ips.uname b/dockerfiles/ip/tests/ip-results/fedora-multiple-ips.uname deleted file mode 100644 index 3514b906cd07..000000000000 --- a/dockerfiles/ip/tests/ip-results/fedora-multiple-ips.uname +++ /dev/null @@ -1 +0,0 @@ -4.4.0-21-generic diff --git a/dockerfiles/ip/tests/ip-results/fedora-native.expected b/dockerfiles/ip/tests/ip-results/fedora-native.expected deleted file mode 100644 index a4fe0c380c5d..000000000000 --- a/dockerfiles/ip/tests/ip-results/fedora-native.expected +++ /dev/null @@ -1 +0,0 @@ -192.168.0.209 diff --git a/dockerfiles/ip/tests/ip-results/fedora-native.interface b/dockerfiles/ip/tests/ip-results/fedora-native.interface deleted file mode 100644 index 21132a33870f..000000000000 --- a/dockerfiles/ip/tests/ip-results/fedora-native.interface +++ /dev/null @@ -1 +0,0 @@ -enp2s0 diff --git a/dockerfiles/ip/tests/ip-results/fedora-native.output b/dockerfiles/ip/tests/ip-results/fedora-native.output deleted file mode 100644 index 83d4fa1042f0..000000000000 --- a/dockerfiles/ip/tests/ip-results/fedora-native.output +++ /dev/null @@ -1,18 +0,0 @@ -1: lo: mtu 65536 qdisc noqueue state UNKNOWN qlen 1 - link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 - inet 127.0.0.1/8 scope host lo - valid_lft forever preferred_lft forever - inet6 ::1/128 scope host - valid_lft forever preferred_lft forever -2: enp2s0: mtu 1500 qdisc fq_codel state UP qlen 1000 - link/ether 90:e6:ba:52:f3:20 brd ff:ff:ff:ff:ff:ff - inet 192.168.0.209/24 brd 192.168.0.255 scope global dynamic enp2s0 - valid_lft 863569sec preferred_lft 863569sec - inet6 fe80::7d9:e299:80c2:e75b/64 scope link - valid_lft forever preferred_lft forever -3: docker0: mtu 1500 qdisc noqueue state DOWN - link/ether 02:42:57:71:98:fb brd ff:ff:ff:ff:ff:ff - inet 172.17.0.1/16 scope global docker0 - valid_lft forever preferred_lft forever - inet6 fe80::42:57ff:fe71:98fb/64 scope link - valid_lft forever preferred_lft forever diff --git a/dockerfiles/ip/tests/ip-results/fedora-native.uname b/dockerfiles/ip/tests/ip-results/fedora-native.uname deleted file mode 100644 index 3514b906cd07..000000000000 --- a/dockerfiles/ip/tests/ip-results/fedora-native.uname +++ /dev/null @@ -1 +0,0 @@ -4.4.0-21-generic diff --git a/dockerfiles/ip/tests/ip-results/macos-docker-for-mac.expected b/dockerfiles/ip/tests/ip-results/macos-docker-for-mac.expected deleted file mode 100644 index 98c020db0a9c..000000000000 --- a/dockerfiles/ip/tests/ip-results/macos-docker-for-mac.expected +++ /dev/null @@ -1 +0,0 @@ -192.168.65.2 diff --git a/dockerfiles/ip/tests/ip-results/macos-docker-for-mac.interface b/dockerfiles/ip/tests/ip-results/macos-docker-for-mac.interface deleted file mode 100644 index 614e8deecda5..000000000000 --- a/dockerfiles/ip/tests/ip-results/macos-docker-for-mac.interface +++ /dev/null @@ -1 +0,0 @@ -eth0 diff --git a/dockerfiles/ip/tests/ip-results/macos-docker-for-mac.output b/dockerfiles/ip/tests/ip-results/macos-docker-for-mac.output deleted file mode 100644 index de6be72a8359..000000000000 --- a/dockerfiles/ip/tests/ip-results/macos-docker-for-mac.output +++ /dev/null @@ -1,44 +0,0 @@ -1: lo: mtu 65536 qdisc noqueue state UNKNOWN qlen 1 - link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 - inet 127.0.0.1/8 scope host lo - valid_lft forever preferred_lft forever - inet6 ::1/128 scope host - valid_lft forever preferred_lft forever -2: bond0: mtu 1500 qdisc noop state DOWN qlen 1000 - link/ether 76:5e:b1:2e:36:bc brd ff:ff:ff:ff:ff:ff -3: dummy0: mtu 1500 qdisc noop state DOWN qlen 1000 - link/ether 32:d6:88:f5:3f:f1 brd ff:ff:ff:ff:ff:ff -4: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000 - link/ether c0:ff:ee:c0:ff:ee brd ff:ff:ff:ff:ff:ff - inet 192.168.65.2/29 brd 192.168.65.7 scope global eth0 - valid_lft forever preferred_lft forever - inet6 fe80::227b:c894:95f2:95d4/64 scope link - valid_lft forever preferred_lft forever -5: teql0: mtu 1500 qdisc noop state DOWN qlen 100 - link/void -6: tunl0@NONE: mtu 1480 qdisc noop state DOWN qlen 1 - link/ipip 0.0.0.0 brd 0.0.0.0 -7: gre0@NONE: mtu 1476 qdisc noop state DOWN qlen 1 - link/gre 0.0.0.0 brd 0.0.0.0 -8: gretap0@NONE: mtu 1462 qdisc noop state DOWN qlen 1000 - link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff -9: ip_vti0@NONE: mtu 1332 qdisc noop state DOWN qlen 1 - link/ipip 0.0.0.0 brd 0.0.0.0 -10: ip6_vti0@NONE: mtu 1500 qdisc noop state DOWN qlen 1 - link/tunnel6 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 brd 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 -11: sit0@NONE: mtu 1480 qdisc noop state DOWN qlen 1 - link/sit 0.0.0.0 brd 0.0.0.0 -12: ip6tnl0@NONE: mtu 1452 qdisc noop state DOWN qlen 1 - link/tunnel6 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 brd 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 -13: ip6gre0@NONE: mtu 1448 qdisc noop state DOWN qlen 1 - link/[823] 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 brd 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 -14: br-b657f5c7e448: mtu 1500 qdisc noqueue state DOWN - link/ether 02:42:0d:3b:2e:aa brd ff:ff:ff:ff:ff:ff - inet 172.18.0.1/16 scope global br-b657f5c7e448 - valid_lft forever preferred_lft forever -15: docker0: mtu 1500 qdisc noqueue state DOWN - link/ether 02:42:fa:00:58:28 brd ff:ff:ff:ff:ff:ff - inet 172.17.0.1/16 scope global docker0 - valid_lft forever preferred_lft forever - inet6 fe80::42:faff:fe00:5828/64 scope link - valid_lft forever preferred_lft forever diff --git a/dockerfiles/ip/tests/ip-results/macos-docker-for-mac.uname b/dockerfiles/ip/tests/ip-results/macos-docker-for-mac.uname deleted file mode 100644 index 104f0f5029fc..000000000000 --- a/dockerfiles/ip/tests/ip-results/macos-docker-for-mac.uname +++ /dev/null @@ -1 +0,0 @@ -4.9.4-moby diff --git a/dockerfiles/ip/tests/ip-results/ubuntu-native-wlan.expected b/dockerfiles/ip/tests/ip-results/ubuntu-native-wlan.expected deleted file mode 100644 index ac968363740b..000000000000 --- a/dockerfiles/ip/tests/ip-results/ubuntu-native-wlan.expected +++ /dev/null @@ -1 +0,0 @@ -192.168.1.142 diff --git a/dockerfiles/ip/tests/ip-results/ubuntu-native-wlan.interface b/dockerfiles/ip/tests/ip-results/ubuntu-native-wlan.interface deleted file mode 100644 index c66f7624c42e..000000000000 --- a/dockerfiles/ip/tests/ip-results/ubuntu-native-wlan.interface +++ /dev/null @@ -1 +0,0 @@ -wlan0 diff --git a/dockerfiles/ip/tests/ip-results/ubuntu-native-wlan.output b/dockerfiles/ip/tests/ip-results/ubuntu-native-wlan.output deleted file mode 100644 index 66265c11efe6..000000000000 --- a/dockerfiles/ip/tests/ip-results/ubuntu-native-wlan.output +++ /dev/null @@ -1,28 +0,0 @@ -1: lo: mtu 65536 qdisc noqueue state UNKNOWN - link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 - inet 127.0.0.1/8 scope host lo - valid_lft forever preferred_lft forever - inet6 ::1/128 scope host - valid_lft forever preferred_lft forever -2: eth0: mtu 1500 qdisc pfifo_fast state DOWN qlen 1000 - link/ether e0:db:55:a8:11:0c brd ff:ff:ff:ff:ff:ff -3: wlan0: mtu 1500 qdisc mq state UP qlen 1000 - link/ether 68:17:29:97:66:2a brd ff:ff:ff:ff:ff:ff - inet 192.168.1.142/24 brd 192.168.1.255 scope global wlan0 - valid_lft forever preferred_lft forever - inet6 fe80::6a17:29ff:fe97:662a/64 scope link - valid_lft forever preferred_lft forever -4: docker0: mtu 1500 qdisc noqueue state UP - link/ether 02:42:90:e8:46:d7 brd ff:ff:ff:ff:ff:ff - inet 172.17.42.1/16 scope global docker0 - valid_lft forever preferred_lft forever - inet6 fe80::42:90ff:fee8:46d7/64 scope link - valid_lft forever preferred_lft forever -203: veth19f4278: mtu 1500 qdisc noqueue master docker0 state UP - link/ether a6:96:97:f6:8c:ff brd ff:ff:ff:ff:ff:ff - inet6 fe80::a496:97ff:fef6:8cff/64 scope link - valid_lft forever preferred_lft forever -210: br-92a8d60e76bb: mtu 1500 qdisc noqueue state DOWN - link/ether 02:42:c4:ee:96:17 brd ff:ff:ff:ff:ff:ff - inet 172.18.0.1/16 scope global br-92a8d60e76bb - valid_lft forever preferred_lft forever \ No newline at end of file diff --git a/dockerfiles/ip/tests/ip-results/ubuntu-native-wlan.uname b/dockerfiles/ip/tests/ip-results/ubuntu-native-wlan.uname deleted file mode 100644 index 3514b906cd07..000000000000 --- a/dockerfiles/ip/tests/ip-results/ubuntu-native-wlan.uname +++ /dev/null @@ -1 +0,0 @@ -4.4.0-21-generic diff --git a/dockerfiles/ip/tests/ip-results/ubuntu-native.expected b/dockerfiles/ip/tests/ip-results/ubuntu-native.expected deleted file mode 100644 index 61de7c2b81fb..000000000000 --- a/dockerfiles/ip/tests/ip-results/ubuntu-native.expected +++ /dev/null @@ -1 +0,0 @@ -172.16.148.171 diff --git a/dockerfiles/ip/tests/ip-results/ubuntu-native.interface b/dockerfiles/ip/tests/ip-results/ubuntu-native.interface deleted file mode 100644 index ba2f17396ef6..000000000000 --- a/dockerfiles/ip/tests/ip-results/ubuntu-native.interface +++ /dev/null @@ -1 +0,0 @@ -ens33 diff --git a/dockerfiles/ip/tests/ip-results/ubuntu-native.output b/dockerfiles/ip/tests/ip-results/ubuntu-native.output deleted file mode 100644 index a8539ff5c0f5..000000000000 --- a/dockerfiles/ip/tests/ip-results/ubuntu-native.output +++ /dev/null @@ -1,30 +0,0 @@ -1: lo: mtu 65536 qdisc noqueue state UNKNOWN qlen 1 - link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 - inet 127.0.0.1/8 scope host lo - valid_lft forever preferred_lft forever - inet6 ::1/128 scope host - valid_lft forever preferred_lft forever -2: ens33: mtu 1500 qdisc pfifo_fast state UP qlen 1000 - link/ether 00:0c:29:f4:ca:f6 brd ff:ff:ff:ff:ff:ff - inet 172.16.148.171/24 brd 172.16.148.255 scope global ens33 - valid_lft forever preferred_lft forever - inet6 fe80::20c:29ff:fef4:caf6/64 scope link - valid_lft forever preferred_lft forever -3: docker0: mtu 1500 qdisc noqueue state DOWN - link/ether 02:42:47:f0:7c:bb brd ff:ff:ff:ff:ff:ff - inet 172.17.0.1/16 scope global docker0 - valid_lft forever preferred_lft forever - inet6 fe80::42:47ff:fef0:7cbb/64 scope link - valid_lft forever preferred_lft forever -102: br-fe5747c6c290: mtu 1500 qdisc noqueue state DOWN - link/ether 02:42:72:74:52:0f brd ff:ff:ff:ff:ff:ff - inet 172.18.0.1/16 scope global br-fe5747c6c290 - valid_lft forever preferred_lft forever - inet6 fe80::42:72ff:fe74:520f/64 scope link - valid_lft forever preferred_lft forever -141: br-f2a054118a36: mtu 1500 qdisc noqueue state DOWN - link/ether 02:42:79:a8:0f:1e brd ff:ff:ff:ff:ff:ff - inet 172.19.0.1/16 scope global br-f2a054118a36 - valid_lft forever preferred_lft forever - inet6 fe80::42:79ff:fea8:f1e/64 scope link - valid_lft forever preferred_lft forever diff --git a/dockerfiles/ip/tests/ip-results/ubuntu-native.uname b/dockerfiles/ip/tests/ip-results/ubuntu-native.uname deleted file mode 100644 index 3514b906cd07..000000000000 --- a/dockerfiles/ip/tests/ip-results/ubuntu-native.uname +++ /dev/null @@ -1 +0,0 @@ -4.4.0-21-generic diff --git a/dockerfiles/ip/tests/ip-results/ubuntu-only-docker.expected b/dockerfiles/ip/tests/ip-results/ubuntu-only-docker.expected deleted file mode 100644 index 98e0b43c3e79..000000000000 --- a/dockerfiles/ip/tests/ip-results/ubuntu-only-docker.expected +++ /dev/null @@ -1 +0,0 @@ -172.17.0.1 diff --git a/dockerfiles/ip/tests/ip-results/ubuntu-only-docker.interface b/dockerfiles/ip/tests/ip-results/ubuntu-only-docker.interface deleted file mode 100644 index 50b3bf07eda3..000000000000 --- a/dockerfiles/ip/tests/ip-results/ubuntu-only-docker.interface +++ /dev/null @@ -1 +0,0 @@ -docker0 diff --git a/dockerfiles/ip/tests/ip-results/ubuntu-only-docker.output b/dockerfiles/ip/tests/ip-results/ubuntu-only-docker.output deleted file mode 100644 index 64fee9045e17..000000000000 --- a/dockerfiles/ip/tests/ip-results/ubuntu-only-docker.output +++ /dev/null @@ -1,18 +0,0 @@ -1: lo: mtu 65536 qdisc noqueue state UNKNOWN qlen 1 - link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 - inet 127.0.0.1/8 scope host lo - valid_lft forever preferred_lft forever - inet6 ::1/128 scope host - valid_lft forever preferred_lft forever -3: docker0: mtu 1500 qdisc noqueue state DOWN - link/ether 02:42:47:f0:7c:bb brd ff:ff:ff:ff:ff:ff - inet 172.17.0.1/16 scope global docker0 - valid_lft forever preferred_lft forever - inet6 fe80::42:47ff:fef0:7cbb/64 scope link - valid_lft forever preferred_lft forever -141: br-f2a054118a36: mtu 1500 qdisc noqueue state DOWN - link/ether 02:42:79:a8:0f:1e brd ff:ff:ff:ff:ff:ff - inet 172.19.0.1/16 scope global br-f2a054118a36 - valid_lft forever preferred_lft forever - inet6 fe80::42:79ff:fea8:f1e/64 scope link - valid_lft forever preferred_lft forever diff --git a/dockerfiles/ip/tests/ip-results/ubuntu-only-docker.uname b/dockerfiles/ip/tests/ip-results/ubuntu-only-docker.uname deleted file mode 100644 index 3514b906cd07..000000000000 --- a/dockerfiles/ip/tests/ip-results/ubuntu-only-docker.uname +++ /dev/null @@ -1 +0,0 @@ -4.4.0-21-generic diff --git a/dockerfiles/ip/tests/ip-results/windows10-boot2docker.expected b/dockerfiles/ip/tests/ip-results/windows10-boot2docker.expected deleted file mode 100644 index 5989edf39467..000000000000 --- a/dockerfiles/ip/tests/ip-results/windows10-boot2docker.expected +++ /dev/null @@ -1 +0,0 @@ -192.168.99.100 diff --git a/dockerfiles/ip/tests/ip-results/windows10-boot2docker.interface b/dockerfiles/ip/tests/ip-results/windows10-boot2docker.interface deleted file mode 100644 index dbf1b394d26a..000000000000 --- a/dockerfiles/ip/tests/ip-results/windows10-boot2docker.interface +++ /dev/null @@ -1 +0,0 @@ -eth1 diff --git a/dockerfiles/ip/tests/ip-results/windows10-boot2docker.output b/dockerfiles/ip/tests/ip-results/windows10-boot2docker.output deleted file mode 100644 index 71acdcf1a3e4..000000000000 --- a/dockerfiles/ip/tests/ip-results/windows10-boot2docker.output +++ /dev/null @@ -1,36 +0,0 @@ -1: lo: mtu 65536 qdisc noqueue state UNKNOWN qlen 1 - link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 - inet 127.0.0.1/8 scope host lo - valid_lft forever preferred_lft forever - inet6 ::1/128 scope host - valid_lft forever preferred_lft forever -2: dummy0: mtu 1500 qdisc noop state DOWN qlen 1000 - link/ether 5a:3c:5e:85:0f:ee brd ff:ff:ff:ff:ff:ff -3: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000 - link/ether 08:00:27:3b:43:64 brd ff:ff:ff:ff:ff:ff - inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0 - valid_lft forever preferred_lft forever - inet6 fe80::a00:27ff:fe3b:4364/64 scope link - valid_lft forever preferred_lft forever -4: eth1: mtu 1500 qdisc pfifo_fast state UP qlen 1000 - link/ether 08:00:27:05:08:59 brd ff:ff:ff:ff:ff:ff - inet 192.168.99.100/24 brd 192.168.99.255 scope global eth1 - valid_lft forever preferred_lft forever - inet6 fe80::a00:27ff:fe05:859/64 scope link - valid_lft forever preferred_lft forever -5: br-353a315ef06d: mtu 1500 qdisc noqueue state DOWN - link/ether 02:42:1c:4b:0c:cd brd ff:ff:ff:ff:ff:ff - inet 172.19.0.1/16 scope global br-353a315ef06d - valid_lft forever preferred_lft forever -6: br-b59258a62265: mtu 1500 qdisc noqueue state DOWN - link/ether 02:42:20:be:91:ee brd ff:ff:ff:ff:ff:ff - inet 172.20.0.1/16 scope global br-b59258a62265 - valid_lft forever preferred_lft forever -7: br-b99d4b316a64: mtu 1500 qdisc noqueue state DOWN - link/ether 02:42:fd:72:aa:54 brd ff:ff:ff:ff:ff:ff - inet 172.18.0.1/16 scope global br-b99d4b316a64 - valid_lft forever preferred_lft forever -8: docker0: mtu 1500 qdisc noqueue state DOWN - link/ether 02:42:43:01:8a:6c brd ff:ff:ff:ff:ff:ff - inet 172.17.0.1/16 scope global docker0 - valid_lft forever preferred_lft forever diff --git a/dockerfiles/ip/tests/ip-results/windows10-boot2docker.uname b/dockerfiles/ip/tests/ip-results/windows10-boot2docker.uname deleted file mode 100644 index 6c477db372f3..000000000000 --- a/dockerfiles/ip/tests/ip-results/windows10-boot2docker.uname +++ /dev/null @@ -1 +0,0 @@ -4.4.41-boot2docker diff --git a/dockerfiles/ip/tests/ip-results/windows10-docker-for-windows.expected b/dockerfiles/ip/tests/ip-results/windows10-docker-for-windows.expected deleted file mode 100644 index 0be45017d0c0..000000000000 --- a/dockerfiles/ip/tests/ip-results/windows10-docker-for-windows.expected +++ /dev/null @@ -1 +0,0 @@ -10.0.75.2 diff --git a/dockerfiles/ip/tests/ip-results/windows10-docker-for-windows.interface b/dockerfiles/ip/tests/ip-results/windows10-docker-for-windows.interface deleted file mode 100644 index 8f20ca6a851b..000000000000 --- a/dockerfiles/ip/tests/ip-results/windows10-docker-for-windows.interface +++ /dev/null @@ -1 +0,0 @@ -hvint0 diff --git a/dockerfiles/ip/tests/ip-results/windows10-docker-for-windows.output b/dockerfiles/ip/tests/ip-results/windows10-docker-for-windows.output deleted file mode 100644 index 705fefa36ab6..000000000000 --- a/dockerfiles/ip/tests/ip-results/windows10-docker-for-windows.output +++ /dev/null @@ -1,46 +0,0 @@ -1: lo: mtu 65536 qdisc noqueue state UNKNOWN qlen 1 - link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 - inet 127.0.0.1/8 scope host lo - valid_lft forever preferred_lft forever - inet6 ::1/128 scope host - valid_lft forever preferred_lft forever -2: bond0: mtu 1500 qdisc noop state DOWN qlen 1000 - link/ether 2e:46:61:b0:db:a0 brd ff:ff:ff:ff:ff:ff -3: dummy0: mtu 1500 qdisc noop state DOWN qlen 1000 - link/ether 92:c7:01:43:95:00 brd ff:ff:ff:ff:ff:ff -4: hvint0: mtu 1500 qdisc pfifo_fast state UP qlen 1000 - link/ether 00:15:5d:94:82:03 brd ff:ff:ff:ff:ff:ff - inet 10.0.75.2/24 scope global hvint0 - valid_lft forever preferred_lft forever - inet6 fe80::215:5dff:fe94:8203/64 scope link - valid_lft forever preferred_lft forever -5: teql0: mtu 1500 qdisc noop state DOWN qlen 100 - link/void -6: tunl0@NONE: mtu 1480 qdisc noop state DOWN qlen 1 - link/ipip 0.0.0.0 brd 0.0.0.0 -7: gre0@NONE: mtu 1476 qdisc noop state DOWN qlen 1 - link/gre 0.0.0.0 brd 0.0.0.0 -8: gretap0@NONE: mtu 1462 qdisc noop state DOWN qlen 1000 - link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff -9: ip_vti0@NONE: mtu 1428 qdisc noop state DOWN qlen 1 - link/ipip 0.0.0.0 brd 0.0.0.0 -10: ip6_vti0@NONE: mtu 1500 qdisc noop state DOWN qlen 1 - link/tunnel6 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 brd 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 -11: sit0@NONE: mtu 1480 qdisc noop state DOWN qlen 1 - link/sit 0.0.0.0 brd 0.0.0.0 -12: ip6tnl0@NONE: mtu 1452 qdisc noop state DOWN qlen 1 - link/tunnel6 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 brd 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 -13: ip6gre0@NONE: mtu 1448 qdisc noop state DOWN qlen 1 - link/[823] 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 brd 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 -14: eth0: mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000 - link/ether c0:ff:ee:c0:ff:ee brd ff:ff:ff:ff:ff:ff - inet 192.168.65.2/28 brd 192.168.65.15 scope global eth0 - valid_lft forever preferred_lft forever - inet6 fe80::3ea9:df92:21ae:b11c/64 scope link - valid_lft forever preferred_lft forever -15: docker0: mtu 1500 qdisc noqueue state DOWN - link/ether 02:42:8c:89:b8:8a brd ff:ff:ff:ff:ff:ff - inet 172.17.0.1/16 scope global docker0 - valid_lft forever preferred_lft forever - inet6 fe80::42:8cff:fe89:b88a/64 scope link - valid_lft forever preferred_lft forever diff --git a/dockerfiles/ip/tests/ip-results/windows10-docker-for-windows.uname b/dockerfiles/ip/tests/ip-results/windows10-docker-for-windows.uname deleted file mode 100644 index c10a249a3f87..000000000000 --- a/dockerfiles/ip/tests/ip-results/windows10-docker-for-windows.uname +++ /dev/null @@ -1 +0,0 @@ -4.4.27-moby diff --git a/dockerfiles/ip/tests/library_tests.bats b/dockerfiles/ip/tests/library_tests.bats deleted file mode 100644 index 7c683dff9bd2..000000000000 --- a/dockerfiles/ip/tests/library_tests.bats +++ /dev/null @@ -1,141 +0,0 @@ -#!/usr/bin/env bats -# Copyright (c) 2017 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: -# Florent Benoit - Initial Implementation -# - -load '/bats-support/load.bash' -load '/bats-assert/load.bash' -source /ip/src/library.sh - -check_ip_result() { - FILENAME="$1" - # GIVEN - [[ -f /ip/tests/ip-results/${FILENAME}.output ]] || exit 1 - IP_A_SHOW=$(cat /ip/tests/ip-results/${FILENAME}.output) - [[ -f /ip/tests/ip-results/${FILENAME}.uname ]] || exit 1 - UNAME_R=$(cat /ip/tests/ip-results/${FILENAME}.uname) - - [[ -f /ip/tests/ip-results/${FILENAME}.interface ]] || exit 1 - local interface_name=$(cat /ip/tests/ip-results/${FILENAME}.interface) - [[ -f /ip/tests/ip-results/${FILENAME}.expected ]] || exit 1 - local expected=$(cat /ip/tests/ip-results/${FILENAME}.expected) - - #WHEN - run find_network_interface - #THEN - assert_output ${interface_name} - assert_success - - # WHEN - run get_ip_from_network_interface "${interface_name}" - #THEN - assert_output ${expected} - assert_success - - #WHEN - run get_ip_of_docker - #THEN - assert_output ${expected} - assert_success - - - -} - -@test "Get ip based on ip a show interface (centos/native)" { - check_ip_result "centos-native" -} - -@test "Get ip based on ip a show interface (mac/docker4mac)" { - check_ip_result "macos-docker-for-mac" -} - -@test "Get ip based on ip a show interface (ubuntu/native)" { - check_ip_result "ubuntu-native" -} - -@test "Get ip based on ip a show interface (fedora/native)" { - check_ip_result "fedora-native" -} - -@test "Get ip based on ip a show interface (fedora/multiple-ips)" { - check_ip_result "fedora-multiple-ips" -} - -@test "Get ip based on ip a show interface (ubuntu/native/wlan)" { - check_ip_result "ubuntu-native-wlan" -} - -@test "Get ip based on ip a show interface (windows10/docker4windows)" { - check_ip_result "windows10-docker-for-windows" -} - -@test "Get ip based on ip a show interface (windows10/boot2docker)" { - check_ip_result "windows10-boot2docker" -} - -@test "Get ip based on ip a show interface (ubuntu/only docker network)" { - check_ip_result "ubuntu-only-docker" -} - -@test "Check isDocker4Mac/Win is true" { - # GIVEN - UNAME_R="4.9.4-moby" - - # WHEN - run is_docker4MacOrWin - - # THEN - assert_success -} - -@test "Check isDocker4Mac/Win is true (new docker releases)" { - # GIVEN - UNAME_R="4.9.44-linuxkit-aufs" - - # WHEN - run is_docker4MacOrWin - - # THEN - assert_success -} - -@test "Check isDocker4Mac/Win on Linux is false" { - # GIVEN - UNAME_R="4.4.0-21-generic" - - # WHEN - run is_docker4MacOrWin - - # THEN - assert_failure -} - -@test "Check isBoot2Docker is true" { - # GIVEN - UNAME_R="boot2docker" - - # WHEN - run is_boot2docker - - # THEN - assert_success -} - -@test "Check isBoot2Docker on Linux is false" { - # GIVEN - UNAME_R="4.4.0-21-generic" - - # WHEN - run is_boot2docker - - # THEN - assert_failure -} diff --git a/dockerfiles/keycloak/build.sh b/dockerfiles/keycloak/build.sh index 9a391c54ffd2..0b2419330cea 100755 --- a/dockerfiles/keycloak/build.sh +++ b/dockerfiles/keycloak/build.sh @@ -11,15 +11,5 @@ base_dir=$(cd "$(dirname "$0")"; pwd) . "${base_dir}"/../build.include -DIR=$(cd "$(dirname "$0")"; pwd) -# copy che theme -cp -r "${DIR}"/../init/modules/keycloak/files/che "${DIR}" -# copy user and realm json templates -cp -r "${DIR}"/../init/modules/keycloak/templates/* "${DIR}" - init --name:keycloak "$@" build - -# remove files -rm -rf "${DIR}"/che -rm -rf "${DIR}"/*.erb diff --git a/dockerfiles/init/modules/keycloak/templates/che-realm.json.erb b/dockerfiles/keycloak/che-realm.json.erb similarity index 100% rename from dockerfiles/init/modules/keycloak/templates/che-realm.json.erb rename to dockerfiles/keycloak/che-realm.json.erb diff --git a/dockerfiles/init/modules/keycloak/templates/che-users-0.json.erb b/dockerfiles/keycloak/che-users-0.json.erb similarity index 100% rename from dockerfiles/init/modules/keycloak/templates/che-users-0.json.erb rename to dockerfiles/keycloak/che-users-0.json.erb diff --git a/dockerfiles/init/modules/keycloak/files/che/account/messages/messages_en.properties b/dockerfiles/keycloak/che/account/messages/messages_en.properties similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/account/messages/messages_en.properties rename to dockerfiles/keycloak/che/account/messages/messages_en.properties diff --git a/dockerfiles/init/modules/keycloak/files/che/account/resources/css/che-account.css b/dockerfiles/keycloak/che/account/resources/css/che-account.css similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/account/resources/css/che-account.css rename to dockerfiles/keycloak/che/account/resources/css/che-account.css diff --git a/dockerfiles/init/modules/keycloak/files/che/account/template.ftl b/dockerfiles/keycloak/che/account/template.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/account/template.ftl rename to dockerfiles/keycloak/che/account/template.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/account/theme.properties b/dockerfiles/keycloak/che/account/theme.properties similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/account/theme.properties rename to dockerfiles/keycloak/che/account/theme.properties diff --git a/dockerfiles/init/modules/keycloak/files/che/email/html/email-verification.ftl b/dockerfiles/keycloak/che/email/html/email-verification.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/email/html/email-verification.ftl rename to dockerfiles/keycloak/che/email/html/email-verification.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/email/html/event-login_error.ftl b/dockerfiles/keycloak/che/email/html/event-login_error.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/email/html/event-login_error.ftl rename to dockerfiles/keycloak/che/email/html/event-login_error.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/email/html/event-remove_totp.ftl b/dockerfiles/keycloak/che/email/html/event-remove_totp.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/email/html/event-remove_totp.ftl rename to dockerfiles/keycloak/che/email/html/event-remove_totp.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/email/html/event-update_password.ftl b/dockerfiles/keycloak/che/email/html/event-update_password.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/email/html/event-update_password.ftl rename to dockerfiles/keycloak/che/email/html/event-update_password.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/email/html/event-update_totp.ftl b/dockerfiles/keycloak/che/email/html/event-update_totp.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/email/html/event-update_totp.ftl rename to dockerfiles/keycloak/che/email/html/event-update_totp.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/email/html/executeActions.ftl b/dockerfiles/keycloak/che/email/html/executeActions.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/email/html/executeActions.ftl rename to dockerfiles/keycloak/che/email/html/executeActions.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/email/html/footer.ftl b/dockerfiles/keycloak/che/email/html/footer.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/email/html/footer.ftl rename to dockerfiles/keycloak/che/email/html/footer.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/email/html/header.ftl b/dockerfiles/keycloak/che/email/html/header.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/email/html/header.ftl rename to dockerfiles/keycloak/che/email/html/header.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/email/html/identity-provider-link.ftl b/dockerfiles/keycloak/che/email/html/identity-provider-link.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/email/html/identity-provider-link.ftl rename to dockerfiles/keycloak/che/email/html/identity-provider-link.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/email/html/password-reset.ftl b/dockerfiles/keycloak/che/email/html/password-reset.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/email/html/password-reset.ftl rename to dockerfiles/keycloak/che/email/html/password-reset.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/email/messages/messages_en.properties b/dockerfiles/keycloak/che/email/messages/messages_en.properties similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/email/messages/messages_en.properties rename to dockerfiles/keycloak/che/email/messages/messages_en.properties diff --git a/dockerfiles/init/modules/keycloak/files/che/email/text/email-verification.ftl b/dockerfiles/keycloak/che/email/text/email-verification.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/email/text/email-verification.ftl rename to dockerfiles/keycloak/che/email/text/email-verification.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/email/text/event-login_error.ftl b/dockerfiles/keycloak/che/email/text/event-login_error.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/email/text/event-login_error.ftl rename to dockerfiles/keycloak/che/email/text/event-login_error.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/email/text/event-remove_totp.ftl b/dockerfiles/keycloak/che/email/text/event-remove_totp.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/email/text/event-remove_totp.ftl rename to dockerfiles/keycloak/che/email/text/event-remove_totp.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/email/text/event-update_password.ftl b/dockerfiles/keycloak/che/email/text/event-update_password.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/email/text/event-update_password.ftl rename to dockerfiles/keycloak/che/email/text/event-update_password.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/email/text/event-update_totp.ftl b/dockerfiles/keycloak/che/email/text/event-update_totp.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/email/text/event-update_totp.ftl rename to dockerfiles/keycloak/che/email/text/event-update_totp.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/email/text/executeActions.ftl b/dockerfiles/keycloak/che/email/text/executeActions.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/email/text/executeActions.ftl rename to dockerfiles/keycloak/che/email/text/executeActions.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/email/text/footer.ftl b/dockerfiles/keycloak/che/email/text/footer.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/email/text/footer.ftl rename to dockerfiles/keycloak/che/email/text/footer.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/email/text/header.ftl b/dockerfiles/keycloak/che/email/text/header.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/email/text/header.ftl rename to dockerfiles/keycloak/che/email/text/header.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/email/text/identity-provider-link.ftl b/dockerfiles/keycloak/che/email/text/identity-provider-link.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/email/text/identity-provider-link.ftl rename to dockerfiles/keycloak/che/email/text/identity-provider-link.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/email/text/password-reset.ftl b/dockerfiles/keycloak/che/email/text/password-reset.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/email/text/password-reset.ftl rename to dockerfiles/keycloak/che/email/text/password-reset.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/email/theme.properties b/dockerfiles/keycloak/che/email/theme.properties similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/email/theme.properties rename to dockerfiles/keycloak/che/email/theme.properties diff --git a/dockerfiles/init/modules/keycloak/files/che/login/login-reset-password.ftl b/dockerfiles/keycloak/che/login/login-reset-password.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/login/login-reset-password.ftl rename to dockerfiles/keycloak/che/login/login-reset-password.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/login/login-update-password.ftl b/dockerfiles/keycloak/che/login/login-update-password.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/login/login-update-password.ftl rename to dockerfiles/keycloak/che/login/login-update-password.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/login/login.ftl b/dockerfiles/keycloak/che/login/login.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/login/login.ftl rename to dockerfiles/keycloak/che/login/login.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/login/logo.ftl b/dockerfiles/keycloak/che/login/logo.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/login/logo.ftl rename to dockerfiles/keycloak/che/login/logo.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/login/messages/messages_en.properties b/dockerfiles/keycloak/che/login/messages/messages_en.properties similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/login/messages/messages_en.properties rename to dockerfiles/keycloak/che/login/messages/messages_en.properties diff --git a/dockerfiles/init/modules/keycloak/files/che/login/register.ftl b/dockerfiles/keycloak/che/login/register.ftl similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/login/register.ftl rename to dockerfiles/keycloak/che/login/register.ftl diff --git a/dockerfiles/init/modules/keycloak/files/che/login/resources/css/che-login.css b/dockerfiles/keycloak/che/login/resources/css/che-login.css similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/login/resources/css/che-login.css rename to dockerfiles/keycloak/che/login/resources/css/che-login.css diff --git a/dockerfiles/init/modules/keycloak/files/che/login/resources/img/che-logo.svg b/dockerfiles/keycloak/che/login/resources/img/che-logo.svg similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/login/resources/img/che-logo.svg rename to dockerfiles/keycloak/che/login/resources/img/che-logo.svg diff --git a/dockerfiles/init/modules/keycloak/files/che/login/resources/img/favicon.ico b/dockerfiles/keycloak/che/login/resources/img/favicon.ico similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/login/resources/img/favicon.ico rename to dockerfiles/keycloak/che/login/resources/img/favicon.ico diff --git a/dockerfiles/init/modules/keycloak/files/che/login/theme.properties b/dockerfiles/keycloak/che/login/theme.properties similarity index 100% rename from dockerfiles/init/modules/keycloak/files/che/login/theme.properties rename to dockerfiles/keycloak/che/login/theme.properties diff --git a/dockerfiles/init/modules/keycloak/templates/master-realm.json.erb b/dockerfiles/keycloak/master-realm.json.erb similarity index 100% rename from dockerfiles/init/modules/keycloak/templates/master-realm.json.erb rename to dockerfiles/keycloak/master-realm.json.erb diff --git a/dockerfiles/init/modules/keycloak/templates/master-users-0.json.erb b/dockerfiles/keycloak/master-users-0.json.erb similarity index 100% rename from dockerfiles/init/modules/keycloak/templates/master-users-0.json.erb rename to dockerfiles/keycloak/master-users-0.json.erb diff --git a/dockerfiles/lib/.babelrc b/dockerfiles/lib/.babelrc deleted file mode 100644 index c13c5f627fd1..000000000000 --- a/dockerfiles/lib/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["es2015"] -} diff --git a/dockerfiles/lib/.dockerignore b/dockerfiles/lib/.dockerignore deleted file mode 100644 index 3c3629e647f5..000000000000 --- a/dockerfiles/lib/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/dockerfiles/lib/.gitignore b/dockerfiles/lib/.gitignore deleted file mode 100644 index 48353aed95e5..000000000000 --- a/dockerfiles/lib/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -lib -node_modules -npm-debug.log -src/api/dto/che-dto.ts -src/typings -coverage diff --git a/dockerfiles/lib/Dockerfile b/dockerfiles/lib/Dockerfile deleted file mode 100644 index 5982571048ba..000000000000 --- a/dockerfiles/lib/Dockerfile +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2017 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 -# -# build: -# docker build -t eclipse/che-lib . -# -# use: -# docker run -v /var/run/docker.sock:/var/run/docker.sock eclipse/che-lib [command] - -FROM mhart/alpine-node:6 - -ENV DOCKER_BUCKET=get.docker.com \ - DOCKER_VERSION=1.6.0 - -RUN set -x \ - && apk add --no-cache \ - ca-certificates \ - curl \ - openssl \ - && curl -sL "https://${DOCKER_BUCKET}/builds/Linux/x86_64/docker-$DOCKER_VERSION" \ - > /usr/bin/docker; chmod +x /usr/bin/docker \ - && apk del curl ca-certificates openssl - -COPY runtime-dependencies/package.json /runtime/ -COPY . /lib-typescript/ - -RUN cd /lib-typescript/ && npm install && npm test \ - && cd /runtime && npm install && /lib-typescript/node_modules/.bin/tsc --project /lib-typescript/ \ - && mv /lib-typescript/lib /che-lib && cd /lib-typescript/src && find . -name "*.properties" -exec install -D {} /che-lib/{} \;\ - && rm -rf /lib-typescript && mv /runtime/node_modules /che-lib && rm -rf /runtime diff --git a/dockerfiles/lib/Dockerfile.dev b/dockerfiles/lib/Dockerfile.dev deleted file mode 100644 index ca9e92585745..000000000000 --- a/dockerfiles/lib/Dockerfile.dev +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2017 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 implementation -# - -FROM mhart/alpine-node:6 - -ENV DOCKER_BUCKET=get.docker.com \ - DOCKER_VERSION=1.6.0 - -COPY package.json /compile/ -COPY runtime-dependencies/package.json /runtime/ -RUN set -x \ - && apk add --no-cache \ - ca-certificates \ - curl \ - openssl \ - && curl -sL "https://${DOCKER_BUCKET}/builds/Linux/x86_64/docker-$DOCKER_VERSION" \ - > /usr/bin/docker; chmod +x /usr/bin/docker \ - && apk del curl ca-certificates openssl \ - && cd /compile && npm install && cd /runtime && npm install \ - && mkdir /lib-typescript && mv /compile/node_modules /lib-typescript/ -COPY . /lib-typescript/ -RUN /lib-typescript/node_modules/.bin/tsc --project /lib-typescript/ && mv /lib-typescript/lib /che-lib \ - && cd /lib-typescript/src && find . -name "*.properties" -exec install -D {} /che-lib/{} \;\ - && rm -rf /lib-typescript && mv /runtime/node_modules /che-lib && rm -rf /runtime && rm -rf /compile diff --git a/dockerfiles/lib/README.md b/dockerfiles/lib/README.md deleted file mode 100644 index 4f373efaa1f9..000000000000 --- a/dockerfiles/lib/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Typescript library used in some docker images like che-dir, che-action and che-test - - -Steps to build the docker image: - -``` -$ build.sh -``` \ No newline at end of file diff --git a/dockerfiles/lib/build.sh b/dockerfiles/lib/build.sh deleted file mode 100755 index e55d8aa64e50..000000000000 --- a/dockerfiles/lib/build.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2017 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 - -DIR=$(cd "$(dirname "$0")"; pwd) - -generate_dto() { - echo "Checking DTO" - - # if file already exists and in snapshot mode - POM_VERSION=$(cat "${DIR}"/dto-pom.xml | grep "^ .*$" | awk -F'[><]' '{print $3}') - if [ -e "${DIR}/src/api/dto/che-dto.ts" ]; then - # DTO file exists, Do we have snapshot ? - if [[ ${POM_VERSION} != *"SNAPSHOT"* ]] - then - if [ ${DIR}/src/api/dto/che-dto.ts -nt ${DIR}/dto-pom.xml ]; then - echo "Using tagged version and dto file is up-to-date. Not generating it." - return - else - echo "Using tagged version but DTO file is older than dto-pom.xml file. Need to generate again." - fi - else - echo "Snapshot version is used in pom.xml. Generating again pom.xml"; - fi - fi - - DTO_CONTENT=$(cd "${DIR}" && docker run -i --rm -v "$HOME/.m2:/root/.m2" -v "$PWD"/dto-pom.xml:/usr/src/mymaven/pom.xml -w /usr/src/mymaven maven:3.3-jdk-8 /bin/bash -c "mvn -q -U -DskipTests=true -Dfindbugs.skip=true -Dskip-validate-sources install && cat target/dto-typescript.ts") - - # Check if maven command has worked or not - if [ $? -eq 0 ]; then - # Create directory if it doesn't exist - if [ ! -d "${DIR}/src/api/dto" ]; then - mkdir ${DIR}/src/api/dto - fi - echo 'DTO has been generated' - echo "${DTO_CONTENT}" > "${DIR}"/src/api/dto/che-dto.ts - else - echo "Failure when generating DTO. Error was ${DTO_CONTENT}" - exit 1 - fi -} - - -native_build() { - ./node_modules/typescript/bin/tsc --project . -} - -init --name:lib "$@" -generate_dto - -DIR=$(cd "$(dirname "$0")"; pwd) -echo "Building Docker Image ${IMAGE_NAME} from $DIR directory" -cd "${DIR}" && docker build -t ${IMAGE_NAME} . -if [ $? -eq 0 ]; then - printf "${GREEN}Script run successfully: ${BLUE}${IMAGE_NAME}${NC}\n" -else - printf "${RED}Failure when building docker image ${IMAGE_NAME}${NC}\n" - exit 1 -fi diff --git a/dockerfiles/lib/dto-pom.xml b/dockerfiles/lib/dto-pom.xml deleted file mode 100644 index 16dad1a21f34..000000000000 --- a/dockerfiles/lib/dto-pom.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - 4.0.0 - - maven-depmgt-pom - org.eclipse.che.depmgt - 7.0.0-SNAPSHOT - - dto-typescript - pom - Che TypeScript DTO - - 7.0.0-SNAPSHOT - - - - ossrh - central public releases - https://oss.sonatype.org/content/repositories/releases/ - - - ossrh-snapshots - central public snapshots - https://oss.sonatype.org/content/repositories/snapshots/ - - - - - codenvy-public-repo - ossrh releases - https://oss.sonatype.org/content/repositories/releases/ - - - ossrh-snapshots - ossrh snapshots - https://oss.sonatype.org/content/repositories/snapshots/ - - - - - - org.eclipse.che.core - che-core-typescript-dto-maven-plugin - ${che.version} - - - - build - - - - - - org.eclipse.che.core - che-core-api-installer-shared - ${che.version} - - - org.eclipse.che.core - che-core-api-debug-shared - ${che.version} - - - org.eclipse.che.core - che-core-api-factory-shared - ${che.version} - - - org.eclipse.che.core - che-core-api-git-shared - ${che.version} - - - org.eclipse.che.core - che-core-api-project-shared - ${che.version} - - - org.eclipse.che.core - che-core-api-project-templates-shared - ${che.version} - - - org.eclipse.che.core - che-core-api-ssh-shared - ${che.version} - - - org.eclipse.che.core - che-core-api-system-shared - ${che.version} - - - org.eclipse.che.core - che-core-api-user-shared - ${che.version} - - - org.eclipse.che.core - che-core-api-workspace-shared - ${che.version} - - - - false - - - - - diff --git a/dockerfiles/lib/package.json b/dockerfiles/lib/package.json deleted file mode 100644 index f0c38ec8c5e0..000000000000 --- a/dockerfiles/lib/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "che-cli-library", - "version": "1.0.0", - "description": "CLI library used in dockerfiles", - "main": "lib/index.js", - "author": "Florent Benoit", - "license": "EPL-1.0", - "scripts": { - "prepublish": "./node_modules/.bin/tsc", - "pretest": "./node_modules/.bin/tsc --outDir test --target es6 src/**/*.spec.ts src/**/**/*.spec.ts", - "coverage": "./node_modules/.bin/istanbul --include-all-sources cover node_modules/.bin/_mocha -- -R spec test/*.spec.js && ./node_modules/.bin/remap-istanbul -i coverage/coverage.json -o coverage/html -t html && open coverage/html/index.html", - "test": "./node_modules/.bin/mocha --compilers js:babel-register --require babel-polyfill --recursive" - }, - "dependencies": { - "reflect-metadata": "^0.1.8", - "websocket": "1.0.23" - }, - "devDependencies": { - "babel": "^6.5.2", - "babel-polyfill": "^6.16.0", - "@types/mocha": "^2.2.32", - "@types/node": "6.0.41", - "@types/reflect-metadata": "0.0.4", - "babel": "^6.5.2", - "babel-preset-es2015": "^6.16.0", - "babel-register": "^6.16.3", - "chai": "^3.4.33", - "istanbul": "^0.4.5", - "mocha": "^2.2.32", - "remap-istanbul": "^0.6.4", - "typescript": "2.1.4" - } -} diff --git a/dockerfiles/lib/runtime-dependencies/package.json b/dockerfiles/lib/runtime-dependencies/package.json deleted file mode 100644 index 217fd1f81b91..000000000000 --- a/dockerfiles/lib/runtime-dependencies/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "che-typescript", - "version": "1.0.0", - "description": "TypeScript library used in dockerfiles", - "main": "lib/index.js", - "author": "Florent Benoit", - "license": "EPL-1.0", - "devDependencies": { - "reflect-metadata": "^0.1.8", - "websocket": "1.0.23" - } -} diff --git a/dockerfiles/lib/src/api/exec-agent/exec-agent-service-client.ts b/dockerfiles/lib/src/api/exec-agent/exec-agent-service-client.ts deleted file mode 100644 index 15bc0335380f..000000000000 --- a/dockerfiles/lib/src/api/exec-agent/exec-agent-service-client.ts +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import {ProcessTerminatedEventPromiseMessageBusSubscriber} from "./process-terminated-event-promise-subscriber"; -import {AuthData} from "../wsmaster/auth/auth-data"; -import {Websocket} from "../../spi/websocket/websocket"; -import {Workspace} from "../wsmaster/workspace/workspace"; -import {CheFileStructWorkspaceCommand} from "../../internal/dir/chefile-struct/che-file-struct"; -import {JsonRpcBus} from "../../spi/websocket/json-rpc-bus"; -import {ProcessAckPromiseMessageBusSubscriber} from "./process-ack-event-promise-subscriber"; -import {ServerLocation} from "../../utils/server-location"; - -/** - * Exec Agent service allowing to start/stop processes - * @author Florent Benoit - */ -export class ExecAgentServiceClientImpl { - - /** - * Authentication data - */ - authData : AuthData; - - /** - * websocket. - */ - websocket : Websocket; - - workspace : Workspace; - - /** - * Location of exec agent server - */ - serverURL: string; - - constructor(workspace : Workspace, authData : AuthData, serverURL : string) { - this.workspace = workspace; - this.authData = authData; - this.serverURL = serverURL; - this.websocket = new Websocket(); - } - - getJsonRpcBus(): Promise { - return this.websocket.getJsonRpcBus(this.serverURL + '?token=' + this.authData.getToken()); - } - - /** - * Create a workspace and return a promise with content of WorkspaceDto in case of success - */ - executeCommand(cheFileStructWorkspaceCommand:CheFileStructWorkspaceCommand, - uuid:string, - asynchronous : boolean = true):Promise { - - let rpcCommand: any = - { - "jsonrpc": "2.0", - "method": "process.start", - "id": uuid, - "params": { - "commandLine": cheFileStructWorkspaceCommand.commandLine, - "name": !cheFileStructWorkspaceCommand.name ? "custom-command" : cheFileStructWorkspaceCommand.name, - "type": !cheFileStructWorkspaceCommand.type ? "custom" : cheFileStructWorkspaceCommand.type - } - }; - - // get JSON RPC Bus - let processTerminatedEventPromiseMessageBusSubscriber : ProcessTerminatedEventPromiseMessageBusSubscriber; - let userJsonRpcBus : JsonRpcBus; - return this.getJsonRpcBus().then((jsonRpcBus:JsonRpcBus) => { - userJsonRpcBus = jsonRpcBus; - processTerminatedEventPromiseMessageBusSubscriber = new ProcessTerminatedEventPromiseMessageBusSubscriber(jsonRpcBus); - let processAckPromiseMessageBusSubscriber : ProcessAckPromiseMessageBusSubscriber = new ProcessAckPromiseMessageBusSubscriber(uuid, jsonRpcBus, asynchronous, processTerminatedEventPromiseMessageBusSubscriber); - jsonRpcBus.subscribe(processAckPromiseMessageBusSubscriber); - jsonRpcBus.send(rpcCommand); - return processAckPromiseMessageBusSubscriber.promise; - }).then(() => { - // subscribe to pid event end - if (asynchronous) { - return processTerminatedEventPromiseMessageBusSubscriber.promise; - } else { - // do not wait the end - userJsonRpcBus.close(); - return Promise.resolve(true); - } - }).then(() => { - return true; - }); - - } - -} diff --git a/dockerfiles/lib/src/api/exec-agent/process-ack-event-promise-subscriber.ts b/dockerfiles/lib/src/api/exec-agent/process-ack-event-promise-subscriber.ts deleted file mode 100644 index 7bf286765411..000000000000 --- a/dockerfiles/lib/src/api/exec-agent/process-ack-event-promise-subscriber.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ - -import {MessageBusSubscriber} from "../../spi/websocket/messagebus-subscriber"; -import {ProcessTerminatedEventPromiseMessageBusSubscriber} from "./process-terminated-event-promise-subscriber"; -import {JsonRpcBus} from "../../spi/websocket/json-rpc-bus"; -import {ProcesLogOutputMessageBusSubscriber} from "./process-log-output-subscriber"; -import {Log} from "../../spi/log/log"; -/** - * Handle a promise that will be resolved when process/command is finished. - * If process has error, promise will be rejected - * @author Florent Benoit - */ -export class ProcessAckPromiseMessageBusSubscriber implements MessageBusSubscriber { - - resolve : any; - reject : any; - promise: Promise; - private id : string; - private processTerminatedEventPromiseMessageBusSubscriber : ProcessTerminatedEventPromiseMessageBusSubscriber; - private asynchronous : boolean; - private jsonRpcBus : JsonRpcBus; - - constructor(id: string, jsonRpcBus : JsonRpcBus, asynchronous : boolean, processTerminatedEventPromiseMessageBusSubscriber : ProcessTerminatedEventPromiseMessageBusSubscriber) { - this.id = id; - this.jsonRpcBus = jsonRpcBus; - this.asynchronous = asynchronous; - this.processTerminatedEventPromiseMessageBusSubscriber = processTerminatedEventPromiseMessageBusSubscriber; - this.promise = new Promise((resolve, reject) => { - this.resolve = resolve; - this.reject = reject; - }); - } - - handleMessage(event: any) { - if (event.id && event.id === this.id) { - if (event.result) { - this.processTerminatedEventPromiseMessageBusSubscriber.setPid(event.result.pid); - // subscribe to websocket - if (this.asynchronous) { - this.jsonRpcBus.subscribe(new ProcesLogOutputMessageBusSubscriber(event.result.pid)); - this.jsonRpcBus.subscribe(this.processTerminatedEventPromiseMessageBusSubscriber); - } - this.resolve(true); - } else if (event.error) { - this.reject(event.error); - } - } - } - -} diff --git a/dockerfiles/lib/src/api/exec-agent/process-log-output-subscriber.ts b/dockerfiles/lib/src/api/exec-agent/process-log-output-subscriber.ts deleted file mode 100644 index 1ef3bce0c155..000000000000 --- a/dockerfiles/lib/src/api/exec-agent/process-log-output-subscriber.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ - -import {MessageBusSubscriber} from "../../spi/websocket/messagebus-subscriber"; -import {Log} from "../../spi/log/log"; -/** - * Class that will display to console all process output messages. - * @author Florent Benoit - */ -export class ProcesLogOutputMessageBusSubscriber implements MessageBusSubscriber { - - private id : string; - - - constructor(id : string) { - this.id = id; - } - - handleMessage(event: any) { - if (event.params && event.params.pid === this.id) { - if (event.method === "process_stdout") { - console.log(Log.GREEN + event.params.text + Log.NC); - } else if (event.method === "process_stderr") { - console.log(Log.RED + event.params.text + Log.NC); - } - } - } -} diff --git a/dockerfiles/lib/src/api/exec-agent/process-terminated-event-promise-subscriber.ts b/dockerfiles/lib/src/api/exec-agent/process-terminated-event-promise-subscriber.ts deleted file mode 100644 index a7f0e0646837..000000000000 --- a/dockerfiles/lib/src/api/exec-agent/process-terminated-event-promise-subscriber.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ - -import {MessageBusSubscriber} from "../../spi/websocket/messagebus-subscriber"; -import {Log} from "../../spi/log/log"; -import {JsonRpcBus} from "../../spi/websocket/json-rpc-bus"; -/** - * Handle a promise that will be resolved when process/command is finished. - * If process has error, promise will be rejected - * @author Florent Benoit - */ -export class ProcessTerminatedEventPromiseMessageBusSubscriber implements MessageBusSubscriber { - - resolve : any; - reject : any; - promise: Promise; - private pid : number; - private jsonRpcBus; - - constructor(jsonRpcBus : JsonRpcBus) { - this.jsonRpcBus = jsonRpcBus; - this.promise = new Promise((resolve, reject) => { - this.resolve = resolve; - this.reject = reject; - }); - } - - handleMessage(event: any) { - if (this.pid) { - if ('process_died' === event.method && event.params && event.params.pid === this.pid) { - this.jsonRpcBus.close(); - this.resolve(true); - } - } - } - - setPid(pid : number) { - this.pid = pid; - } - -} diff --git a/dockerfiles/lib/src/api/wsmaster/auth/auth-data.ts b/dockerfiles/lib/src/api/wsmaster/auth/auth-data.ts deleted file mode 100644 index f85752d3fb71..000000000000 --- a/dockerfiles/lib/src/api/wsmaster/auth/auth-data.ts +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ - -import {RemoteIp} from "../../../spi/docker/remoteip"; -import {Log} from "../../../spi/log/log"; -import {ServerLocation} from "../../../utils/server-location"; -import {error} from "util"; -import {WsMasterLocation} from "../wsmaster-location"; - -/** - * Defines a way to store the WS master location and the auth data in order to deal with remote REST or Websocket API - * @author Florent Benoit - * @author Oleksandr Garagatyi - */ -export class AuthData { - - - private DEFAULT_TOKEN : string = ''; - private DEFAULT_HOSTNAME : string = new RemoteIp().getIp(); - private DEFAULT_MULTI_USER_PORT : number = 5050; - - printInfo : boolean = true; - - private token : string; - private authServerLocation: ServerLocation; - private username: string; - private password: string; - private authType: AUTH_TYPE; - private wsMasterLocation: ServerLocation; - - constructor(cheMasterLocation?: string, username?: string, password?: string) { - - this.username = username; - this.password = password; - this.token = this.DEFAULT_TOKEN; - this.wsMasterLocation = new WsMasterLocation(cheMasterLocation); - - // autodetect auth type - if (!username && !password) { - this.authType = AUTH_TYPE.NO; - } else if (process.env.CHE_MULTIUSER) { - this.authType = AUTH_TYPE.KEYCLOAK; - let authServer: string = process.env.CHE_KEYCLOAK_AUTH_SERVER_URL; - if (authServer) { - this.authServerLocation = ServerLocation.parse(authServer); - } else { - this.authServerLocation = new ServerLocation(this.DEFAULT_HOSTNAME, this.DEFAULT_MULTI_USER_PORT, false); - } - } else { - this.authType = AUTH_TYPE.CODENVY_SSO; - this.authServerLocation = this.wsMasterLocation; - } - } - - getToken() : string { - return this.token; - } - - getAuthorizationHeaderValue(): string { - if (this.authType == AUTH_TYPE.KEYCLOAK) { - return 'Bearer ' + this.token; - } else { - return this.token; - } - } - - getMasterLocation(): ServerLocation { - return this.wsMasterLocation; - } - - login() : Promise { - - if (this.authType == AUTH_TYPE.NO) { - return this.noLogin(); - } - - let http: any; - let securedOrNot: string; - if (this.authServerLocation.isSecure()) { - http = require('https'); - securedOrNot = ' using SSL.'; - } else { - http = require('http'); - securedOrNot = '.'; - } - - let logMessage: string = 'Authenticating '; - if (this.username && this.password) { - logMessage += 'as ' + this.username; - } - - if (this.printInfo) { - Log.getLogger().info(logMessage, 'on \"' + this.authServerLocation.getHostname() + ':' + this.authServerLocation.getPort() + '\"' + securedOrNot); - } - - switch (this.authType) { - case AUTH_TYPE.KEYCLOAK: - return this.keyCloakLogin(http); - case AUTH_TYPE.CODENVY_SSO: - return this.ssoLogin(http); - default: - error('Che authentication type ' + this.authType + ' is illegal'); - } - } - - private ssoLogin(http) : Promise { - return new Promise((resolve, reject) => { - let options = { - hostname: this.authServerLocation.getHostname(), - port: this.authServerLocation.getPort(), - path: '/api/auth/login', - method: 'POST', - headers: { - 'Accept': 'application/json, text/plain, */*', - 'Content-Type': 'application/json;charset=UTF-8' - } - }; - let req = http.request(options, (res) => { - res.on('data', (body) => { - if (res.statusCode == 200) { - // token get, continue - this.token = JSON.parse(body).value; - resolve(true); - } else { - // error - reject(body); - } - }); - - }); - - req.on('error', (err) => { - reject('HTTP error: ' + err); - }); - - const auth = { - "username": this.username, - "password": this.password - }; - - req.write(JSON.stringify(auth)); - req.end(); - - }); - } - - private keyCloakLogin(http) : Promise { - return new Promise((resolve, reject) => { - let options = { - hostname: this.authServerLocation.getHostname(), - port: this.authServerLocation.getPort(), - path: '/auth/realms/che/protocol/openid-connect/token', - method: 'POST', - headers: { - 'Accept': 'application/json, text/plain, */*', - 'Content-Type': 'application/x-www-form-urlencoded' - } - }; - let req = http.request(options, (res) => { - res.on('data', (body) => { - if (res.statusCode == 200) { - // token get, continue - this.token = JSON.parse(body).access_token; - resolve(true); - } else { - // error - reject(body); - } - }); - - }); - - req.on('error', (err) => { - reject('HTTP error: ' + err); - }); - - const auth = { - "username": this.username, - "password": this.password, - "grant_type": "password", - "client_id": "che-public" - - }; - let querystring = require('querystring'); - req.write(querystring.stringify(auth)); - req.end(); - }); - } - - private noLogin() : Promise { - return new Promise((resolve) => { - resolve(true); - }); - } -} - -enum AUTH_TYPE { - KEYCLOAK, - CODENVY_SSO, - NO -} diff --git a/dockerfiles/lib/src/api/wsmaster/permissions/dto/domaindto.ts b/dockerfiles/lib/src/api/wsmaster/permissions/dto/domaindto.ts deleted file mode 100644 index 2eef1a7d63f8..000000000000 --- a/dockerfiles/lib/src/api/wsmaster/permissions/dto/domaindto.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 class DomainDto { - - content: any; - - - constructor(domainObject: any) { - this.content = domainObject; - } - - getContent() : any { - return this.content; - } -} diff --git a/dockerfiles/lib/src/api/wsmaster/permissions/dto/permissiondto.ts b/dockerfiles/lib/src/api/wsmaster/permissions/dto/permissiondto.ts deleted file mode 100644 index 193274ffe096..000000000000 --- a/dockerfiles/lib/src/api/wsmaster/permissions/dto/permissiondto.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 class PermissionDto { - - content: any; - - - constructor(permissionObject: any) { - this.content = permissionObject; - } - - getContent() : any { - return this.content; - } -} diff --git a/dockerfiles/lib/src/api/wsmaster/permissions/permissions.ts b/dockerfiles/lib/src/api/wsmaster/permissions/permissions.ts deleted file mode 100644 index 378841d38ff0..000000000000 --- a/dockerfiles/lib/src/api/wsmaster/permissions/permissions.ts +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import {AuthData} from "../auth/auth-data"; -import {DomainDto} from "./dto/domaindto"; -import {HttpJsonRequest} from "../../../spi/http/default-http-json-request"; -import {DefaultHttpJsonRequest} from "../../../spi/http/default-http-json-request"; -import {HttpJsonResponse} from "../../../spi/http/default-http-json-request"; -import {PermissionDto} from "./dto/permissiondto"; -/** - * Defines communication with remote Permissions API - * @author Florent Benoit - */ -export class Permissions { - - /** - * Authentication data - */ - authData:AuthData; - - constructor(authData:AuthData) { - this.authData = authData; - } - - - /** - * list all permissions - */ - listPermissions():Promise> { - - let jsonRequest: HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, null, '/api/permissions', 200); - return jsonRequest.request().then((jsonResponse:HttpJsonResponse) => { - let domainsDto:Array = []; - JSON.parse(jsonResponse.getData()).forEach((entry)=> { - domainsDto.push(new DomainDto(entry)); - }); - return domainsDto; - }); - } - - - /** - * get permissions for a given domain - */ - getPermission(domain:string):Promise { - - let jsonRequest: HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, null, '/api/permissions/' + domain, 200); - return jsonRequest.request().then((jsonResponse:HttpJsonResponse) => { - return new PermissionDto(JSON.parse(jsonResponse.getData())); - }, () => { - return new PermissionDto({}); - }); - } - - updatePermissions(permissionDto:PermissionDto) { - let jsonRequest: HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, null, '/api/permissions', 204); - return jsonRequest.setMethod('POST').setBody(permissionDto.getContent()).request().then((jsonResponse:HttpJsonResponse) => { - return new PermissionDto(jsonResponse.getData()); - }); - } - - - copyCurrentPermissionsToUser(newUserId:string):Promise { - return this.listPermissions().then( - (domainsDto:Array) => { - let adminPermissionsPromises:Array> = []; - domainsDto.forEach((domain) => { - adminPermissionsPromises.push(this.getPermission(domain.getContent().id)); - }); - return Promise.all(adminPermissionsPromises); - } - ).then((adminsPermissions:Array) => { - - let updatedPermissionsPromises:Array> = []; - adminsPermissions.forEach((adminPermission:PermissionDto)=> { - if (adminPermission.getContent().domain) { - // we replace the user by the new user - adminPermission.getContent().user = newUserId; - // update permissions - updatedPermissionsPromises.push(this.updatePermissions(adminPermission).then((updatedDto)=> { - return updatedDto; - })); - } - - }); - - return Promise.all(updatedPermissionsPromises); - }).then(() => { - return true; - }); - } -} diff --git a/dockerfiles/lib/src/api/wsmaster/project/project.ts b/dockerfiles/lib/src/api/wsmaster/project/project.ts deleted file mode 100644 index ae17d7a386f7..000000000000 --- a/dockerfiles/lib/src/api/wsmaster/project/project.ts +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import {org} from "../../../api/dto/che-dto" -import {AuthData} from "../auth/auth-data"; -import {Log} from "../../../spi/log/log"; -import {HttpJsonRequest} from "../../../spi/http/default-http-json-request"; -import {DefaultHttpJsonRequest} from "../../../spi/http/default-http-json-request"; -import {HttpJsonResponse} from "../../../spi/http/default-http-json-request"; -import {Url} from "url"; -import {ServerLocation} from "../../../utils/server-location"; -import {RemoteIp} from "../../../spi/docker/remoteip"; - -/** - * Project class allowing to manage a project like updating project-type. - * @author Florent Benoit - */ -export class Project { - - /** - * Authentication data - */ - authData : AuthData; - - /** - * Workspace DTO - */ - workspaceDTO : org.eclipse.che.api.workspace.shared.dto.WorkspaceDto; - - /** - * Path to the workspace agent - */ - wsAgentPath : string; - - /** - * Object that describes location of ws-agent server - */ - wsAgentServer: ServerLocation; - - constructor(workspaceDTO: org.eclipse.che.api.workspace.shared.dto.WorkspaceDto, authData : AuthData) { - this.workspaceDTO = workspaceDTO; - this.authData = authData; - - // search the workspace agent link - let machines : Map = this.workspaceDTO.getRuntime().getMachines(); - - var hrefWsAgent : string; - for (let machine of machines.values()) { - hrefWsAgent = machine.getServers().get("wsagent/http").getUrl(); - } - - if (!hrefWsAgent) { - throw new Error('unable to find the workspace agent link from workspace :' + workspaceDTO.getConfig().getName() + " with JSON " + workspaceDTO.toJson()); - } - - if (hrefWsAgent.includes("localhost")) { - hrefWsAgent = hrefWsAgent.replace("localhost", RemoteIp.ip) - } - - this.wsAgentServer = ServerLocation.parse(hrefWsAgent); - - this.wsAgentPath = require('url').parse(hrefWsAgent).path; - } - - /** - * Get project details for a given project name - */ - getProject(projectName) : Promise { - - var jsonRequest:HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, this.wsAgentServer, this.wsAgentPath + '/project/' + projectName, 200); - return jsonRequest.request().then((jsonResponse:HttpJsonResponse) => { - return jsonResponse.asDto(org.eclipse.che.api.workspace.shared.dto.ProjectConfigDtoImpl); - }); - } - - /** - * Updates the given project with the provided project Type - * @param projectType the type of the project that we want to set - * @param projectDTO a DTO containing all attributes to set as new attributes - * @return a promise with the updated Project DTO - */ - updateType(projectName, projectType) : Promise { - // first get project attributes - return this.getProject(projectName).then((projectDto) => { - // then update the project type - projectDto.setType(projectType); - - // and perform update of all these attributes - return this.update(projectName, projectDto); - }) - - } - - /** - */ - estimateType(projectName, projectType) : Promise { - var jsonRequest:HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, this.wsAgentServer, this.wsAgentPath + '/project/estimate/' + projectName + '?type=' + projectType, 200); - return jsonRequest.request().then((jsonResponse:HttpJsonResponse) => { - return jsonResponse.asDto(org.eclipse.che.api.project.shared.dto.SourceEstimationImpl); - }); - - } - - /** - * Updates the given project with the provided DTO - * @param projectName the name of the project that will be updated - * @param projectDTO a DTO containing all attributes to set as new attributes - * @return a promise with the updated Project DTO - */ - update(projectName: string, projectDto: org.eclipse.che.api.workspace.shared.dto.ProjectConfigDto): Promise { - - var jsonRequest:HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, this.wsAgentServer, this.wsAgentPath + '/project/' + projectName, 200).setMethod("PUT").setBody(projectDto); - return jsonRequest.request().then((jsonResponse:HttpJsonResponse) => { - return jsonResponse.asDto(org.eclipse.che.api.workspace.shared.dto.ProjectConfigDtoImpl); - }); - } - - - /** - * - * @param projectName - * @param sourceStorageDto - * @returns {Promise} - */ - importProject(projectName: string, sourceStorageDto : org.eclipse.che.api.workspace.shared.dto.SourceStorageDto) : Promise { - - var jsonRequest:HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, this.wsAgentServer, this.wsAgentPath + '/project/import/' + projectName, 204).setMethod("POST").setBody(sourceStorageDto); - return jsonRequest.request().then((jsonResponse:HttpJsonResponse) => { - return; - }); - } - - -} diff --git a/dockerfiles/lib/src/api/wsmaster/ssh/ssh.ts b/dockerfiles/lib/src/api/wsmaster/ssh/ssh.ts deleted file mode 100644 index d8704b246760..000000000000 --- a/dockerfiles/lib/src/api/wsmaster/ssh/ssh.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2016-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 - */ - -import {org} from "../../dto/che-dto" -import {AuthData} from "../auth/auth-data"; -import {HttpJsonRequest} from "../../../spi/http/default-http-json-request"; -import {DefaultHttpJsonRequest} from "../../../spi/http/default-http-json-request"; -import {HttpJsonResponse} from "../../../spi/http/default-http-json-request"; - -/** - * SSh class allowing to manage all ssh operations - * @author Florent Benoit - */ -export class Ssh { - - /** - * Authentication data - */ - authData:AuthData; - - constructor(authData:AuthData) { - this.authData = authData; - } - - - /** - * Gets ssh pair by service and name. - * - * @param service - * service name of ssh pair - * @param name - * name of ssh pair - * @return instance of ssh pair - * @throws NotFoundException - * when ssh pair is not found - * @throws ServerException - * when any other error occurs during ssh pair fetching - */ - getPair(service: string, name: string):Promise { - let jsonRequest: HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, null, '/api/ssh/' + service + '/find?name=' + name, 200); - return jsonRequest.request().then((jsonResponse:HttpJsonResponse) => { - return jsonResponse.asDto(org.eclipse.che.api.ssh.shared.dto.SshPairDtoImpl); - }); - } - -} diff --git a/dockerfiles/lib/src/api/wsmaster/system/system-stop-event-promise-subscriber.ts b/dockerfiles/lib/src/api/wsmaster/system/system-stop-event-promise-subscriber.ts deleted file mode 100644 index a73e452a005d..000000000000 --- a/dockerfiles/lib/src/api/wsmaster/system/system-stop-event-promise-subscriber.ts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ - -import {org} from "../../../api/dto/che-dto" -import {MessageBusSubscriber} from "../../../spi/websocket/messagebus-subscriber"; -import {JsonRpcBus} from "../../../spi/websocket/json-rpc-bus"; -import {Log} from "../../../spi/log/log"; -/** - * Handle a promise that will be resolved when system is stopped. - * If system has error, promise will be rejected - * @author Florent Benoit - */ -export class SystemStopEventPromiseMessageBusSubscriber implements MessageBusSubscriber { - - /** - * Bus used to collect events - */ - messageBus : JsonRpcBus; - - /** - * Resolve method to call when we're ready to shutdown the system. - */ - resolve : any; - - /** - * Reject method on the promise if we need to abort the current process. - */ - reject : any; - - /** - * The promise used to defer the resolution. - */ - promise: Promise; - - constructor(messageBus : JsonRpcBus) { - this.messageBus = messageBus; - this.promise = new Promise((resolve, reject) => { - this.resolve = resolve; - this.reject = reject; - }); - } - - handleMessage(message: any) { - // Ready to shutdown, it means we have finished the graceful stop and we can resolve the promise - if ('READY_TO_SHUTDOWN' === message.params.status) { - this.resolve(); - this.messageBus.close(); - } else if ('ERROR' === message.params.status) { - try { - let stringify: any = JSON.stringify(message); - this.reject('Error when stopping the system ' + stringify); - } catch (error) { - this.reject('Error when stopping the system ' + message.toString()); - } - this.messageBus.close(); - } else { - // Changing the status, displaying it to the user - Log.getLogger().info("System going into status '" + message.params.status + "' (was '" + message.prevStatus + "')"); - } - - } - -} diff --git a/dockerfiles/lib/src/api/wsmaster/system/system.ts b/dockerfiles/lib/src/api/wsmaster/system/system.ts deleted file mode 100644 index 7bea4d0c5bfd..000000000000 --- a/dockerfiles/lib/src/api/wsmaster/system/system.ts +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ - -import {org} from "../../dto/che-dto" -import {AuthData} from "../auth/auth-data"; -import {Websocket} from "../../../spi/websocket/websocket"; -import {HttpJsonRequest} from "../../../spi/http/default-http-json-request"; -import {DefaultHttpJsonRequest} from "../../../spi/http/default-http-json-request"; -import {HttpJsonResponse} from "../../../spi/http/default-http-json-request"; -import {JsonRpcBus} from "../../../spi/websocket/json-rpc-bus"; -import {SystemStopEventPromiseMessageBusSubscriber} from "./system-stop-event-promise-subscriber"; - -/** - * System class allowing to get state of system and perform graceful stop, etc. - * @author Florent Benoit - */ -export class System { - - /** - * Authentication data - */ - authData:AuthData; - - /** - * websocket. - */ - websocket:Websocket; - - constructor(authData:AuthData) { - this.authData = authData; - this.websocket = new Websocket(); - } - - /** - * Get state of the system - */ - getState():Promise { - let jsonRequest: HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, null, '/api/system/state', 200); - return jsonRequest.request().then((jsonResponse:HttpJsonResponse) => { - return jsonResponse.asDto(org.eclipse.che.api.system.shared.dto.SystemStateDtoImpl); - }); - } - - /** - * Get the message bus for the given System state DTO. - * @param systemStateDto the current DTO - * @returns {Promise} - */ - getMessageBus(systemStateDto : org.eclipse.che.api.system.shared.dto.SystemStateDto): Promise { - - // get link for websocket - let websocketLink: string; - systemStateDto.getLinks().forEach(stateLink => { - if ('system.state.channel' === stateLink.getRel()) { - websocketLink = stateLink.getHref(); - } - }); - return this.websocket.getJsonRpcBus(websocketLink + '?token=' + this.authData.getToken()); - } - - - /** - * Stop the server and return a promise that will wait for the ready to shutdown event - */ - gracefulStop():Promise { - // get workspace DTO - return this.getState().then((systemStateDto: org.eclipse.che.api.system.shared.dto.SystemStateDto) => { - if ('READY_TO_SHUTDOWN' === systemStateDto.getStatus()) { - return this.readyTobeShutdown(systemStateDto); - } else if ('RUNNING' === systemStateDto.getStatus()) { - // call stop and wait - return this.shutdown(systemStateDto, true); - } else { - // only wait as stop has been called - return this.shutdown(systemStateDto, false); - } - }); - } - - - - /** - * In that case, system is already in a state ready to be shutdown so we do nothing - * @returns {Promise} - */ - readyTobeShutdown(currentSystemStateDto: org.eclipse.che.api.system.shared.dto.SystemStateDto) : Promise { - return Promise.resolve(currentSystemStateDto); - } - - /** - * We want or we're already in a shutdown process so we need to wait the end of the action - * @param systemStateDto the current state - * @param callStop if true, we need to call the stop action, else we only listen to the stop process event - * @returns {Promise} - */ - shutdown(systemStateDto: org.eclipse.che.api.system.shared.dto.SystemStateDto, callStop: boolean) : Promise { - let callbackSubscriber : SystemStopEventPromiseMessageBusSubscriber; - return this.getMessageBus(systemStateDto).then((messageBus: JsonRpcBus) => { - callbackSubscriber = new SystemStopEventPromiseMessageBusSubscriber(messageBus); - let channelToListen : string; - systemStateDto.getLinks().forEach(stateLink => { - if ('system.state.channel' === stateLink.getRel()) { - channelToListen = stateLink.getParameters()[0].getDefaultValue(); - } - }); - return messageBus.subscribeAsync(channelToListen, callbackSubscriber); - }).then((subscribed: string) => { - // to give some time for subscription request to finish, since - // it is no any response from the server for them - return this.delay(2000); - }).then(() => { - if (callStop) { - let jsonRequest: HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, null, '/api/system/stop', 204).setMethod('POST'); - return jsonRequest.request().then((jsonResponse: HttpJsonResponse) => { - return; - }).then(() => { - return callbackSubscriber.promise; - }).then(() => { - return this.getState(); - }); - } else { - return callbackSubscriber.promise.then(() => { - return this.getState(); - }); - } - }); - } - - delay(ms: number) : Promise { - return new Promise(function(resolve) { - setTimeout(resolve, ms); - }); - } - -} diff --git a/dockerfiles/lib/src/api/wsmaster/user/user.ts b/dockerfiles/lib/src/api/wsmaster/user/user.ts deleted file mode 100644 index 3823b14d6bf4..000000000000 --- a/dockerfiles/lib/src/api/wsmaster/user/user.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import {org} from "../../dto/che-dto" -import {AuthData} from "../auth/auth-data"; -import {HttpJsonRequest} from "../../../spi/http/default-http-json-request"; -import {DefaultHttpJsonRequest} from "../../../spi/http/default-http-json-request"; -import {HttpJsonResponse} from "../../../spi/http/default-http-json-request"; - -/** - * Defines communication with remote User API - * @author Florent Benoit - */ -export class User { - - /** - * Authentication data - */ - authData : AuthData; - - constructor(authData : AuthData) { - this.authData = authData; - } - - - /** - * Create a user and return a promise with content of UserDto in case of success - */ - createUser(name: string, email: string, password : string) : Promise { - - let userData = { - password: password, - name: name, - }; - - if (email) { - userData['email'] = email; - } - let jsonRequest: HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, null, '/api/user', 201).setMethod('POST').setBody(userData); - return jsonRequest.request().then((jsonResponse : HttpJsonResponse) => { - return jsonResponse.asDto(org.eclipse.che.api.user.shared.dto.UserDtoImpl); - }); - } - - - /** - * Removes user based on given user id - * @param userId the id (not email) of the user - * @returns {Promise} - */ - deleteUser(userId: string) : Promise { - let jsonRequest: HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, null, '/api/user/' + userId, 204).setMethod('DELETE'); - return jsonRequest.request().then((jsonResponse:HttpJsonResponse) => { - return true; - }); - } - - /** - * Search user by its username - * @param username the name of the user (not the id) - * @returns {Promise} - */ - findUserName(username : string) : Promise { - let jsonRequest: HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, null, '/api/user/find?name=' + username, 200); - return jsonRequest.request().then((jsonResponse:HttpJsonResponse) => { - return jsonResponse.asDto(org.eclipse.che.api.user.shared.dto.UserDtoImpl); - }); - } - - - - - -} diff --git a/dockerfiles/lib/src/api/wsmaster/workspace/workspace-log-output-subscriber.ts b/dockerfiles/lib/src/api/wsmaster/workspace/workspace-log-output-subscriber.ts deleted file mode 100644 index e87644d4a920..000000000000 --- a/dockerfiles/lib/src/api/wsmaster/workspace/workspace-log-output-subscriber.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ - - -import {MessageBusSubscriber} from "../../../spi/websocket/messagebus-subscriber"; -import {Log} from "../../../spi/log/log"; -/** - * Class that will display to console all workspace output messages. - * @author Florent Benoit - */ -export class WorkspaceDisplayOutputMessageBusSubscriber implements MessageBusSubscriber { - - handleMessage(message: any) { - try { - Log.getLogger().info(message.params.text); - } catch (error) { - // maybe parse data to add colors - Log.getLogger().info(message); - } - } - -} diff --git a/dockerfiles/lib/src/api/wsmaster/workspace/workspace-start-event-promise-subscriber.ts b/dockerfiles/lib/src/api/wsmaster/workspace/workspace-start-event-promise-subscriber.ts deleted file mode 100644 index 258d06f6c9fe..000000000000 --- a/dockerfiles/lib/src/api/wsmaster/workspace/workspace-start-event-promise-subscriber.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ - -import {org} from "../../../api/dto/che-dto" -import {MessageBusSubscriber} from "../../../spi/websocket/messagebus-subscriber"; -import {Log} from "../../../spi/log/log"; -import {JsonRpcBus} from "../../../spi/websocket/json-rpc-bus"; -/** - * Handle a promise that will be resolved when workspace is started. - * If workspace has error, promise will be rejected - * @author Florent Benoit - */ -export class WorkspaceStartEventPromiseMessageBusSubscriber implements MessageBusSubscriber { - - workspaceDto : org.eclipse.che.api.workspace.shared.dto.WorkspaceDto; - - resolve : any; - reject : any; - promise: Promise; - jsonRpcBus: JsonRpcBus; - - constructor(jsonRpcBus : JsonRpcBus, workspaceDto : org.eclipse.che.api.workspace.shared.dto.WorkspaceDto) { - this.jsonRpcBus = jsonRpcBus; - this.workspaceDto = workspaceDto; - this.promise = new Promise((resolve, reject) => { - this.resolve = resolve; - this.reject = reject; - }); - } - handleMessage(message: any) { - if (message.error) { - Log.getLogger().error('Error on workspace : ', message); - try { - let stringify: any = JSON.stringify(message); - this.reject('Error when starting the workspace' + stringify); - } catch (error) { - this.reject('Error when starting the workspace' + message.toString()); - } - - } - - if (message.method === 'workspace/statusChanged' && message.params.workspaceId === this.workspaceDto.getId()) { - if ('RUNNING' === message.params.status) { - this.jsonRpcBus.close(); - this.resolve(this.workspaceDto); - } else if ('ERROR' === message.params.status) { - try { - let stringify: any = JSON.stringify(message); - this.reject('Error when starting the workspace' + stringify); - } catch (error) { - this.reject('Error when starting the workspace' + message.toString()); - } - this.jsonRpcBus.close(); - } - } else { - Log.getLogger().debug('Event on workspace : ', message); - } - - } - -} diff --git a/dockerfiles/lib/src/api/wsmaster/workspace/workspace-stop-event-promise-subscriber.ts b/dockerfiles/lib/src/api/wsmaster/workspace/workspace-stop-event-promise-subscriber.ts deleted file mode 100644 index a1ff08a3213e..000000000000 --- a/dockerfiles/lib/src/api/wsmaster/workspace/workspace-stop-event-promise-subscriber.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import {org} from "../../../api/dto/che-dto" -import {MessageBusSubscriber} from "../../../spi/websocket/messagebus-subscriber"; -import {Log} from "../../../spi/log/log"; -import {JsonRpcBus} from "../../../spi/websocket/json-rpc-bus"; -/** - * Handle a promise that will be resolved when workspace is stopped. - * If workspace has error, promise will be rejected - * @author Florent Benoit - */ -export class WorkspaceStopEventPromiseMessageBusSubscriber implements MessageBusSubscriber { - - workspaceDto : org.eclipse.che.api.workspace.shared.dto.WorkspaceDto; - - resolve : any; - reject : any; - promise: Promise; - jsonRpcBus : JsonRpcBus; - - constructor(jsonRpcBus : JsonRpcBus, workspaceDto : org.eclipse.che.api.workspace.shared.dto.WorkspaceDto) { - this.jsonRpcBus = jsonRpcBus; - this.workspaceDto = workspaceDto; - this.promise = new Promise((resolve, reject) => { - this.resolve = resolve; - this.reject = reject; - }); - } - - handleMessage(message: any) { - if (message.error) { - Log.getLogger().error('Error on workspace : ', message); - try { - let stringify: any = JSON.stringify(message); - this.reject('Error when starting the workspace' + stringify); - } catch (error) { - this.reject('Error when starting the workspace' + message.toString()); - } - - } - - if (message.method === 'workspace/statusChanged' && message.params.workspaceId === this.workspaceDto.getId()) { - if ('STOPPED' === message.params.status) { - this.jsonRpcBus.close(); - this.resolve(this.workspaceDto); - } else if ('ERROR' === message.params.status) { - try { - let stringify: any = JSON.stringify(message); - this.reject('Error when stopping the workspace' + stringify); - } catch (error) { - this.reject('Error when stopping the workspace' + message.toString()); - } - this.jsonRpcBus.close(); - } - } else { - Log.getLogger().debug('Event on workspace : ', message.eventType); - } - - } - -} diff --git a/dockerfiles/lib/src/api/wsmaster/workspace/workspace.ts b/dockerfiles/lib/src/api/wsmaster/workspace/workspace.ts deleted file mode 100644 index f6ea7cadb363..000000000000 --- a/dockerfiles/lib/src/api/wsmaster/workspace/workspace.ts +++ /dev/null @@ -1,298 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ - -import {org} from "../../dto/che-dto" -import {AuthData} from "../auth/auth-data"; -import {Websocket} from "../../../spi/websocket/websocket"; -import {HttpJsonRequest} from "../../../spi/http/default-http-json-request"; -import {DefaultHttpJsonRequest} from "../../../spi/http/default-http-json-request"; -import {HttpJsonResponse} from "../../../spi/http/default-http-json-request"; -import {WorkspaceStartEventPromiseMessageBusSubscriber} from "./workspace-start-event-promise-subscriber"; -import {JsonRpcBus} from "../../../spi/websocket/json-rpc-bus"; -import {WorkspaceDisplayOutputMessageBusSubscriber} from "./workspace-log-output-subscriber"; -import {Log} from "../../../spi/log/log"; -import {WorkspaceStopEventPromiseMessageBusSubscriber} from "./workspace-stop-event-promise-subscriber"; -import {RecipeBuilder} from "../../../spi/docker/recipebuilder"; -import {CheFileStructWorkspaceCommand} from "../../../internal/dir/chefile-struct/che-file-struct"; -import {MessageBusSubscriber} from "../../../spi"; - -/** - * Workspace class allowing to manage a workspace, like create/start/stop, etc operations - * @author Florent Benoit - */ -export class Workspace { - - /** - * Authentication data - */ - authData:AuthData; - - /** - * websocket. - */ - websocket:Websocket; - - constructor(authData:AuthData) { - this.authData = authData; - this.websocket = new Websocket(); - } - - - - /** - * Get all workspaces - */ - getWorkspaces():Promise> { - var jsonRequest:HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, null, '/api/workspace/', 200); - return jsonRequest.request().then((jsonResponse:HttpJsonResponse) => { - return jsonResponse.asArrayDto(org.eclipse.che.api.workspace.shared.dto.WorkspaceDtoImpl); - }); - } - - /** - * Gets a workspace config DTO object from a createWorkspaceConfiguration object - * @param createWorkspaceConfig - */ - getWorkspaceConfigDto(createWorkspaceConfig:CreateWorkspaceConfig) : org.eclipse.che.api.workspace.shared.dto.WorkspaceConfigDto { - let devMachine : org.eclipse.che.api.workspace.shared.dto.MachineConfigDto = new org.eclipse.che.api.workspace.shared.dto.MachineConfigDtoImpl(); - devMachine.getInstallers().push("org.eclipse.che.exec"); - devMachine.getInstallers().push("org.eclipse.che.terminal"); - devMachine.getInstallers().push("org.eclipse.che.ws-agent"); - devMachine.getInstallers().push("org.eclipse.che.ssh"); - devMachine.getAttributes().set("memoryLimitBytes", "2147483648"); - - let defaultEnvironment : org.eclipse.che.api.workspace.shared.dto.EnvironmentDto = new org.eclipse.che.api.workspace.shared.dto.EnvironmentDtoImpl(); - defaultEnvironment.getMachines().set("dev-machine", devMachine); - defaultEnvironment.setRecipe(new org.eclipse.che.api.workspace.shared.dto.RecipeDtoImpl(createWorkspaceConfig.machineConfigSource)); - - - let commandsToCreate : Array = new Array; - createWorkspaceConfig.commands.forEach(commandConfig => { - let command : org.eclipse.che.api.workspace.shared.dto.CommandDto = new org.eclipse.che.api.workspace.shared.dto.CommandDtoImpl(); - command.withCommandLine(commandConfig.commandLine).withName(commandConfig.name).withType(commandConfig.type); - if (commandConfig.attributes.previewUrl) { - command.getAttributes().set("previewUrl", commandConfig.attributes.previewUrl); - } - commandsToCreate.push(command); - }); - - let workspaceConfigDto : org.eclipse.che.api.workspace.shared.dto.WorkspaceConfigDto = new org.eclipse.che.api.workspace.shared.dto.WorkspaceConfigDtoImpl(); - workspaceConfigDto.withDefaultEnv("default").withName(createWorkspaceConfig.name).withCommands(commandsToCreate); - workspaceConfigDto.getEnvironments().set("default", defaultEnvironment); - - return workspaceConfigDto; - } - - - /** - * Create a workspace and return a promise with content of WorkspaceDto in case of success - */ - createWorkspace(createWorkspaceConfig:CreateWorkspaceConfig):Promise { - - let workspaceConfigDto : org.eclipse.che.api.workspace.shared.dto.WorkspaceConfigDto = this.getWorkspaceConfigDto(createWorkspaceConfig); - - // TODO use ram ? - //createWorkspaceConfig.ram - - var jsonRequest:HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, null, '/api/workspace?account=', 201).setMethod('POST').setBody(workspaceConfigDto); - return jsonRequest.request().then((jsonResponse:HttpJsonResponse) => { - return jsonResponse.asDto(org.eclipse.che.api.workspace.shared.dto.WorkspaceDtoImpl); - }); - - } - - - /** - * Start a workspace and provide a Promise with WorkspaceDto. - */ - startWorkspace(workspaceId:string, displayLog?:boolean):Promise { - - var callbackSubscriber:WorkspaceStartEventPromiseMessageBusSubscriber; - let userWorkspaceDto : org.eclipse.che.api.workspace.shared.dto.WorkspaceDto; - // get workspace DTO - return this.getWorkspace(workspaceId).then((workspaceDto) => { - var jsonRequest:HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, null, '/api/workspace/' + workspaceId + '/runtime?environment=default', 200).setMethod('POST'); - return jsonRequest.request().then((jsonResponse:HttpJsonResponse) => { - return jsonResponse.asDto(org.eclipse.che.api.workspace.shared.dto.WorkspaceDtoImpl); - })}).then((workspaceDto) => { - userWorkspaceDto = workspaceDto; - return this.getJsonRpcBus(workspaceDto); - }).then((jsonRpcBus: JsonRpcBus) => { - - let rpcCommand: any = - { - "jsonrpc": "2.0", - "method": "subscribe", - "params": {method: "workspace/statusChanged", scope: {workspaceId: workspaceId}} - }; - jsonRpcBus.send(rpcCommand) - var displayOutputWorkspaceSubscriber: MessageBusSubscriber = new WorkspaceDisplayOutputMessageBusSubscriber(); - callbackSubscriber = new WorkspaceStartEventPromiseMessageBusSubscriber(jsonRpcBus, userWorkspaceDto); - jsonRpcBus.subscribe( callbackSubscriber); - jsonRpcBus.subscribe(callbackSubscriber); - if (displayLog) { - let rpcLogCommand: any = - { - "jsonrpc": "2.0", - "method": "subscribe", - "params": {method: "machine/log", scope: {workspaceId: workspaceId}} - }; - jsonRpcBus.send(rpcLogCommand); - let rpcInstallerLogCommand: any = - { - "jsonrpc": "2.0", - "method": "subscribe", - "params": {method: "installer/log", scope: {workspaceId: workspaceId}} - }; - jsonRpcBus.send(rpcInstallerLogCommand); - - jsonRpcBus.subscribe(displayOutputWorkspaceSubscriber); - jsonRpcBus.subscribe(displayOutputWorkspaceSubscriber); - } - return userWorkspaceDto; - }).then((workspaceDto) => { - return callbackSubscriber.promise; - }).then(() => { - return this.getWorkspace(workspaceId); - }); - }; - - - /** - * Search a workspace data by returning a Promise with WorkspaceDto. - */ - searchWorkspace(key:string):Promise { - Log.getLogger().debug('search workspace with key', key); - - // if workspace key is too short it's a workspace name - if (key && key.length < 21) { - if (key.indexOf(":") < 0) { - key = ":" + key; - } - } - - var jsonRequest:HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, null, '/api/workspace/' + key, 200); - return jsonRequest.request().then((jsonResponse:HttpJsonResponse) => { - Log.getLogger().debug('got workspace with key', key, 'result: ', jsonResponse.getData()); - return jsonResponse.asDto(org.eclipse.che.api.workspace.shared.dto.WorkspaceDtoImpl); - }); - } - - /** - * Search a workspace data by returning a Promise with WorkspaceDto. - */ - existsWorkspace(key:string):Promise { - Log.getLogger().debug('search workspace with key', key); - - return this.searchWorkspace(key).catch((error) => { - return undefined; - }) - } - - /** - * Get a workspace data by returning a Promise with WorkspaceDto. - */ - getWorkspace(workspaceId:string):Promise { - var jsonRequest:HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, null, '/api/workspace/' + workspaceId, 200); - return jsonRequest.request().then((jsonResponse:HttpJsonResponse) => { - return jsonResponse.asDto(org.eclipse.che.api.workspace.shared.dto.WorkspaceDtoImpl); - }); - } - - - getJsonRpcBus(workspaceDto:org.eclipse.che.api.workspace.shared.dto.WorkspaceDto): Promise { - // get id - let workspaceId:string = workspaceDto.getId(); - - // get links for WS - var link:string = workspaceDto.getLinks().get("environment/statusChannel"); - - - return this.websocket.getJsonRpcBus(link + '?token=' + this.authData.getToken()); - } - - - /** - * Delete a workspace and returns a Promise with WorkspaceDto. - */ - deleteWorkspace(workspaceId:string):Promise { - var jsonRequest:HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, null, '/api/workspace/' + workspaceId, 204).setMethod('DELETE'); - return this.getWorkspace(workspaceId).then((workspaceDto:org.eclipse.che.api.workspace.shared.dto.WorkspaceDto) => { - return jsonRequest.request().then((jsonResponse:HttpJsonResponse) => { - return workspaceDto; - }); - }); - } - - - /** - * Stop a workspace and returns a Promise with WorkspaceDto. - */ - stopWorkspace(workspaceId:string):Promise { - - var jsonRequest:HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, null, '/api/workspace/' + workspaceId + '/runtime', 204).setMethod('DELETE'); - var callbackSubscriber:WorkspaceStopEventPromiseMessageBusSubscriber; - - var userWorkspaceDto : org.eclipse.che.api.workspace.shared.dto.WorkspaceDto; - // get workspace DTO - return this.getWorkspace(workspaceId).then((workspaceDto) => { - userWorkspaceDto = workspaceDto; - return this.getJsonRpcBus(workspaceDto); - }).then((jsonRpcBus : JsonRpcBus) => { - callbackSubscriber = new WorkspaceStopEventPromiseMessageBusSubscriber(jsonRpcBus, userWorkspaceDto); - jsonRpcBus.subscribe(callbackSubscriber); - return userWorkspaceDto; - }).then((workspaceDto) => { - return jsonRequest.request().then((jsonResponse:HttpJsonResponse) => { - return workspaceDto; - }); - }).then((workspaceDto) => { - return callbackSubscriber.promise; - }); - } - - getWorkspaceAgent(workspaceDTO:org.eclipse.che.api.workspace.shared.dto.WorkspaceDto):any { - // search the workspace agent link - let links:Array = workspaceDTO.getRuntime().getLinks(); - var hrefWsAgent; - links.forEach((link) => { - if ('wsagent' === link.rel) { - hrefWsAgent = link.href; - } - }); - return require('url').parse(hrefWsAgent); - } - - /** - * Provides machine token for given workspace - * @param workspaceId the ID of the workspace - * @returns {*} - */ - getMachineToken(workspaceDto:org.eclipse.che.api.workspace.shared.dto.WorkspaceDto) { - - - var jsonRequest:HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, null, '/api/machine/token/' + workspaceDto.getId(), 200); - return jsonRequest.request().then((jsonResponse:HttpJsonResponse) => { - return JSON.parse(jsonResponse.getData()).machineToken; - }); - - } - -} - -export class CreateWorkspaceConfig { - ram : number = 2048; - machineConfigSource : any = {"contentType": "text/x-dockerfile", "type": "dockerfile", "content": RecipeBuilder.DEFAULT_DOCKERFILE_CONTENT}; - name: string = "default"; - commands: Array = []; - -} diff --git a/dockerfiles/lib/src/api/wsmaster/wsmaster-location.ts b/dockerfiles/lib/src/api/wsmaster/wsmaster-location.ts deleted file mode 100644 index 091274ec4294..000000000000 --- a/dockerfiles/lib/src/api/wsmaster/wsmaster-location.ts +++ /dev/null @@ -1,52 +0,0 @@ -import {ServerLocation} from "../../utils/server-location"; -import {RemoteIp} from "../../spi/docker/remoteip"; - -/** - * ServerLocation implementation for Che master with ability of automatic detection of the Che WS master URL - * - * @author Oleksandr Garagatyi - */ -export class WsMasterLocation extends ServerLocation { - private static DEFAULT_HOSTNAME : string = new RemoteIp().getIp(); - private static DEFAULT_PORT : number = 8080; - - /** - * Automatically detects ServerLocation of Che WS master if provided url is undefined - * @param {string} url of Che WS master - */ - constructor(url?: string) { - if (url) { - let server = ServerLocation.parse(url); - super(server.getHostname(), server.getPort(), server.isSecure()); - return; - } - - // handle CHE_HOST if any - let hostname: string; - let port: number; - let secured = false; - - if (process.env.CHE_HOST) { - hostname = process.env.CHE_HOST; - } else { - hostname = WsMasterLocation.DEFAULT_HOSTNAME; - } - - // handle CHE_HOST_PROTOCOL if any - let hostProtocol :string = process.env.CHE_HOST_PROTOCOL; - if (hostProtocol && hostProtocol === "https") { - secured = true; - } - - // handle CHE_PORT if any - if (process.env.CHE_PORT) { - port = process.env.CHE_PORT; - } else if (secured) { - port = 443; - } else { - port = WsMasterLocation.DEFAULT_PORT; - } - - super(hostname, port, secured); - } -} \ No newline at end of file diff --git a/dockerfiles/lib/src/index.ts b/dockerfiles/lib/src/index.ts deleted file mode 100644 index 394bb17f0425..000000000000 --- a/dockerfiles/lib/src/index.ts +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import {Argument} from "./spi/decorator/parameter"; -import {Parameter} from "./spi/decorator/parameter"; -import {ArgumentProcessor} from "./spi/decorator/argument-processor"; -import {Log} from "./spi/log/log"; -import {CheDir} from "./internal/dir/che-dir"; -import {CheTest} from "./internal/test/che-test"; -import {CheAction} from "./internal/action/che-action"; -import {ErrorMessage} from "./spi/error/error-message"; -/** - * Entry point of this library providing commands. - * @author Florent Benoit - */ -export class EntryPoint { - - args: Array; - - @Argument({description: "Name of the command to execute from this entry point."}) - commandName : string; - - @Parameter({names: ["--logger-debug"], description: "Enable the logger in debug mode"}) - debugLogger : boolean; - - @Parameter({names: ["--logger-prefix-off"], description: "Disable prefix mode in logging"}) - prefixOffLogger : boolean; - - constructor() { - this.args = ArgumentProcessor.inject(this, process.argv.slice(2)); - - process.on('SIGINT', () => { - Log.getLogger().warn('CTRL-C hit, exiting...'); - process.exit(1); - }); - - } - - /** - * Run this entry point and analyze args to dispatch to the correct entry. - */ - run() : void { - - // turn into debugging mode - if (this.debugLogger) { - Log.enableDebug(); - } - - if (this.prefixOffLogger) { - Log.disablePrefix(); - } - - try { - var promise : Promise; - switch(this.commandName) { - case 'che-test': - let cheTest: CheTest = new CheTest(this.args); - promise = cheTest.run(); - break; - case 'che-action': - let cheAction: CheAction = new CheAction(this.args); - promise = cheAction.run(); - break; - case 'che-dir': - let cheDir: CheDir = new CheDir(this.args); - promise = cheDir.run(); - break; - default: - Log.getLogger().error('Invalid choice of command-name'); - process.exit(1); - } - - - // handle error of the promise - promise.catch((error) => { - let exitCode : number = 1; - if (error instanceof ErrorMessage) { - exitCode = error.getExitCode(); - error = error.getError(); - } - - try { - let errorMessage = JSON.parse(error); - if (errorMessage.message) { - Log.getLogger().error(errorMessage.message); - } else { - Log.getLogger().error(error.toString()); - } - } catch (e) { - Log.getLogger().error(error.toString()); - if (error instanceof TypeError || error instanceof SyntaxError) { - console.log(error.stack); - } - } - process.exit(exitCode); - }); - - } catch (e) { - Log.getLogger().error(e); - if (e instanceof TypeError || e instanceof SyntaxError) { - console.log(e.stack); - } - } - - } - -} - - -// call run method -new EntryPoint().run(); diff --git a/dockerfiles/lib/src/internal/action/che-action.ts b/dockerfiles/lib/src/internal/action/che-action.ts deleted file mode 100644 index 64a085906f4b..000000000000 --- a/dockerfiles/lib/src/internal/action/che-action.ts +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import {Argument} from "../../spi/decorator/parameter"; -import {ArgumentProcessor} from "../../spi/decorator/argument-processor"; -import {CreateStartWorkspaceAction} from "./impl/create-start-workspace-action"; -import {RemoveUserAction} from "./impl/remove-user-action"; -import {AddUserAction} from "./impl/add-user-action"; -import {ExecuteCommandAction} from "./impl/execute-command-action"; -import {Log} from "../../spi/log/log"; -import {ListWorkspacesAction} from "./impl/list-workspaces-action"; -import {ProductName} from "../../utils/product-name"; -import {WorkspaceSshAction} from "./impl/workspace-ssh-action"; -import {GetSshDataAction} from "./impl/get-ssh-action"; -import {GracefulStopAction} from "./impl/graceful-stop-action"; -/** - * Entrypoint for the Actions. - * @author Florent Benoit - */ -export class CheAction { - - /** - * This action name will be injected automatically. - */ - @Argument({description: "Name of the action to execute"}) - actionName : string; - - /** - * Parsing of arguments. - */ - args : Array; - - /** - * Map of tests that are available. - */ - mapOfActions : Map = CheAction.init(); - - /** - * Analyze the arguments by injecting parameters/arguments and define the list of test classes. - * @param args - */ - constructor(args:Array) { - this.args = ArgumentProcessor.inject(this, args); - } - - - static init() : Map { - Log.context = '(' + ProductName.getMiniDisplayName() + ' action)'; - let actionMap : Map = new Map(); - actionMap.set('create-start-workspace', CreateStartWorkspaceAction); - actionMap.set('add-user', AddUserAction); - actionMap.set('remove-user', RemoveUserAction); - actionMap.set('execute-command', ExecuteCommandAction); - actionMap.set('list-workspaces', ListWorkspacesAction); - actionMap.set('workspace-ssh', WorkspaceSshAction); - actionMap.set('get-ssh-data', GetSshDataAction); - actionMap.set('graceful-stop', GracefulStopAction); - - return actionMap; - } - - /** - * Run this che-test entry point. - * When a test is found, build an instance of the test and call run() method which returns a promise - */ - run() : Promise { - let classOfAction: any = this.mapOfActions.get(this.actionName); - if (classOfAction) { - Log.context = '(' + ProductName.getMiniDisplayName() + ' action/' + this.actionName + ')'; - var instance = new classOfAction(this.args); - return instance.run(); - } else { - // The given action name has not been found, display available actions - Log.getLogger().error("No action exists with provided name '" + this.actionName + "'."); - this.help(); - process.exit(1); - } - } - - - help() : void { - Log.getLogger().info("Available actions are : "); - for (var [key, value] of this.mapOfActions.entries()) { - Log.getLogger().direct('\u001b[1m' + key + '\u001b[0m'); - ArgumentProcessor.help(Object.create(value.prototype)); - } - } - -} diff --git a/dockerfiles/lib/src/internal/action/impl/add-user-action.ts b/dockerfiles/lib/src/internal/action/impl/add-user-action.ts deleted file mode 100644 index 9d7c5c70a951..000000000000 --- a/dockerfiles/lib/src/internal/action/impl/add-user-action.ts +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ - -// imports -import {org} from "../../../api/dto/che-dto" -import {Argument} from "../../../spi/decorator/parameter"; -import {Parameter} from "../../../spi/decorator/parameter"; -import {AuthData} from "../../../api/wsmaster/auth/auth-data"; -import {User} from "../../../api/wsmaster/user/user"; -import {ArgumentProcessor} from "../../../spi/decorator/argument-processor"; -import {Log} from "../../../spi/log/log"; -import {Permissions} from "../../../api/wsmaster/permissions/permissions"; - -/** - * This class is handling the add of a user and also consider to add user as being admin. - * @author Florent Benoit - */ -export class AddUserAction { - - @Argument({description: "Name of the user to create"}) - userToAdd : string; - - @Argument({description: "Email of the user to create"}) - emailToAdd : string; - - @Argument({description: "Password of the user to create "}) - passwordToAdd : string; - - @Parameter({names: ["-s", "--url"], description: "Defines the url to be used"}) - url : string; - - @Parameter({names: ["-u", "--user"], description: "Defines the user to be used"}) - username : string; - - @Parameter({names: ["-w", "--password"], description: "Defines the password to be used"}) - password : string; - - @Parameter({names: ["-a", "--admin"], description: "Grant admin role to the user"}) - admin : boolean; - - - authData: AuthData; - user: User; - - constructor(args:Array) { - ArgumentProcessor.inject(this, args); - this.authData = new AuthData(this.url, this.username, this.password); - this.user = new User(this.authData); - } - - run() : Promise { - // first, login - return this.authData.login().then(() => { - // then create user - Log.getLogger().info('Creating user ' + this.userToAdd); - return this.user.createUser(this.userToAdd, this.emailToAdd, this.passwordToAdd).then((userDto : org.eclipse.che.api.user.shared.dto.UserDto) => { - Log.getLogger().info('User', this.userToAdd, 'created with id', userDto.getId()); - - // if user should not be addes as admin, job is done - if (!this.admin) { - return Promise.resolve(true); - } else { - let permissions: Permissions = new Permissions(this.authData); - return permissions.copyCurrentPermissionsToUser(userDto.getId()); - } - }) - }); - } - -} diff --git a/dockerfiles/lib/src/internal/action/impl/create-start-workspace-action.ts b/dockerfiles/lib/src/internal/action/impl/create-start-workspace-action.ts deleted file mode 100644 index d2615d133084..000000000000 --- a/dockerfiles/lib/src/internal/action/impl/create-start-workspace-action.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ - -// imports - -import {ArgumentProcessor} from "../../../spi/decorator/argument-processor"; -import {Workspace} from "../../../api/wsmaster/workspace/workspace"; -import {AuthData} from "../../../api/wsmaster/auth/auth-data"; -import {Parameter} from "../../../spi/decorator/parameter"; -import {CreateWorkspaceConfig} from "../../../api/wsmaster/workspace/workspace"; -import {Log} from "../../../spi/log/log"; -/** - * This class is managing a post-check operation by creating a workspace, starting it and displaying the log data. - * @author Florent Benoit - */ -export class CreateStartWorkspaceAction { - - @Parameter({names: ["-s", "--url"], description: "Defines the url to be used"}) - url : string; - - @Parameter({names: ["-q", "--quiet"], description: "Run in quiet mode for this test."}) - isQuiet : boolean = false; - - @Parameter({names: ["-u", "--user"], description: "Defines the user to be used"}) - username : string; - - @Parameter({names: ["-w", "--password"], description: "Defines the password to be used"}) - password : string; - - authData: AuthData; - workspace: Workspace; - - constructor(args:Array) { - ArgumentProcessor.inject(this, args); - - this.authData = new AuthData(this.url, this.username, this.password); - this.workspace = new Workspace(this.authData); - } - - run() : Promise { - // first, login - return this.authData.login().then(() => { - // then create the workspace - let createWorkspaceConfig: CreateWorkspaceConfig = new CreateWorkspaceConfig(); - createWorkspaceConfig.name = 'your-first-workspace'; - Log.getLogger().info('Generating '+ createWorkspaceConfig.name + ' workspace'); - return this.workspace.createWorkspace(createWorkspaceConfig) - .then(workspaceDto => { - // then start it - Log.getLogger().info('Starting workspace runtime'); - return this.workspace.startWorkspace(workspaceDto.getId(), !this.isQuiet); - }).then((workspaceDto) => { - let ideUrl: string = workspaceDto.getLinks().get("ide"); - Log.getLogger().info(ideUrl); - }); - - }); - } - -} diff --git a/dockerfiles/lib/src/internal/action/impl/execute-command-action.ts b/dockerfiles/lib/src/internal/action/impl/execute-command-action.ts deleted file mode 100644 index bc60597dfca2..000000000000 --- a/dockerfiles/lib/src/internal/action/impl/execute-command-action.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -// imports -import {Argument} from "../../../spi/decorator/parameter"; -import {Parameter} from "../../../spi/decorator/parameter"; -import {AuthData} from "../../../api/wsmaster/auth/auth-data"; -import {Workspace} from "../../../api/wsmaster/workspace/workspace"; -import {ArgumentProcessor} from "../../../spi/decorator/argument-processor"; -import {Log} from "../../../spi/log/log"; -import {UUID} from "../../../utils/uuid"; -import {CheFileStructWorkspaceCommand} from "../../dir/chefile-struct/che-file-struct"; -import {CheFileStructWorkspaceCommandImpl} from "../../dir/chefile-struct/che-file-struct"; -import {ExecAgentServiceClientImpl} from "../../../api/exec-agent/exec-agent-service-client"; -/** - * This class is handling the removal of a user - * @author Florent Benoit - */ -export class ExecuteCommandAction { - - @Argument({description: "Defines the workspace to be used"}) - workspaceName : string; - - - @Parameter({names: ["-s", "--url"], description: "Defines the url to be used"}) - url : string; - - @Parameter({names: ["-u", "--user"], description: "Defines the user to be used"}) - username : string; - - @Parameter({names: ["-w", "--password"], description: "Defines the password to be used"}) - password : string; - - - args: Array; - authData: AuthData; - - workspace : Workspace; - constructor(args:Array) { - this.args = ArgumentProcessor.inject(this, args); - this.authData = new AuthData(this.url, this.username, this.password); - // disable printing info - this.authData.printInfo = false; - Log.disablePrefix(); - this.workspace = new Workspace(this.authData); - } - - run() : Promise { - // first, login - return this.authData.login().then(() => { - - // then, search workspace - return this.workspace.searchWorkspace(this.workspaceName).then((workspaceDto) => { - - // check status - if ('RUNNING' !== workspaceDto.getStatus()) { - throw new Error('Workspace should be in running state. Current state is ' + workspaceDto.getStatus()); - } - - // get exec-agent URI - let machines = workspaceDto.getRuntime().getMachines(); - let execAgentServer = machines.get("dev-machine").getServers().get("exec-agent/ws"); - let execAgentURI = execAgentServer.getUrl(); - - // now, execute command - let uuid : string = UUID.build(); - let execAgentServiceClientImpl : ExecAgentServiceClientImpl = new ExecAgentServiceClientImpl(this.workspace, this.authData, execAgentURI); - - let workspaceCommand : CheFileStructWorkspaceCommand = new CheFileStructWorkspaceCommandImpl(); - workspaceCommand.commandLine = this.args.join(" "); - return execAgentServiceClientImpl.executeCommand(workspaceCommand, uuid); - }); - }); - } - -} diff --git a/dockerfiles/lib/src/internal/action/impl/get-ssh-action.ts b/dockerfiles/lib/src/internal/action/impl/get-ssh-action.ts deleted file mode 100644 index 98ab62144559..000000000000 --- a/dockerfiles/lib/src/internal/action/impl/get-ssh-action.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -// imports -import {org} from "../../../api/dto/che-dto" -import {Argument} from "../../../spi/decorator/parameter"; -import {Parameter} from "../../../spi/decorator/parameter"; -import {AuthData} from "../../../api/wsmaster/auth/auth-data"; -import {Workspace} from "../../../api/wsmaster/workspace/workspace"; -import {ArgumentProcessor} from "../../../spi/decorator/argument-processor"; -import {Log} from "../../../spi/log/log"; -import {Ssh} from "../../../api/wsmaster/ssh/ssh"; - -/** - * This class is handling the retrieval of default private ssh key of a workspace, login name and port to use - * @author Florent Benoit - */ -export class GetSshDataAction { - - @Argument({description: "Defines the workspace to be used. use workspaceId or :workspaceName as argument"}) - workspaceName : string; - - - @Parameter({names: ["-s", "--url"], description: "Defines the url to be used"}) - url : string; - - @Parameter({names: ["-u", "--user"], description: "Defines the user to be used"}) - username : string; - - @Parameter({names: ["-w", "--password"], description: "Defines the password to be used"}) - password : string; - - - args: Array; - authData: AuthData; - - fs = require('fs'); - path = require('path'); - - - workspace : Workspace; - constructor(args:Array) { - this.args = ArgumentProcessor.inject(this, args); - this.authData = new AuthData(this.url, this.username, this.password); - // disable printing info - this.authData.printInfo = false; - Log.disablePrefix(); - this.workspace = new Workspace(this.authData); - } - - run() : Promise { - // first, login - return this.authData.login().then(() => { - let foundWorkspaceDTO : org.eclipse.che.api.workspace.shared.dto.WorkspaceDto; - - return this.workspace.searchWorkspace(this.workspaceName).then((workspaceDto) => { - - // check status - if ('RUNNING' !== workspaceDto.getStatus()) { - throw new Error('Workspace should be in running state. Current state is ' + workspaceDto.getStatus()); - } - - // Check ssh agent is there - let defaultEnv:string = workspaceDto.getConfig().getDefaultEnv(); - let agents:Array = workspaceDto.getConfig().getEnvironments().get(defaultEnv).getMachines().get("dev-machine").getInstallers(); - - if (agents.indexOf('org.eclipse.che.ssh') === -1) { - return Promise.reject("The SSH agent (org.eclipse.che.ssh) has been disabled for this workspace.") - } - - foundWorkspaceDTO = workspaceDto; - - }).then(() => { - - // need to get ssh key for the workspace - let ssh:Ssh = new Ssh(this.authData); - return ssh.getPair("workspace", foundWorkspaceDTO.getId()); - }).then((sshPairDto : org.eclipse.che.api.ssh.shared.dto.SshPairDto) => { - - let runtime : org.eclipse.che.api.workspace.shared.dto.RuntimeDto = foundWorkspaceDTO.getRuntime(); - let user : string = "root"; - let machines = foundWorkspaceDTO.getRuntime().getMachines(); - let sshAgentServer = machines.get("dev-machine").getServers().get("ssh"); - - let address: Array = sshAgentServer.getUrl().replace("/", "").split(":"); - let ip:string = address[1]; - let port:string = address[2]; - - Log.getLogger().direct("SSH_IP=" + ip); - Log.getLogger().direct("SSH_PORT=" + port); - Log.getLogger().direct("SSH_USER=" + user); - Log.getLogger().direct("SSH_PRIVATE_KEY='"); - Log.getLogger().direct(sshPairDto.getPrivateKey()); - Log.getLogger().direct("'"); - - - return Promise.resolve("ok"); - }); - }); - } - -} diff --git a/dockerfiles/lib/src/internal/action/impl/graceful-stop-action.ts b/dockerfiles/lib/src/internal/action/impl/graceful-stop-action.ts deleted file mode 100644 index 9d52af72dc7c..000000000000 --- a/dockerfiles/lib/src/internal/action/impl/graceful-stop-action.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -// imports -import {org} from "../../../api/dto/che-dto" -import {Parameter} from "../../../spi/decorator/parameter"; -import {AuthData} from "../../../api/wsmaster/auth/auth-data"; -import {ArgumentProcessor} from "../../../spi/decorator/argument-processor"; -import {Log} from "../../../spi/log/log"; -import {System} from "../../../api/wsmaster/system/system"; -/** - * This class is handling the graceful stop command to the remote Che system - * @author Florent Benoit - */ -export class GracefulStopAction { - - - @Parameter({names: ["-s", "--url"], description: "Defines the url to be used"}) - url : string; - - @Parameter({names: ["-u", "--user"], description: "Defines the user to be used"}) - username : string; - - @Parameter({names: ["-w", "--password"], description: "Defines the password to be used"}) - password : string; - - args: Array; - authData: AuthData; - - fs = require('fs'); - path = require('path'); - - system : System; - - constructor(args:Array) { - this.args = ArgumentProcessor.inject(this, args); - this.authData = new AuthData(this.url, this.username, this.password); - this.system = new System(this.authData); - - } - - run() : Promise { - // first, login - return this.authData.login().then(() => { - return this.system.gracefulStop(); - }).then((state:org.eclipse.che.api.system.shared.dto.SystemStateDto) => { - Log.getLogger().info("Success: System state '" + state.getStatus() + "'."); - }); - } - - - -} diff --git a/dockerfiles/lib/src/internal/action/impl/list-workspaces-action.ts b/dockerfiles/lib/src/internal/action/impl/list-workspaces-action.ts deleted file mode 100644 index 4e09f417ca03..000000000000 --- a/dockerfiles/lib/src/internal/action/impl/list-workspaces-action.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -// imports -import {org} from "../../../api/dto/che-dto" -import {ArgumentProcessor} from "../../../spi/decorator/argument-processor"; -import {Workspace} from "../../../api/wsmaster/workspace/workspace"; -import {AuthData} from "../../../api/wsmaster/auth/auth-data"; -import {Parameter} from "../../../spi/decorator/parameter"; -import {Log} from "../../../spi/log/log"; -import {DefaultAsciiArray} from "../../../spi/ascii/default-ascii-array"; -import {AsciiArray} from "../../../spi/ascii/ascii-array"; -import {FormatterMode} from "../../../spi/ascii/formatter-mode"; - -/** - * This class list all workspaces - * @author Florent Benoit - */ -export class ListWorkspacesAction { - - @Parameter({names: ["-s", "--url"], description: "Defines the url to be used"}) - url : string; - - @Parameter({names: ["-u", "--user"], description: "Defines the user to be used"}) - username : string; - - @Parameter({names: ["-w", "--password"], description: "Defines the password to be used"}) - password : string; - - @Parameter({names: ["--formatter"], description: "Defines the formatter of result"}) - formatterMode : FormatterMode; - - @Parameter({names: ["--formatter-skip-titles"], description: "Don't display titles in the output"}) - formatSkipTitles : boolean = false; - - @Parameter({names: ["--formatter-columns"], description: "Specify order and column names that will be displayed"}) - formatColumns : string; - - - authData: AuthData; - workspace: Workspace; - - constructor(args:Array) { - ArgumentProcessor.inject(this, args); - - this.authData = new AuthData(this.url, this.username, this.password); - this.workspace = new Workspace(this.authData); - } - - run() : Promise { - - return this.authData.login().then(() => { - return this.workspace.getWorkspaces() - .then((workspaceDtos:Array) => { - // Create Ascii array - let rows : Array> = []; - workspaceDtos.forEach((workspaceDto : any) => { - rows.push([workspaceDto.getConfig().getName(), workspaceDto.getId(), workspaceDto.getStatus()]); - }); - let asciiArray : AsciiArray = new DefaultAsciiArray().withRows(rows).withFormatter(this.formatterMode).withTitles("name", "id", "status").withShowTitles(!this.formatSkipTitles).withFormatColumns(this.formatColumns); - Log.getLogger().direct(asciiArray.toAscii()); - - }); - }); - } - -} diff --git a/dockerfiles/lib/src/internal/action/impl/remove-user-action.ts b/dockerfiles/lib/src/internal/action/impl/remove-user-action.ts deleted file mode 100644 index 96399d365aad..000000000000 --- a/dockerfiles/lib/src/internal/action/impl/remove-user-action.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -// imports -import {org} from "../../../api/dto/che-dto" -import {Argument} from "../../../spi/decorator/parameter"; -import {Parameter} from "../../../spi/decorator/parameter"; -import {AuthData} from "../../../api/wsmaster/auth/auth-data"; -import {User} from "../../../api/wsmaster/user/user"; -import {ArgumentProcessor} from "../../../spi/decorator/argument-processor"; -import {Log} from "../../../spi/log/log"; - -/** - * This class is handling the removal of a user - * @author Florent Benoit - */ -export class RemoveUserAction { - - @Argument({description: "name of the user to remove"}) - usernameToDelete : string; - - @Parameter({names: ["-s", "--url"], description: "Defines the url to be used"}) - url : string; - - @Parameter({names: ["-u", "--user"], description: "Defines the user to be used"}) - username : string; - - @Parameter({names: ["-w", "--password"], description: "Defines the password to be used"}) - password : string; - - - authData: AuthData; - user: User; - - constructor(args:Array) { - ArgumentProcessor.inject(this, args); - this.authData = new AuthData(this.url, this.username, this.password); - this.user = new User(this.authData); - } - - run() : Promise { - // first, login - return this.authData.login().then(() => { - Log.getLogger().info('Searching user with name ' + this.usernameToDelete); - return this.user.findUserName(this.usernameToDelete).then((userDto: org.eclipse.che.api.user.shared.dto.UserDto) => { - // then delete user - Log.getLogger().info('Removing user with name ' + this.usernameToDelete, 'and id', userDto.getId()); - return this.user.deleteUser(userDto.getId()); - }); - }); - } - -} diff --git a/dockerfiles/lib/src/internal/action/impl/workspace-ssh-action.ts b/dockerfiles/lib/src/internal/action/impl/workspace-ssh-action.ts deleted file mode 100644 index e88632d17dbe..000000000000 --- a/dockerfiles/lib/src/internal/action/impl/workspace-ssh-action.ts +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -// imports -import {org} from "../../../api/dto/che-dto" -import {Argument} from "../../../spi/decorator/parameter"; -import {Parameter} from "../../../spi/decorator/parameter"; -import {AuthData} from "../../../api/wsmaster/auth/auth-data"; -import {Workspace} from "../../../api/wsmaster/workspace/workspace"; -import {ArgumentProcessor} from "../../../spi/decorator/argument-processor"; -import {Log} from "../../../spi/log/log"; -import {Ssh} from "../../../api/wsmaster/ssh/ssh"; -/** - * This class is handling the connection to a workspace with default ssh key (or custom one) - * @author Florent Benoit - */ -export class WorkspaceSshAction { - - @Argument({description: "Defines the workspace to be used. use workspaceId, workspaceName or namespace:workspaceName as argument"}) - workspaceName : string; - - - @Parameter({names: ["-s", "--url"], description: "Defines the url to be used"}) - url : string; - - @Parameter({names: ["-u", "--user"], description: "Defines the user to be used"}) - username : string; - - @Parameter({names: ["-w", "--password"], description: "Defines the password to be used"}) - password : string; - - - args: Array; - authData: AuthData; - - fs = require('fs'); - path = require('path'); - - - private machineName : string; - - workspace : Workspace; - constructor(args:Array) { - this.args = ArgumentProcessor.inject(this, args); - this.authData = new AuthData(this.url, this.username, this.password); - // disable printing info - this.authData.printInfo = false; - Log.disablePrefix(); - this.workspace = new Workspace(this.authData); - - - // if extra args it's the machine name - if (this.args.length > 0) { - this.machineName = this.args[0]; - } else { - // default to dev-machine if not defined - this.machineName = "dev-machine"; - } - } - - run() : Promise { - // first, login - return this.authData.login().then(() => { - - let foundWorkspaceDTO : org.eclipse.che.api.workspace.shared.dto.WorkspaceDto; - - // then, search workspace - return this.workspace.searchWorkspace(this.workspaceName).then((workspaceDto) => { - - // check status - if ('RUNNING' !== workspaceDto.getStatus()) { - throw new Error('Workspace should be in running state. Current state is ' + workspaceDto.getStatus()); - } - - // Check ssh agent is there - let defaultEnv:string = workspaceDto.getConfig().getDefaultEnv(); - - let machineConfig : org.eclipse.che.api.workspace.shared.dto.MachineConfigDto = workspaceDto.getConfig().getEnvironments().get(defaultEnv).getMachines().get(this.machineName); - if (!machineConfig) { - throw new Error("Unable to find a machine named " + this.machineName + " in the workspace '" + this.workspaceName) - } - - let agents:Array = machineConfig.getInstallers(); - - if (agents.indexOf('org.eclipse.che.ssh') === -1) { - return Promise.reject("The SSH agent (org.eclipse.che.ssh) has been disabled for this workspace.") - } - - foundWorkspaceDTO = workspaceDto; - - }).then(() => { - - // need to get ssh key for the workspace - let ssh:Ssh = new Ssh(this.authData); - return ssh.getPair("workspace", foundWorkspaceDTO.getId()); - }).then((sshPairDto : org.eclipse.che.api.ssh.shared.dto.SshPairDto) => { - - let machines : Map = foundWorkspaceDTO.getRuntime().getMachines(); - let runtime: org.eclipse.che.api.workspace.shared.dto.MachineDto = machines.get(this.machineName); - let user : string = "root"; - - let sshAgentServer = runtime.getServers().get("ssh"); - - let address: Array = sshAgentServer.getUrl().replace("/", "").split(":"); - let ip:string = address[0]; - let port:string = address[1]; - let spawn = require('child_process').spawn; - - let username:string = user + "@" + ip; - let cmd : string = "$(cat >>/tmp/ssh.key < { - Log.getLogger().error(err); - }); - - p.on('exit', () => { - Log.getLogger().info('Ending ssh connection'); - }); - return Promise.resolve("ok"); - }); - }); - } - - - -} diff --git a/dockerfiles/lib/src/internal/dir/che-dir-constant.properties b/dockerfiles/lib/src/internal/dir/che-dir-constant.properties deleted file mode 100644 index 403cd3a009b7..000000000000 --- a/dockerfiles/lib/src/internal/dir/che-dir-constant.properties +++ /dev/null @@ -1,38 +0,0 @@ -# -# Copyright (c) 2016-2017 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 -# - -status.workspace.name=Workspace name {0} -status.workspace.url=Workspace url {0} - -down.search=Search for a running Eclipse Che... -down.found=Found running Eclipse Che at {0} -down.stopping=Stopping Eclipse Che... -down.stopped=Eclipse Che instance successfully stopped -down.not-running=No Eclipse Che instance running. - -destroy.workspace-not-existing=The workspace {0} does not exist. Only stop server. -destroy.destroying-workspace=Destroying workspace {0}... -destroy.destroyed-workspace=Workspace {0} destroyed - - -up.notconfigured=No che configured. che init has been done ? -up.existinginstance=Found existing instance of Eclipse Che running on the same host/port. So aborting as Eclipse Che is already up. -up.starting=Starting Eclipse Che silently -up.running=Eclipse Che will be available at {0} (it's running but configuration is still in progress) -up.workspace-created=Workspace created -up.workspace-previous-start=Workspace exists from a previous start -up.workspace-booting=Workspace booting... -up.updating-project=Updating project... -up.workspace-booted=Workspace booted and ready for development -up.workspace-connect-to=Connect to {0} - -executeCommandsFromCurrentWorkspace.executing=Executing post-loading commands diff --git a/dockerfiles/lib/src/internal/dir/che-dir.ts b/dockerfiles/lib/src/internal/dir/che-dir.ts deleted file mode 100644 index fe8265ed7300..000000000000 --- a/dockerfiles/lib/src/internal/dir/che-dir.ts +++ /dev/null @@ -1,1316 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -// imports -import {org} from "../../api/dto/che-dto" -import {CheFileStructWorkspace} from './chefile-struct/che-file-struct'; -import {CheFileStruct} from './chefile-struct/che-file-struct'; -import {Websocket} from "../../spi/websocket/websocket"; -import {AuthData} from "../../api/wsmaster/auth/auth-data"; -import {Workspace} from "../../api/wsmaster/workspace/workspace"; -import {Message} from "../../spi/decorator/message"; -import {I18n} from "../../spi/i18n/i18n"; -import {RemoteIp} from "../../spi/docker/remoteip"; -import {Log} from "../../spi/log/log"; -import {CreateWorkspaceConfig} from "../../api/wsmaster/workspace/workspace"; -import {Project} from "../../api/wsmaster/project/project"; -import {RecipeBuilder} from "../../spi/docker/recipebuilder"; -import {ContainerVersion} from "../../spi/docker/container-version"; -import {DefaultHttpJsonRequest} from "../../spi/http/default-http-json-request"; -import {HttpJsonRequest} from "../../spi/http/default-http-json-request"; -import {HttpJsonResponse} from "../../spi/http/default-http-json-request"; -import {UUID} from "../../utils/uuid"; -import {CheFileStructWorkspaceCommand} from "./chefile-struct/che-file-struct"; -import {CheFileStructWorkspaceCommandImpl} from "./chefile-struct/che-file-struct"; -import {CheFileStructWorkspaceLoadingAction} from "./chefile-struct/che-file-struct"; -import {ArgumentProcessor} from "../../spi/decorator/argument-processor"; -import {Parameter} from "../../spi/decorator/parameter"; -import {ProductName} from "../../utils/product-name"; -import {SSHGenerator} from "../../spi/docker/ssh-generator"; -import {CheFileStructWorkspaceProject} from "./chefile-struct/che-file-struct"; -import {StringUtils} from "../../utils/string-utils"; -import {ExecAgentServiceClientImpl} from "../../api/exec-agent/exec-agent-service-client"; -import {JsonRpcBus} from "../../spi/websocket/json-rpc-bus"; - -/** - * Entrypoint for the Chefile handling in a directory. - * It can either generate or reuse an existing Chefile and then boot Che. - * @author Florent Benoit - */ -export class CheDir { - - @Parameter({names: ["--verbose"], description: "Display in verbose mode."}) - isVerbose : boolean = false; - - // Try 30s to ping a che server when booting it - times: number = 30; - - // gloabl var - waitDone = false; - - chefileStruct: CheFileStruct; - chefileStructWorkspace: CheFileStructWorkspace; - - // requirements - path = require('path'); - http = require('http'); - fs = require('fs'); - vm = require('vm'); - readline = require('readline'); - exec = require('child_process').exec; - - // init folder/files variables - currentFolder: string = this.path.resolve('./'); - folderName: any; - cheFile : any; - - /** - * Alternate path to the Chefile file with .Chefile - */ - dotCheFile: string; - - /** - * Alternate path to the Chefile file with .chefile - */ - dotCheFileLowercase: string; - - dotCheFolder : any; - workspacesFolder : any; - cliFolder : any; - dotCheIdFile : any; - dotCheSshPrivateKeyFile : any; - dotCheSshPublicKeyFile : any; - instanceId: string; - - mode; - args : Array; - - cheLauncherImageName : string; - - websocket: Websocket; - authData: AuthData; - workspace: Workspace; - - @Message('internal/dir/che-dir-constant') - i18n : I18n; - - constructor(args) { - this.args = ArgumentProcessor.inject(this, args); - - - if (this.args.length == 0) { - throw new Error("Missing folder for synchronization."); - } - - this.currentFolder = this.path.resolve(args[0]); - this.folderName = this.path.basename(this.currentFolder); - this.cheFile = this.path.resolve(this.currentFolder, 'Chefile'); - this.dotCheFile = this.path.resolve(this.currentFolder, '.Chefile'); - this.dotCheFileLowercase = this.path.resolve(this.currentFolder, '.chefile'); - this.dotCheFolder = this.path.resolve(this.currentFolder, '.che'); - this.dotCheIdFile = this.path.resolve(this.dotCheFolder, 'id'); - this.dotCheSshPrivateKeyFile = this.path.resolve(this.dotCheFolder, 'ssh-key.private'); - this.dotCheSshPublicKeyFile = this.path.resolve(this.dotCheFolder, 'ssh-key.public'); - this.workspacesFolder = this.path.resolve(this.dotCheFolder, 'workspaces'); - this.cliFolder = this.path.resolve(this.dotCheFolder, 'cli'); - - this.initDefault(); - - this.websocket = new Websocket(); - - this.authData = new AuthData(); - - // che launcher image name - this.cheLauncherImageName = 'eclipse/che'; - } - - - - initDefault() { - this.chefileStruct = new CheFileStruct(); - this.chefileStruct.server.ip = new RemoteIp().getIp(); - // handle CHE_PORT if any - if (process.env.CHE_PORT) { - this.chefileStruct.server.port = process.env.CHE_PORT; - } else { - this.chefileStruct.server.port = 8080; - } - this.chefileStruct.server.type = 'local'; - - this.chefileStructWorkspace = new CheFileStructWorkspace(); - this.chefileStructWorkspace.name = 'local'; - this.chefileStructWorkspace.ram = 2048; - - try { - this.fs.statSync(this.dotCheIdFile); - // we have a file - this.instanceId = this.fs.readFileSync(this.dotCheIdFile).toString(); - } catch (e) { - this.instanceId = UUID.build(); - this.writeInstanceId(); - } - - /*Object.keys(process.env).forEach((key) => { - Log.getLogger().debug('Env variable', key, process.env[key]); - });*/ - - if (process.env.CHE_HOST) { - this.chefileStruct.server.properties['CHE_HOST'] = process.env.CHE_HOST; - } - - - - } - - - - startsWith(value:string, searchString: string) : boolean { - return value.substr(0, searchString.length) === searchString; - } - - - parseArgument() : Promise { - return new Promise( (resolve, reject) => { - let emptyCommand : string = 'You need to provide an argument to the command : init, up, down, ssh or status'; - let invalidCommand : string = 'Invalid command given: only init, up, down, ssh and status commands are supported.'; - if (this.args.length == 1) { - reject(emptyCommand); - } else if ('init' === this.args[1] - || 'up' === this.args[1] - || 'destroy' === this.args[1] - || 'factory' === this.args[1] - || 'down' === this.args[1] - || 'ssh' === this.args[1] - || 'status' === this.args[1]) { - // return method found based on arguments - resolve(this.args[1]); - } else { - reject('Invalid arguments ' + this.args +': ' + invalidCommand); - } - }); - - } - - run() : Promise { - Log.context = '(' + ProductName.getMiniDisplayName() + ' dir)'; - - // call the method analyzed from the argument - return this.parseArgument().then((methodName) => { - return this[methodName](); - }) - - - } - - parse() { - - let cheFiles : Array = this.findCheFiles(); - - if (cheFiles.length === 0) { - Log.getLogger().debug('No chefile defined, use default settings'); - return; - } else if (cheFiles.length >= 2) { - throw new Error('Error while parsing the Chefile as it was found at ' + JSON.stringify(cheFiles) + '. Only one file at a time is allowed.'); - } else { - this.cheFile = cheFiles[0]; - Log.getLogger().debug('Parsing chefile with name ', this.cheFile); - } - - // load the chefile script if defined - var script_code : string = this.fs.readFileSync(this.cheFile).toString(); - - // strip the lines that are beginning with # as it may be comments - script_code = StringUtils.removeSharpComments(script_code); - - // replace multiline content for workspace by raw strings - script_code = StringUtils.keepWorkspaceRawStrings(script_code); - - // create sandboxed object - var sandbox = { "che": this.chefileStruct, "workspace": this.chefileStructWorkspace, "console": console}; - - let options = { - filename : this.cheFile, - displayErrors : true - }; - - try { - this.vm.runInNewContext(script_code, sandbox, options); - } catch (error) { - if (error.stack) { - // search correct line - let splitLines = error.stack.split('\n'); - var found : boolean = false; - var i : number = 0; - while (!found && i < splitLines.length) { - let currentStackLine = splitLines[i]; - if (currentStackLine.indexOf(this.cheFile) != -1) { - // found matching line - found = true; - let splitColumns = currentStackLine.split(':'); - // check line number only or both line+column number - if (splitColumns.length == 3) { - // line and column number - let lineNumber = splitColumns[1]; - let colNumber = splitColumns[2]; - throw new Error('Error while parsing the file \'' + this.cheFile + '\' at line ' + lineNumber + ' and column ' + colNumber + '. The error is :' + error.message); - } else if (splitColumns.length == 2) { - // only line number - let lineNumber = splitColumns[1]; - throw new Error('Error while parsing the file \'' + this.cheFile + '\' at line ' + lineNumber + '. The error is :' + error.message); - } - } - i++; - } - } - // not able to parse error - throw error; - } - - this.cleanupArrays(); - - Log.getLogger().debug('Che file parsing object is ', JSON.stringify(this.chefileStruct)); - Log.getLogger().debug('Che workspace parsing object is ', JSON.stringify(this.chefileStructWorkspace)); - - this.authData.getMasterLocation().setPort(this.chefileStruct.server.port); - - } - - - /** - * Cleanup arrays by removing extra elements - */ - cleanupArrays() { - // now, cleanup invalid commands - for (let i : number = this.chefileStructWorkspace.commands.length - 1; i >= 0 ; i--) { - // no name, drop it - if (!this.chefileStructWorkspace.commands[i].name) { - this.chefileStructWorkspace.commands.splice(i, 1); - } - } - // now, cleanup invalid commands - for (let i : number = this.chefileStructWorkspace.postload.actions.length - 1; i >= 0 ; i--) { - // no name, drop it - if (!this.chefileStructWorkspace.postload.actions[i].command && !this.chefileStructWorkspace.postload.actions[i].script) { - this.chefileStructWorkspace.postload.actions.splice(i, 1); - } - } - - // now, cleanup invalid projects - for (let i : number = this.chefileStructWorkspace.projects.length - 1; i >= 1 ; i--) { - // no name, drop it - if (!this.chefileStructWorkspace.projects[i].name) { - this.chefileStructWorkspace.projects.splice(i, 1); - } - } - - - } - - /** - * Check if directory has been initialized or not - * @return true if initialization has been done - */ - isInitialized() : Promise { - return new Promise((resolve) => { - try { - this.fs.statSync(this.dotCheFolder); - resolve(true); - } catch (e) { - resolve(false); - } - }); - - } - - - /** - * Write a default chefile - */ - writeDefaultChefile() { - - - // - this.chefileStructWorkspace.commands[0].name = "my-first-command"; - this.chefileStructWorkspace.commands[0].commandLine = "echo this is my first command && read"; - this.chefileStructWorkspace.postload.actions[0].command = "my-first-command"; - this.chefileStructWorkspace.postload.actions[1].script = "echo 'this is my custom command' && while true; do echo $(date); sleep 1; done"; - - // remove empty values - this.cleanupArrays(); - - // create content to write - let content = ''; - - // work on a copy - let che : CheFileStruct = JSON.parse(JSON.stringify(this.chefileStruct)); - - // Do not write default server values - delete che.server; - - // make flat the che object - let flatChe = this.flatJson('che', che); - flatChe.forEach((value, key) => { - Log.getLogger().debug( 'the value is ' + value.toString() + ' for key' + key); - if (key !== 'che.server.ip') { - content += key + '=' + value.toString() + '\n'; - } - }); - - // make flat the workspace object - let flatWorkspace = this.flatJson('workspace', this.chefileStructWorkspace); - flatWorkspace.forEach((value, key) => { - Log.getLogger().debug( 'the flatWorkspace value is ' + value.toString() + ' for key' + key); - content += key + '=' + value.toString() + '\n'; - }); - - // write content of this.che object - this.fs.writeFileSync(this.cheFile, content); - Log.getLogger().info('Generating default', this.cheFile); - - - try { - this.fs.chownSync(this.cheFile, 1000, 1000); - } catch (error) { - Log.getLogger().debug("Unable to chown che file", this.cheFile); - } - - - } - - /** - * Checks if the given file is existing or not - * @param filename the path to check - * @returns {boolean} true if it exists - */ - fileExistsCaseSensitive(filename) : boolean { - var dir = this.path.dirname(filename); - if (dir === '/' || dir === '.') { - return true; - } - var filenames = this.fs.readdirSync(dir); - if (filenames.indexOf(this.path.basename(filename)) === -1) { - return false; - } - return this.fileExistsCaseSensitive(dir); - } - - /** - * Search all the chefiles with the corresponding pattern : Chefile, .Chefile, .chefile - * @returns {Array} containing all references found - */ - findCheFiles() : Array { - - let foundCheFiles : Array = new Array(); - - // Try with Chefile - if (this.fileExistsCaseSensitive(this.cheFile)) { - Log.getLogger().debug('Chefile is present at ', this.cheFile); - foundCheFiles.push(this.cheFile); - } - - // Try with .Chefile - if (this.fileExistsCaseSensitive(this.dotCheFile)) { - Log.getLogger().debug('The alternate file .Chefile is present at ', this.dotCheFile); - foundCheFiles.push(this.dotCheFile); - } - - // Try with .chefile - if (this.fileExistsCaseSensitive(this.dotCheFileLowercase)) { - this.fs.statSync(this.dotCheFileLowercase); - Log.getLogger().debug('The alternate file .chefile is present at ', this.dotCheFileLowercase); - foundCheFiles.push(this.dotCheFileLowercase); - } - return foundCheFiles; - } - - - init() : Promise { - return this.isInitialized().then((isInitialized) => { - if (isInitialized) { - Log.getLogger().warn('Che already initialized'); - } else { - // needs to create folders - Log.getLogger().info('Adding', this.dotCheFolder, 'directory'); - this.initCheFolders(); - - let cheFiles: Array = this.findCheFiles(); - - // write a default chefile if there is none - if (cheFiles.length === 0) { - // write default - Log.getLogger().debug('Write a default Chefile at ', this.cheFile); - this.writeDefaultChefile(); - } - return true; - } - - }); - - } - - status() : Promise { - return this.isInitialized().then((isInitialized) => { - if (!isInitialized) { - return Promise.reject('This directory has not been initialized. So, status is not available.'); - } - - return new Promise((resolve, reject) => { - this.parse(); - resolve('parsed'); - }).then(() => { - return this.checkCheIsRunning(); - }).then((isRunning) => { - if (!isRunning) { - return Promise.reject('No Eclipse Che Instance Running.'); - } - }).then(() => { - // check workspace exists - this.workspace = new Workspace(this.authData); - return this.workspace.existsWorkspace(':' + this.chefileStructWorkspace.name); - }).then((workspaceDto : org.eclipse.che.api.workspace.shared.dto.WorkspaceDto) => { - // found it - if (!workspaceDto) { - return Promise.reject('Eclipse Che is running ' + this.buildLocalCheURL() + ' but workspace (' + this.chefileStructWorkspace.name + ') has not been found'); - } - - // search IDE url link - let ideUrl : string = workspaceDto.getLinks().get("ide"); - Log.getLogger().info(this.i18n.get('status.workspace.name', this.chefileStructWorkspace.name)); - Log.getLogger().info(this.i18n.get('status.workspace.url', ideUrl)); - Log.getLogger().info(this.i18n.get('status.instance.id', this.instanceId)); - return Promise.resolve(true); - }); - }); - - } - - - /** - * Search a che instance and stop it it it's currently running - */ - down() : Promise { - - // call init if not initialized and then call up - return this.isInitialized().then((isInitialized) => { - if (!isInitialized) { - throw new Error('Unable to stop current instance as this directory has not been initialized.') - } - }).then(() => { - - return new Promise((resolve, reject) => { - this.parse(); - - resolve(); - }).then(() => { - Log.getLogger().info(this.i18n.get('down.search')); - - // Try to connect to Eclipse Che instance - return this.checkCheIsRunning(); - }).then((isRunning) => { - if (!isRunning) { - return Promise.reject(this.i18n.get('down.not-running')); - } - Log.getLogger().info(this.i18n.get('down.found', this.buildLocalCheURL())); - Log.getLogger().info(this.i18n.get('down.stopping')); - - // call docker stop on the docker launcher - return this.cheStop(); - }).then(() => { - Log.getLogger().info(this.i18n.get('down.stopped')); - }); - }); - } - - - - /** - * Search a che instance and destroy workspace and then stop - */ - destroy() : Promise { - - // check if directory has been initialized or not - return this.isInitialized().then((isInitialized) => { - if (!isInitialized) { - throw new Error('Unable to stop current instance as this directory has not been initialized.') - } - }).then(() => { - - return new Promise((resolve, reject) => { - this.parse(); - - resolve(); - }).then(() => { - Log.getLogger().info(this.i18n.get('down.search')); - - // Try to connect to Eclipse Che instance - return this.checkCheIsRunning(); - }).then((isRunning) => { - if (!isRunning) { - return Promise.reject(this.i18n.get('down.not-running')); - } - }).then(() => { - Log.getLogger().info(this.i18n.get('down.found', this.buildLocalCheURL())); - this.workspace = new Workspace(this.authData); - // now, check if there is a workspace - return this.workspace.existsWorkspace(':' + this.chefileStructWorkspace.name); - }).then((workspaceDto : org.eclipse.che.api.workspace.shared.dto.WorkspaceDto) => { - // exists ? - if (!workspaceDto) { - // workspace is not existing - Log.getLogger().warn(this.i18n.get('destroy.workspace-not-existing', this.chefileStructWorkspace.name)); - // call docker stop on the docker launcher - Log.getLogger().info(this.i18n.get('down.stopping')); - return this.cheStop(); - } else { - // first stop and then delete workspace - Log.getLogger().info(this.i18n.get('destroy.destroying-workspace', this.chefileStructWorkspace.name)); - return this.workspace.stopWorkspace(workspaceDto.getId()).then(() => { - return this.workspace.deleteWorkspace(workspaceDto.getId()); - }).then(() => { - Log.getLogger().info(this.i18n.get('destroy.destroyed-workspace', this.chefileStructWorkspace.name)); - // then stop server - Log.getLogger().info(this.i18n.get('down.stopping')); - return this.cheStop(); - }); - } - }).then(() => { - Log.getLogger().info(this.i18n.get('down.stopped')); - }); - }); - } - - - buildWorkspaceConfig() : CreateWorkspaceConfig { - let createWorkspaceConfig:CreateWorkspaceConfig = new CreateWorkspaceConfig(); - - let recipe: string = new RecipeBuilder(this.currentFolder).getRecipe(this.chefileStructWorkspace); - createWorkspaceConfig.machineConfigSource = recipe; - createWorkspaceConfig.commands = this.chefileStructWorkspace.commands; - createWorkspaceConfig.name = this.chefileStructWorkspace.name; - createWorkspaceConfig.ram = this.chefileStructWorkspace.ram; - - return createWorkspaceConfig; - } - - - up() : Promise { - let start : number = Date.now(); - // call init if not initialized and then call up - return this.isInitialized().then((isInitialized) => { - if (!isInitialized) { - return this.init(); - } - }).then(() => { - - - var ideUrl : string; - - var needToSetupProject: boolean = true; - var userWorkspaceDto: org.eclipse.che.api.workspace.shared.dto.WorkspaceDto; - var workspaceHasBeenCreated : boolean = false; - return new Promise((resolve, reject) => { - this.parse(); - resolve('parsed'); - }).then(() => { - return this.checkCheIsNotRunning(); - }).then((isNotRunning) => { - return new Promise((resolve, reject) => { - if (isNotRunning) { - resolve(true); - } else { - reject(this.i18n.get('up.existinginstance')); - } - }); - }).then((checkOk) => { - Log.getLogger().info(this.i18n.get('up.starting')); - // needs to invoke docker run - return this.cheBoot(); - }).then((data) => { - // loop to check startup (during 30seconds) - return this.loopWaitChePing(); - }).then((value) => { - Log.getLogger().info(this.i18n.get('up.running', this.buildLocalCheURL())); - // check workspace exists - this.workspace = new Workspace(this.authData); - return this.workspace.existsWorkspace(':' + this.chefileStructWorkspace.name); - }).then((workspaceDto) => { - // found it - if (!workspaceDto) { - // workspace is not existing - // now create the workspace - let createWorkspaceConfig:CreateWorkspaceConfig = this.buildWorkspaceConfig(); - Log.getLogger().info(this.i18n.get('up.workspace-created')); - workspaceHasBeenCreated = true; - return this.workspace.createWorkspace(createWorkspaceConfig) - } else { - // do not create it, just return current one - Log.getLogger().info(this.i18n.get('up.workspace-previous-start')); - needToSetupProject = false; - return workspaceDto; - } - }).then((workspaceDto) => { - Log.getLogger().info(this.i18n.get('up.workspace-booting')); - return this.workspace.startWorkspace(workspaceDto.getId(), this.isVerbose); - }).then((workspaceDto) => { - return this.workspace.getWorkspace(workspaceDto.getId()) - }).then((workspaceDto) => { - userWorkspaceDto = workspaceDto; - }).then(() => { - return this.setupSSHKeys(userWorkspaceDto); - }).then(() => { - if (needToSetupProject) { - return this.setupProjects(userWorkspaceDto); - } else { - return Promise.resolve('existing project'); - } - }).then(() => { - return this.executeCommandsFromCurrentWorkspace(userWorkspaceDto); - }).then(() => { - Log.getLogger().info(this.i18n.get('up.workspace-booted')); - }).then(() => { - let end : number = Date.now(); - Log.getLogger().debug("time =", end - start); - Log.getLogger().info(this.i18n.get('up.workspace-connect-to', this.buildLocalIDEUrl())); - return ideUrl; - }); - - }); - } - - - setupProjects(workspaceDto : org.eclipse.che.api.workspace.shared.dto.WorkspaceDto) : any { - let promises : Array> = new Array>(); - Log.getLogger().info(this.i18n.get('up.updating-project')); - - var projectAPI:Project = new Project(workspaceDto, this.authData); - - this.chefileStructWorkspace.projects.forEach(project => { - // no location, use inner project - if (!project.source.location) { - promises.push(this.estimateAndUpdateProject(projectAPI, this.folderName, project.type)); - } else { - // need to import project - let promise = new Promise((resolve, reject) => { - - let sourceStorageDto : org.eclipse.che.api.workspace.shared.dto.SourceStorageDto = this.getSourceStorageDto(project); - - return projectAPI.importProject(project.name, sourceStorageDto).then(() => { - this.estimateAndUpdateProject(projectAPI, project.name, project.type, sourceStorageDto).then(() => { - resolve(true); - }); - }, (error) => { - reject('Unable to import project ' + project.name + '. Error is : ' + error); - }); - }); - promises.push(promise); - } - }); - - - // update created project to given project type - return Promise.all(promises); - - } - - /** - * get source storage DTO - */ - getSourceStorageDto(project : CheFileStructWorkspaceProject) : org.eclipse.che.api.workspace.shared.dto.SourceStorageDto { - - let sourceStorageDto : org.eclipse.che.api.workspace.shared.dto.SourceStorageDto = new org.eclipse.che.api.workspace.shared.dto.SourceStorageDtoImpl(); - sourceStorageDto.withLocation(project.source.location).withType(project.source.type); - return sourceStorageDto; - } - - - rsyncProject(workspaceDto: org.eclipse.che.api.workspace.shared.dto.WorkspaceDto) : Promise { - var spawn = require('child_process').spawn; - - let machines = workspaceDto.getRuntime().getMachines(); - let sshAgentServer = machines.get("dev-machine").getServers().get("ssh"); - let port: string = sshAgentServer.getUrl().replace("/", "").split(":")[2]; - let username : string = "user@" + this.chefileStruct.server.ip; - - - var execSync = require('child_process').execSync; - let containerVersion : string = new ContainerVersion().getVersion(); - let output:string = execSync('docker run -v ' + this.currentFolder + ':' + this.currentFolder + ' -v ' + this.dotCheSshPrivateKeyFile + ':/tmp/ssh.key' + ' -t florentdemo:rsync rsync -ar -e "ssh -p ' + port + ' -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /tmp/ssh.key" --exclude "node_modules" --exclude "target" ' + this.currentFolder + ' ' + username + ':/projects/'); - - return Promise.resolve("ok"); - } - -setupSSHKeys(workspaceDto: org.eclipse.che.api.workspace.shared.dto.WorkspaceDto) : Promise { - - let privateKey : string; - let publicKey : string; - // check if we have keys locally or not ? - try { - this.fs.statSync(this.dotCheSshPrivateKeyFile); - // we have the file - privateKey = this.fs.readFileSync(this.dotCheSshPrivateKeyFile).toString(); - publicKey = this.fs.readFileSync(this.dotCheSshPublicKeyFile).toString(); - Log.getLogger().info('Using existing ssh key'); - } catch (e) { - // no file, need to generate key - Log.getLogger().info('Generating ssh key'); - let map : Map = new SSHGenerator().generateKey(); - - // store locally the private and public keys - privateKey = map.get('private'); - publicKey = map.get('public'); - this.fs.writeFileSync(this.dotCheSshPrivateKeyFile, privateKey, { mode: 0o600 }); - this.fs.writeFileSync(this.dotCheSshPublicKeyFile, publicKey); - - try { - this.fs.chownSync(this.dotCheSshPrivateKeyFile, 1000, 1000); - } catch (error) { - Log.getLogger().debug("Unable to chown ssh key private file", this.dotCheSshPrivateKeyFile); - } - - } - - // ok we have the public key, now storing it - // get dev machine - let machines : Map = workspaceDto.getRuntime().getMachines(); - let machine : org.eclipse.che.api.workspace.shared.dto.MachineDto = machines.get("dev-machine"); - let execAgentServer : org.eclipse.che.api.workspace.shared.dto.ServerDto = machine.getServers().get("exec-agent/ws"); - let execAgentURI = execAgentServer.getUrl(); - if (execAgentURI.includes("localhost")) { - execAgentURI = execAgentURI.replace("localhost", RemoteIp.ip) - } - - let execAgentServiceClient:ExecAgentServiceClientImpl = new ExecAgentServiceClientImpl(this.workspace, this.authData, execAgentURI); - - let uuid:string = UUID.build(); - - let customCommand:CheFileStructWorkspaceCommand = new CheFileStructWorkspaceCommandImpl(); - customCommand.commandLine = '(mkdir $HOME/.ssh || true) && echo "' + publicKey + '">> $HOME/.ssh/authorized_keys'; - customCommand.name = 'setup ssh'; - customCommand.type = 'custom'; - - // store in workspace the public key - return execAgentServiceClient.executeCommand(customCommand, uuid, false); - -} - - - ssh() : Promise { - return this.isInitialized().then((isInitialized) => { - if (!isInitialized) { - return Promise.reject('This directory has not been initialized. So, ssh is not available.'); - } - - return new Promise((resolve, reject) => { - this.parse(); - resolve('parsed'); - }).then(() => { - return this.checkCheIsRunning(); - }).then((isRunning) => { - if (!isRunning) { - return Promise.reject('No Eclipse Che Instance Running.'); - } - - // check workspace exists - this.workspace = new Workspace(this.authData); - return this.workspace.existsWorkspace(':' + this.chefileStructWorkspace.name); - }).then((workspaceDto : org.eclipse.che.api.workspace.shared.dto.WorkspaceDto) => { - // found it - if (!workspaceDto) { - return Promise.reject('Eclipse Che is running ' + this.buildLocalCheURL() + ' but workspace (' + this.chefileStructWorkspace.name + ') has not been found'); - } - - // Check ssh agent is there - let defaultEnv : string = workspaceDto.getConfig().getDefaultEnv(); - let agents : Array = workspaceDto.getConfig().getEnvironments().get(defaultEnv).getMachines().get("dev-machine").getInstallers(); - - if (agents.indexOf('org.eclipse.che.ssh') === - 1) { - return Promise.reject("The SSH agent (org.eclipse.che.ssh) has been disabled for this workspace.") - } - - let machines = workspaceDto.getRuntime().getMachines(); - let sshAgentServer = machines.get("dev-machine").getServers().get("ssh"); - let port: string = sshAgentServer.getUrl().replace("/", "").split(":")[2]; - var spawn = require('child_process').spawn; - - let username : string = "user@" + this.chefileStruct.server.ip; - - var p = spawn("docker", ["run", "-v", this.dotCheSshPrivateKeyFile + ":/tmp/ssh.key", "-ti", "codenvy/alpine_jdk8", "ssh", "-o", "UserKnownHostsFile=/dev/null", "-o", "StrictHostKeyChecking=no", username, "-p", port, "-i", "/tmp/ssh.key"], { - stdio: 'inherit' - }); - - p.on('error', (err) => { - Log.getLogger().error(err); - }); - - p.on('exit', () => { - Log.getLogger().info('Ending ssh connection'); - }); - return Promise.resolve("ok"); - }) - }); - } - - - - - estimateAndUpdateProject(projectAPI: Project, projectName: string, projectType: string, sourceStorageDto? : org.eclipse.che.api.workspace.shared.dto.SourceStorageDto) : Promise { - Log.getLogger().debug('estimateAndUpdateProject with project', projectName, 'and projectType', projectType); - - var projectTypeToUse: string; - // try to estimate - return projectAPI.estimateType(projectName, projectType).then((content) => { - if (!content.isMatched()) { - Log.getLogger().warn('Wanted to configure project as ' + projectType + ' but server replied that this project type is not possible. Keep Blank'); - projectTypeToUse = 'blank'; - } else { - projectTypeToUse = projectType; - } - // matched = true, then continue - return true; - }).then(() => { - // grab project DTO - return projectAPI.getProject(projectName) - }).then((projectDto) => { - // then update the project type - projectDto.setType(projectTypeToUse); - - // source storage - if (sourceStorageDto) { - projectDto.setSource(sourceStorageDto); - } - - return projectDto; - }).then((projectDto) => { - // and perform update of all these attributes - return projectAPI.update(projectName, projectDto); - }); - - - } - - - - - executeCommandsFromCurrentWorkspace(workspaceDto : org.eclipse.che.api.workspace.shared.dto.WorkspaceDto) : Promise { - - let promises : Array> = new Array>(); - let workspaceCommands : Array = workspaceDto.getConfig().getCommands(); - - // get exec-agent URI - let machines = workspaceDto.getRuntime().getMachines(); - let execAgentServer = machines.get("dev-machine").getServers().get("exec-agent/ws"); - let execAgentURI = execAgentServer.getUrl(); - if (execAgentURI.includes("localhost")) { - execAgentURI = execAgentURI.replace("localhost", RemoteIp.ip) - } - let execAgentServiceClientImpl:ExecAgentServiceClientImpl = new ExecAgentServiceClientImpl(this.workspace, this.authData, execAgentURI); - - if (this.chefileStructWorkspace.postload.actions && this.chefileStructWorkspace.postload.actions.length > 0) { - Log.getLogger().info(this.i18n.get("executeCommandsFromCurrentWorkspace.executing")); - } - - this.chefileStructWorkspace.postload.actions.forEach((postLoadingCommand: CheFileStructWorkspaceLoadingAction) => { - let uuid:string = UUID.build(); - - if (postLoadingCommand.command) { - workspaceCommands.forEach((workspaceCommand) => { - if (postLoadingCommand.command === workspaceCommand.name) { - let customCommand:CheFileStructWorkspaceCommand = new CheFileStructWorkspaceCommandImpl(); - customCommand.commandLine = workspaceCommand.commandLine; - customCommand.name = workspaceCommand.name; - customCommand.type = workspaceCommand.type; - customCommand.attributes = workspaceCommand.attributes; - Log.getLogger().debug('Executing post-loading workspace command \'' + postLoadingCommand.command + '\'.'); - promises.push(execAgentServiceClientImpl.executeCommand(customCommand, uuid, false)); - } - }); - } else if (postLoadingCommand.script) { - let customCommand:CheFileStructWorkspaceCommand = new CheFileStructWorkspaceCommandImpl(); - customCommand.commandLine = postLoadingCommand.script; - customCommand.name = 'custom postloading command'; - Log.getLogger().debug('Executing post-loading script \'' + postLoadingCommand.script + '\'.'); - promises.push(execAgentServiceClientImpl.executeCommand(customCommand, uuid, false)); - } - - - }); - - return Promise.all(promises); - } - - - - - buildLocalCheURL() : string { - - // handle special docerk4 mac, docker for windows ip - let ip : string = this.chefileStruct.server.ip; - if (ip === '192.168.65.2' || ip === '10.0.75.2') { - ip = 'localhost'; - } - - return 'http://' + ip + ':' + this.chefileStruct.server.port; - } - - buildLocalIDEUrl() : string { - return this.buildLocalCheURL() + "/dashboard/#/ide/che/local"; - } - - - initCheFolders() { - - // create .che folder - try { - this.fs.mkdirSync(this.dotCheFolder, 0o744); - } catch (e) { - // already exist - } - - // write instance id - this.writeInstanceId(); - - // create .che/workspaces folder - try { - this.fs.mkdirSync(this.workspacesFolder, 0o744); - } catch (e) { - // already exist - } - - } - - writeInstanceId() { - try { - this.fs.writeFileSync(this.dotCheIdFile, this.instanceId); - } catch (e) { - // already exist - } - } - - getCheServerContainerName() : string { - return 'che-server-' + this.instanceId; - } - - cheBoot() : Promise { - - let promise : Promise = new Promise((resolve, reject) => { - let containerVersion : string = new ContainerVersion().getVersion(); - - // create command line to execute - var commandLine: string = 'docker run --rm'; - - // add extra properties - // need to setup che.properties file with workspaces folder - this.chefileStruct.server.properties["CHE_WORKSPACE_VOLUME"] = this.currentFolder + ':/projects/' + this.folderName + ";/var/run/docker.sock:/var/run/docker.sock"; - this.chefileStruct.server.properties["CHE_WORKSPACE_STORAGE"] = this.workspacesFolder; - - for(var property in this.chefileStruct.server.properties){ - let envProperty : string = ' --env ' + property + '=\"' + this.chefileStruct.server.properties[property] + '\"'; - commandLine += envProperty; - } - - // continue with own properties - commandLine += - ' -v /var/run/docker.sock:/var/run/docker.sock' + - ' -v ' + this.cliFolder + ':/data' + - ' -e CHE_PORT=' + this.chefileStruct.server.port + - ' -e CHE_DATA=' + this.workspacesFolder + - ' ' + this.cheLauncherImageName + ':' + containerVersion + ' start --fast'; - - Log.getLogger().debug('Executing command line', commandLine); - - - var child = this.exec(commandLine , (error, stdout, stderr) => { - if (error) { - Log.getLogger().error('Error when starting che with che-launcher: ' + error.toString() + '. exit code was ' + error.code); - Log.getLogger().error('Startup traces were on stdout:\n', stdout.toString()); - Log.getLogger().error('Startup traces were on stderr:\n', stderr.toString()); - } else { - resolve({ - childProcess: child, - stdout: stdout, - stderr: stderr - }); - } - }); - - child.stdout.on('data', (data) => { - Log.getLogger().debug(data.toString()); - }); - - - child.on('exit', (exitCode) => { - if (exitCode == 0) { - resolve('success'); - } else { - reject('process has exited'); - } - - }); - - }); - - return promise; - - } - - - - cheStop() : Promise { - - let promise : Promise = new Promise((resolve, reject) => { - let containerVersion : string = new ContainerVersion().getVersion(); - - var commandLine: string = 'docker run --rm' + - ' -v /var/run/docker.sock:/var/run/docker.sock' + - ' -v ' + this.cliFolder + ':/data' + - ' -e CHE_PORT=' + this.chefileStruct.server.port + - ' ' + this.cheLauncherImageName + ':' + containerVersion + ' stop'; - - Log.getLogger().debug('Executing command line', commandLine); - - - var child = this.exec(commandLine , (error, stdout, stderr) => { - if (error) { - Log.getLogger().error('Error when stopping che with che-launcher: ' + error.toString() + '. exit code was ' + error.code); - Log.getLogger().error('Stopping traces were on stdout:\n', stdout.toString()); - Log.getLogger().error('Stopping traces were on stderr:\n', stderr.toString()); - } else { - resolve({ - childProcess: child, - stdout: stdout, - stderr: stderr - }); - } - }); - - child.stdout.on('data', (data) => { - Log.getLogger().debug(data.toString()); - }); - - - child.on('exit', (exitCode) => { - if (exitCode == 0) { - resolve('success'); - } else { - reject('process has exited'); - } - - }); - - }); - - return promise; - - } - - - checkCheIsNotRunning() : Promise { - var jsonRequest:HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, null, '/api/workspace', 200); - return jsonRequest.request().then((jsonResponse:HttpJsonResponse) => { - return false; - }, (error) => { - // find error when connecting so probably not running - return true; - }); - } - - - checkCheIsRunning() : Promise { - var jsonRequest:HttpJsonRequest = new DefaultHttpJsonRequest(this.authData, null, '/api/workspace', 200); - return jsonRequest.request().then((jsonResponse:HttpJsonResponse) => { - return true; - }, (error) => { - // find error when connecting so probably not running - return false; - }); - } - - - pingCheAction() : void { - var options = { - hostname: this.chefileStruct.server.ip, - port: this.chefileStruct.server.port, - path: '/api/workspace', - method: 'GET', - headers: { - 'Accept': 'application/json, text/plain, */*', - 'Content-Type': 'application/json;charset=UTF-8' - } - }; - - var req = this.http.request(options, (res) => { - res.on('data', (body) => { - Log.getLogger().debug('got rest status code =', res.statusCode); - if (res.statusCode === 200 && !this.waitDone) { - Log.getLogger().debug('got 200 status, stop waiting'); - this.waitDone = true; - } - }); - }); - req.on('error', (e) => { - Log.getLogger().debug('Got error when waiting che boot: ' + e.message); - }); - req.end(); - - } - - - /** - * Loop to send ping action each second and then try to see if we need to wait or not again - */ - loopWaitChePing() : Promise { - return new Promise((resolve, reject) => { - var loop = () => { - this.pingCheAction(); - if (this.waitDone) { - resolve(true); - } else { - Log.getLogger().debug('pinging che was not ready, continue ', this.times, ' times.'); - this.times--; - if (this.times === 0) { - reject('Timeout for pinging Eclipse Che has been reached. Please check logs.'); - } else { - // loop again - setTimeout(loop, 1000); - } - } - }; - process.nextTick(loop); - }); - } - - - - - - /** - * Flatten a JSON object and return a map of string with key and value - * @param prefix the prefix to use in order to flatten given object instance - * @param data the JSON object - * @returns {Map} the flatten map - */ - flatJson(prefix, data) : Map { - var map = new Map(); - - this.recurseFlatten(map, data, prefix); - return map; - } - - - /** - * Recursive method to iterate on elements of a JSON object. - * @param map the map containing the key being the property name and the value the JSON element value - * @param jsonData the data to parse - * @param prop the nme of the property being analyzed - */ - recurseFlatten(map : Map, jsonData: any, prop: string) : void { - - if (Object(jsonData) !== jsonData) { - if (this.isNumber(jsonData)) { - map.set(prop, jsonData); - } else { - map.set(prop, "\"" + jsonData + "\""); - } - } else if (Array.isArray(jsonData)) { - let arr : Array = jsonData; - let l: number = arr.length; - if (l == 0) { - map.set(prop, '[]'); - } else { - for(var i : number =0 ; i { - return this.isInitialized().then((isInitialized) => { - if (!isInitialized) { - return Promise.reject('This directory has not been initialized. So, factory export is not available.'); - } - - return new Promise((resolve, reject) => { - this.parse(); - resolve('parsed'); - }).then(() => { - - // check workspace exists - this.workspace = new Workspace(this.authData); - - // take current Chefile and export it as a factory - - - let factoryToCreate:org.eclipse.che.api.factory.shared.dto.FactoryDto = new org.eclipse.che.api.factory.shared.dto.FactoryDtoImpl(); - - - // get workspace object - let createWorkspaceConfig:CreateWorkspaceConfig = this.buildWorkspaceConfig(); - let workspaceConfigDto:org.eclipse.che.api.workspace.shared.dto.WorkspaceConfigDto = this.workspace.getWorkspaceConfigDto(createWorkspaceConfig); - - factoryToCreate.withV("4.0").withName(this.folderName).withWorkspace(workspaceConfigDto); - - - // add project - let sourceStorageDTO : org.eclipse.che.api.workspace.shared.dto.SourceStorageDto = new org.eclipse.che.api.workspace.shared.dto.SourceStorageDtoImpl(); - - // do we have git there ? - let dotGitFolder : string = this.path.resolve(this.currentFolder, '.git'); - try { - this.fs.statSync(dotGitFolder); - // we have a .git folder - sourceStorageDTO.withType("git"); - - // grab the location URL - let configContent = this.fs.readFileSync(this.path.resolve(dotGitFolder, "config")).toString(); - - var regex = /remote "origin".*?\n.*?url = (.*)/g - ///url = (.*)/g; - var matches = regex.exec(configContent); - if (matches === null) { - return Promise.reject("Found a .git/config file but no remote origin found inside."); - } - let gitURL = matches[1]; - sourceStorageDTO.withLocation(gitURL) ; - - } catch (e) { - return Promise.reject("Factories are only working if there is a project inside. No git metadata has been found"); - } - - let projectDTO : org.eclipse.che.api.workspace.shared.dto.ProjectConfigDto = new org.eclipse.che.api.workspace.shared.dto.ProjectConfigDtoImpl(); - projectDTO.setType(this.chefileStructWorkspace.projects[0].type); - projectDTO.withName(this.folderName).withPath("/" + this.folderName).withSource(sourceStorageDTO); - - workspaceConfigDto.getProjects().push(projectDTO); - - Log.getLogger().info('Factory JSON is :\n' + JSON.stringify(factoryToCreate.toJson(), null, 2)); - return Promise.resolve(true); - }) - }); - - } - - isNumber(n) { - return !isNaN(parseFloat(n)) && isFinite(n); - } - - -} diff --git a/dockerfiles/lib/src/internal/dir/chefile-struct/che-file-struct.ts b/dockerfiles/lib/src/internal/dir/chefile-struct/che-file-struct.ts deleted file mode 100644 index 547e66d1ab35..000000000000 --- a/dockerfiles/lib/src/internal/dir/chefile-struct/che-file-struct.ts +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 class CheFileStruct { - server: CheFileServerStruct; - - constructor() { - this.server = new CheFileServerStruct(); - } -} - -export type CheFileServerTypeStruct = 'local' | 'remote'; - -export class CheFileServerStruct { - - type : CheFileServerTypeStruct; - ip: string; - port: number; - user: string; - pass: string; - startup: Array; - - properties : Map; - - constructor() { - //this.startup = new Array(); - this.properties = new Map(); - } -} - - - -export class CheFileStructWorkspaceCommandAttributes { - previewUrl: string; -} - -export interface CheFileStructWorkspaceCommand { - name: string; - type: string; - commandLine: string; - attributes? : CheFileStructWorkspaceCommandAttributes; -} - -export class CheFileStructWorkspaceCommandImpl implements CheFileStructWorkspaceCommand{ - name: string; - type: string; - commandLine: string; - attributes : CheFileStructWorkspaceCommandAttributes; - - constructor() { - this.type = 'custom'; - this.attributes = new CheFileStructWorkspaceCommandAttributes(); - } -} - - -export class CheFileStructWorkspaceProjectSourceImpl { - attributes : Map; - location: string; - type: string; - - constructor() { - this.attributes = new Map(); - } -} - -export interface CheFileStructWorkspaceProject { - type: string; - name : string; - source : CheFileStructWorkspaceProjectSourceImpl; -} - -export class CheFileStructWorkspaceProjectImpl implements CheFileStructWorkspaceProject{ - type: string; - name : string; - source : CheFileStructWorkspaceProjectSourceImpl; - constructor() { - this.type = 'blank'; - this.source = new CheFileStructWorkspaceProjectSourceImpl(); - } -} - - -export class CheFileStructWorkspace { - - name: string; - - ram: number; - commands : Array; - - postload : CheFileStructWorkspacePostLoad; - - runtime : CheFileStructWorkspaceRuntime; - - projects: Array; - - constructor() { - this.commands = new Array(); - this.projects = new Array(); - this.postload = new CheFileStructWorkspacePostLoad(); - this.runtime = new CheFileStructWorkspaceRuntime(); - // init some commands - for (let i : number = 0; i < 255; i++) { - this.commands[i] = new CheFileStructWorkspaceCommandImpl(); - } - - // init some commands - for (let i : number = 0; i < 255; i++) { - this.projects[i] = new CheFileStructWorkspaceProjectImpl(); - } - - } -} - - -export class CheFileStructWorkspaceRuntimeDocker { - content : string; - image : string; - location: string; - composefile: string; - dockerfile: string; -} - -export class CheFileStructWorkspaceRuntime { - docker : CheFileStructWorkspaceRuntimeDocker; - - constructor() { - this.docker = new CheFileStructWorkspaceRuntimeDocker(); - } -} - -export class CheFileStructWorkspaceLoadingAction { - command: string; - - script : string; -} - -export class CheFileStructWorkspacePostLoad { - actions : Array; - - constructor() { - this.actions = new Array(); - // init some commands - for (let i : number = 0; i < 255; i++) { - this.actions[i] = new CheFileStructWorkspaceLoadingAction(); - } - - } -} \ No newline at end of file diff --git a/dockerfiles/lib/src/internal/test/che-test.ts b/dockerfiles/lib/src/internal/test/che-test.ts deleted file mode 100644 index 2f810e995e16..000000000000 --- a/dockerfiles/lib/src/internal/test/che-test.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -// imports - - -import {Argument} from "../../spi/decorator/parameter"; -import {ArgumentProcessor} from "../../spi/decorator/argument-processor"; -import {PostFlightCheckTest} from "./impl/post-flight-check-test"; -import {Log} from "../../spi/log/log"; -import {ProductName} from "../../utils/product-name"; -/** - * Entrypoint for the Tests. - * @author Florent Benoit - */ -export class CheTest { - - /** - * This test name will be injected automatically. - */ - @Argument({description: "Name of the test to execute"}) - testName : string; - - /** - * Parsing of arguments. - */ - args : Array; - - /** - * Map of tests that are available. - */ - mapOfTests : Map = CheTest.init(); - - static init() : Map { - Log.context = '(' + ProductName.getMiniDisplayName() + ' test)'; - let testMap : Map = new Map(); - testMap.set('post-flight-check', PostFlightCheckTest); - return testMap; - } - - /** - * Analyze the arguments by injecting parameters/arguments and define the list of test classes. - * @param args - */ - constructor(args:Array) { - this.args = ArgumentProcessor.inject(this, args); - } - - /** - * Run this che-test entry point. - * When a test is found, build an instance of the test and call run() method which returns a promise - */ - run() : Promise { - let classOfTest: any = this.mapOfTests.get(this.testName); - if (classOfTest) { - // update logger - Log.context = '(' + ProductName.getMiniDisplayName() + ' test/' + this.testName + ')'; - var instance = new classOfTest(this.args); - return instance.run(); - } else { - // The given test name has not been found, display available actions - Log.getLogger().error("No test exists with provided name '" + this.testName + "'."); - this.help(); - process.exit(1); - } - } - - - - help() : void { - Log.getLogger().info("Available tests are : "); - for (var [key, value] of this.mapOfTests.entries()) { - Log.getLogger().info('\u001b[1m' + key + '\u001b[0m'); - ArgumentProcessor.help(Object.create(value.prototype)); - } - } - -} diff --git a/dockerfiles/lib/src/internal/test/impl/post-flight-check-test.properties b/dockerfiles/lib/src/internal/test/impl/post-flight-check-test.properties deleted file mode 100644 index 6dcd95a9b75c..000000000000 --- a/dockerfiles/lib/src/internal/test/impl/post-flight-check-test.properties +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2016-2017 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 -# - -run.generating=Generating {0} workspace -run.starting-workspace=Starting workspace runtime -run.stopping-workspace=Stopping workspace runtime -run.deleting-workspace=Deleting workspace runtime diff --git a/dockerfiles/lib/src/internal/test/impl/post-flight-check-test.ts b/dockerfiles/lib/src/internal/test/impl/post-flight-check-test.ts deleted file mode 100644 index e35996690ffd..000000000000 --- a/dockerfiles/lib/src/internal/test/impl/post-flight-check-test.ts +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -// imports -import {Parameter} from "../../../spi/decorator/parameter"; -import {AuthData} from "../../../api/wsmaster/auth/auth-data"; -import {Workspace} from "../../../api/wsmaster/workspace/workspace"; -import {ArgumentProcessor} from "../../../spi/decorator/argument-processor"; -import {CreateWorkspaceConfig} from "../../../api/wsmaster/workspace/workspace"; -import {Log} from "../../../spi/log/log"; -import {I18n} from "../../../spi/i18n/i18n"; -import {Message} from "../../../spi/decorator/message"; - -/** - * This class is managing a post-check operation by creating a workspace, starting it and displaying the log data. - * @author Florent Benoit - */ -export class PostFlightCheckTest { - - @Parameter({names: ["-q", "--quiet"], description: "Run in quiet mode for this test."}) - isQuiet : boolean = false; - - @Parameter({names: ["-u", "--user"], description: "Defines the user to be used"}) - username : string; - - @Parameter({names: ["-w", "--password"], description: "Defines the password to be used"}) - password : string; - - @Parameter({names: ["-p", "--port"], description: "Defines the optional port if no url is given"}) - portNumber : number; - - authData: AuthData; - workspace: Workspace; - - @Message('internal/test/impl/post-flight-check-test') - i18n : I18n; - - constructor(args:Array) { - let updatedArgs = ArgumentProcessor.inject(this, args); - - let url: string; - // get options from arguments - if (updatedArgs.length > 0) { - url = updatedArgs[0]; - } - this.authData = new AuthData(url, this.username, this.password); - if (this.portNumber) { - this.authData.getMasterLocation().setPort(this.portNumber); - } - this.workspace = new Workspace(this.authData); - } - - run() : Promise { - // first, login - return this.authData.login().then(() => { - // then create the workspace - let createWorkspaceConfig: CreateWorkspaceConfig = new CreateWorkspaceConfig(); - createWorkspaceConfig.name = 'your-first-workspace'; - Log.getLogger().info(this.i18n.get('run.generating',createWorkspaceConfig.name)); - - return this.workspace.createWorkspace(createWorkspaceConfig) - .then(workspaceDto => { - // then start it - Log.getLogger().info(this.i18n.get('run.starting-workspace')); - return this.workspace.startWorkspace(workspaceDto.getId(), !this.isQuiet); - }).then((workspaceDto) => { - // then stop it - Log.getLogger().info(this.i18n.get('run.stopping-workspace')); - return this.workspace.stopWorkspace(workspaceDto.getId()); - }).then((workspaceDto) => { - // then delete it - Log.getLogger().info(this.i18n.get('run.deleting-workspace')); - return this.workspace.deleteWorkspace(workspaceDto.getId()); - }); - - }); - } - -} diff --git a/dockerfiles/lib/src/spi/ascii/ascii-array-info.ts b/dockerfiles/lib/src/spi/ascii/ascii-array-info.ts deleted file mode 100644 index 829ded6625c8..000000000000 --- a/dockerfiles/lib/src/spi/ascii/ascii-array-info.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -/** - * Provides data about ascii array. - * @author Florent Benoit - */ -export interface AsciiArrayInfo { - - /** - * Provides size of each column. - */ - getColumnsSize() : Array; -} diff --git a/dockerfiles/lib/src/spi/ascii/ascii-array.ts b/dockerfiles/lib/src/spi/ascii/ascii-array.ts deleted file mode 100644 index 9827de2ece1f..000000000000 --- a/dockerfiles/lib/src/spi/ascii/ascii-array.ts +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import {FormatterMode} from "./formatter-mode"; - -/** - * AsciiArray allow to build output arrays and format them in a simple way. - * No need for each command to build its own logic. - * There are CSV, Modern formatters, etc. - * @author Florent Benoit - */ -export interface AsciiArray { - - /** - * Specify the titles for this array - * - * @param columnsTitle - * the given titles - * @return the current array - */ - withTitles(...columnsTitle:Array) : AsciiArray; - - /** - * Specify the columns (containing data) for this array - * - * @param columns - * the given data column - * @return the current array - */ - withColumns(...columns:Array>) : AsciiArray; - - /** - * Specify the rows (containing data) for this array - * - * @param rows - * the given data column - * @return the current array - */ - withListRows(...rows:Array>) : AsciiArray; - - /** - * Specify the rows (containing data) for this array - * - * @param rows - * the given data column - * @return the current array - */ - withRows(rows:Array>) : AsciiArray; - - /** - * Transform the given data into an ascii array - * - * @return stringified table of the array - */ - toAscii() : string; - - /** - * Apply a formatter to this array - * @param formatterMode the name of the formatter - */ - withFormatter(formatterMode:FormatterMode) : AsciiArray; - - /** - * Show or not the title when getting result - * @param showTitles if true, display it - * @returns {DefaultAsciiArray} - */ - withShowTitles(showTitles:boolean) : AsciiArray; - - - /** - * Specify the order and columns that need to be displayed. - * @param columnTitles an array of name of columns - */ - withFormatColumnTitles(...columnTitles:Array) : AsciiArray; - - - /** - * Specify the order and columns that need to be displayed. - * @param columnNames a comma separated list of columns - */ - withFormatColumns(columnNames:string) : AsciiArray; - -} diff --git a/dockerfiles/lib/src/spi/ascii/ascii-form-entry.ts b/dockerfiles/lib/src/spi/ascii/ascii-form-entry.ts deleted file mode 100644 index 63c445b6af9c..000000000000 --- a/dockerfiles/lib/src/spi/ascii/ascii-form-entry.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -/** - * AsciiFormEntry is an entry to {@link AsciiForm} - * @author Florent Benoit - */ -export class AsciiFormEntry { - - /** - * Name of the entry (left display) - */ - private name:string; - - /** - * Value of the entry (right display) - */ - private value:string; - - /** - * Allow to build a new entry by specifying the name and value - * @param name the key - * @param value the value - */ - public constructor(name:string, value:string) { - this.name = name; - this.value = value; - } - - /** - * Provides the value - * @returns {string} - */ - public getValue():string { - return this.value; - } - - - /** - * Provides the name - * @returns {string} - */ - public getName():string { - - return this.name; - } - - - /** - * Allow to compare one ascii form entry to another one - */ - public compareTo(o:AsciiFormEntry):number { - return this.name.localeCompare(o.getName()); - } - -} \ No newline at end of file diff --git a/dockerfiles/lib/src/spi/ascii/ascii-form-info.ts b/dockerfiles/lib/src/spi/ascii/ascii-form-info.ts deleted file mode 100644 index 246e04d5000c..000000000000 --- a/dockerfiles/lib/src/spi/ascii/ascii-form-info.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -/** - * Provides data about ascii forms. - * @author Florent Benoit - */ -export interface AsciiFormInfo { - - /** - * Size of the column for the title (key) - */ - getTitleColumnSize() : number; - - /** - * Provides size of the column for the values - */ - getValueColumnSize() : number; - - /** - * If true, name of the properties need to be uppercase. - */ - isUppercasePropertyName() : boolean; - -} diff --git a/dockerfiles/lib/src/spi/ascii/ascii-form.ts b/dockerfiles/lib/src/spi/ascii/ascii-form.ts deleted file mode 100644 index 4a1968e45c99..000000000000 --- a/dockerfiles/lib/src/spi/ascii/ascii-form.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import {FormatterMode} from "./formatter-mode"; - -/** - * AsciiForm allow to build forms (key, value) with all values being left aligned in a simple way. - * No need for each command to build its own logic. - * There are CSV, Modern formatters, etc. - * @author Florent Benoit - */ - -export interface AsciiForm { - - /** - * Adds a new entry in the form - * @param propertyName the name of the property - * @param propertyValue the value of the property - * @return {@link AsciiForm} - */ - withEntry(propertyName:string, propertyValue:string) : AsciiForm; - - /** - * Order all properties by using alphabetical order. - * @return {@link AsciiForm} - */ - alphabeticalSort() : AsciiForm; - - /** - * Use uppercase for the property name - * @return {@link AsciiForm} - */ - withUppercasePropertyName() : AsciiForm; - - /** - * Allow to pickup formatter - * @param formatterMode - */ - withFormatter(formatterMode:FormatterMode) : AsciiForm; - - /** - * Transform the given form into an ascii form - * - * @return stringified table of the form - */ - toAscii() : string; - -} diff --git a/dockerfiles/lib/src/spi/ascii/ascii-format.ts b/dockerfiles/lib/src/spi/ascii/ascii-format.ts deleted file mode 100644 index 1f9ab9ffeae2..000000000000 --- a/dockerfiles/lib/src/spi/ascii/ascii-format.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -/** - * Provides helper method to format content - * @author Florent Benoit - */ -export class AsciiFormat { - - - /** - * Allow to format values provided as array of string with the formatter - * @param formatter it can include %s, %S (uppercase), %d number, %n carriage return, -%s or -%S for left aligned values - * @param values the values to include in formatted string - * @returns {string} the formatted string - */ - public static format(formatter:string, values:Array):string { - let stringToEval:string = formatter; - let index:number = 0; - return stringToEval.replace(/%((%)|s|S|d|n|-[0-9]*(s|S))/g, (match) => { - var val = null; - - if (index > values.length) { - return "N/A : invalid formatting"; - } - - switch (match[1]) { - case '-': - // number of spaces are all digits after - and before last character - let numberChar:number = 2; - let spaceValue:string = ""; - while (numberChar < match.length - 1) { - spaceValue += match[numberChar]; - numberChar++; - } - - let numberOfSpaces = parseInt(spaceValue); - - val = values[index]; - while (val.length < numberOfSpaces) { - val = val + " "; - } - // uppercase - if (match[match.length - 1] && 'S' === match[match.length - 1]) { - val = val.toUpperCase(); - } - index++; - break; - case 'd': - val = parseFloat(values[index]); - if (isNaN(val)) { - val = 0; - } - index++; - break; - case 'S': - val = values[index].toUpperCase(); - index++; - break; - case 'n': - val = "\n"; - break; - case 's': - val = values[index]; - index++; - break; - } - - return val; - }); - } - -} \ No newline at end of file diff --git a/dockerfiles/lib/src/spi/ascii/ascii-formatter.ts b/dockerfiles/lib/src/spi/ascii/ascii-formatter.ts deleted file mode 100644 index 658c16956da9..000000000000 --- a/dockerfiles/lib/src/spi/ascii/ascii-formatter.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import {AsciiFormInfo} from "./ascii-form-info"; -import {AsciiArrayInfo} from "./ascii-array-info"; - -/** - * Allow to format Ascii Arrays of Ascii Forms - * @author Florent Benoit - */ -export interface AsciiFormatter { - - /** - * If array has a borderline, allow to format it. - * @param asciiArrayInfo the data on the array - */ - getBorderLine(asciiArrayInfo:AsciiArrayInfo) : string; - - /** - * Gets formatter for the given array info - * @param asciiArrayInfo the data on the array - */ - getFormatter(asciiArrayInfo:AsciiArrayInfo) : string; - - /** - * Gets formatter but for the title (which can be different) - * @param asciiArrayInfo the data on the array - */ - getTitleFormatter(asciiArrayInfo:AsciiArrayInfo) : string; - - /** - * Format the title of a ascii form - * @param name the name to format - * @param asciiFormInfo data about the form - */ - formatFormTitle(name:string, asciiFormInfo:AsciiFormInfo) : string; - - /** - * Format the value of a ascii form - * @param value the name to format - * @param asciiFormInfo data about the form - */ - formatFormValue(value:string, asciiFormInfo:AsciiFormInfo) : string; - -} - - diff --git a/dockerfiles/lib/src/spi/ascii/csv-formatter.ts b/dockerfiles/lib/src/spi/ascii/csv-formatter.ts deleted file mode 100644 index 042e3252170d..000000000000 --- a/dockerfiles/lib/src/spi/ascii/csv-formatter.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import {AsciiFormatter} from "./ascii-formatter"; -import {AsciiArrayInfo} from "./ascii-array-info"; -import {AsciiFormInfo} from "./ascii-form-info"; - -/** - * CSV formatter - * @author Florent Benoit - */ -export class CSVFormatter implements AsciiFormatter { - - - /** - * No border for CSV formatter - * @param asciiArrayInfo - * @return empty - */ - getBorderLine(asciiArrayInfo:AsciiArrayInfo):string { - return null; - } - - /** - * Provides comma separated list of values - * @returns {string} - */ - getFormatter(asciiArrayInfo:AsciiArrayInfo):string { - - let value = ""; - let size:number = asciiArrayInfo.getColumnsSize().length; - for (let c:number = 1; c <= size; c++) { - value += "%s"; - if (c < size) { - value += ","; - } - } - value += "%n"; - return value; - } - - /** - * Provides comma separated list of values for title as well (with uppercase) - * @returns {string} - */ - getTitleFormatter(asciiArrayInfo:AsciiArrayInfo):string { - let value = ""; - let size:number = asciiArrayInfo.getColumnsSize().length; - for (let c:number = 1; c <= size; c++) { - // uppercase - value += "%S"; - if (c < size) { - value += ","; - } - } - value += "%n"; - return value; - } - - /** - * Do not format forms - */ - formatFormTitle(name:string, asciiFormInfo:AsciiFormInfo):string { - return null; - } - - /** - * Do not format forms - */ - formatFormValue(value:string, asciiFormInfo:AsciiFormInfo):string { - return null; - } - -} \ No newline at end of file diff --git a/dockerfiles/lib/src/spi/ascii/default-ascii-array.spec.ts b/dockerfiles/lib/src/spi/ascii/default-ascii-array.spec.ts deleted file mode 100644 index 5164ee0f27c9..000000000000 --- a/dockerfiles/lib/src/spi/ascii/default-ascii-array.spec.ts +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import {DefaultAsciiArray} from "./default-ascii-array"; -import {AsciiArray} from "./ascii-array"; -let expect = require('chai').expect; - -/** - * Provides Unit Tests for AsciiArray - * @author Florent Benoit - */ -describe("AsciiArray tests", () => { - - it("testEmptyArray", () => { - - let asciiArray:DefaultAsciiArray = new DefaultAsciiArray(); - let result:string = asciiArray.toAscii(); - expect(result.length).to.equal(0); - expect(result).to.equal(""); - }); - - it("testColumnsSize", () => { - - let column1:Array = ["a", "ab", "abc", "a"]; - - let asciiArray:DefaultAsciiArray = new DefaultAsciiArray(); - asciiArray.withColumns(column1); - let columnsSize:Array = asciiArray.getColumnsSize(); - - expect(columnsSize).to.exist; - expect(columnsSize.length).to.equal(1); - expect(columnsSize[0]).to.equal(3); - }); - - - it("testColumnsSizeTwoColumns", () => { - - let column1:Array = ["a", "ab", "abcdef", " abcdef "]; - let column2:Array = ["defgh", "d", "e", "f"]; - - let asciiArray:DefaultAsciiArray = new DefaultAsciiArray(); - asciiArray.withColumns(column1, column2); - let columnsSize:Array = asciiArray.getColumnsSize(); - - expect(columnsSize).to.exist; - expect(columnsSize.length).to.equal(2); - expect(columnsSize[0]).to.equal(8); - expect(columnsSize[1]).to.equal(5); - }); - - - it("testColumnsSizeWihTitle", () => { - - let column1:Array = ["a", "ab", "abcdef", " abcdef "]; - let column2:Array = ["defgh", "d", "e", "f"]; - - let asciiArray:DefaultAsciiArray = new DefaultAsciiArray(); - asciiArray.withColumns(column1, column2).withTitles("Col1", " My Column 2"); - let columnsSize:Array = asciiArray.getColumnsSize(); - - expect(columnsSize).to.exist; - expect(columnsSize.length).to.equal(2); - expect(columnsSize[0]).to.equal(8); - expect(columnsSize[1]).to.equal(12); - }); - - - it("testTwoColumnsWithTitleCsvFormatter", () => { - - let column1:Array = ["row1", "row2", "row3"]; - let column2:Array = ["1", "2", "3"]; - - let asciiArray:DefaultAsciiArray = new DefaultAsciiArray(); - asciiArray.withColumns(column1, column2).withTitles("name", "id").withFormatter("CSV"); - - let result:string = asciiArray.toAscii(); - - expect(result).to.equal("NAME,ID\nrow1,1\nrow2,2\nrow3,3"); - }); - - it("testTwoRowsWithTitleCsvFormatter", () => { - - let row1:Array = ["hello1", "hello2", "hello3"]; - let row2:Array = ["another1", "another2", "another3"]; - - let asciiArray:DefaultAsciiArray = new DefaultAsciiArray(); - asciiArray.withListRows(row1, row2).withTitles("name1", "name2", "name3").withFormatter("CSV"); - - let result:string = asciiArray.toAscii(); - - expect(result).to.equal("NAME1,NAME2,NAME3\nhello1,hello2,hello3\nanother1,another2,another3"); - }); - - - it("testTwoColumnsWithTitleModernFormatter", () => { - - let column1:Array = ["row1", "row2", "row3"]; - let column2:Array = ["1", "2", "3"]; - - let asciiArray:DefaultAsciiArray = new DefaultAsciiArray(); - asciiArray.withColumns(column1, column2).withTitles("name", "id").withFormatter("MODERN"); - - let result:string = asciiArray.toAscii(); - - expect(result).to.equal("NAME ID \nrow1 1 \nrow2 2 \nrow3 3 "); - }); - - - it("testTwoRowsWithTitleModernFormatter", () => { - - let row1:Array = ["hello1", "hello2", "hello3"]; - let row2:Array = ["another1", "another2", "another3"]; - - let asciiArray:DefaultAsciiArray = new DefaultAsciiArray(); - asciiArray.withListRows(row1, row2).withTitles("name1", "name2", "name3").withFormatter("MODERN"); - - let result:string = asciiArray.toAscii(); - - expect(result).to.equal("NAME1 NAME2 NAME3 \nhello1 hello2 hello3 \nanother1 another2 another3 "); - }); - - - it("testTwoRowsWithTitleLongDataColumnModernFormatter", () => { - - let row1:Array = ["local", "workspace1x42j3pjczrnnqdr", "RUNNING"]; - - let asciiArray:DefaultAsciiArray = new DefaultAsciiArray(); - asciiArray.withListRows(row1).withTitles("name", "id", "status").withFormatter("MODERN"); - - let result:string = asciiArray.toAscii(); - - expect(result).to.equal("NAME ID STATUS \nlocal workspace1x42j3pjczrnnqdr RUNNING "); - }); - - - it("testSkipTitleCsvFormatter", () => { - - let row1:Array = ["id1", "name1", "status1"]; - - let asciiArray:DefaultAsciiArray = new DefaultAsciiArray(); - asciiArray.withListRows(row1).withTitles("id", "name", "status very long").withShowTitles(false).withFormatter('CSV'); - - let result:string = asciiArray.toAscii(); - - expect(result).to.equal("id1,name1,status1"); - }); - - - it("testCustomOrderingCsvFormatter", () => { - - let row1:Array = ["id1", "name1", "status1"]; - let row2:Array = ["id2", "name2", "status2"]; - - let asciiArray:DefaultAsciiArray = new DefaultAsciiArray(); - asciiArray.withListRows(row1, row2).withTitles("id", "name", "status").withFormatter("CSV").withFormatColumnTitles("status", "id"); - - let result:string = asciiArray.toAscii(); - - expect(result).to.equal("STATUS,ID\nstatus1,id1\nstatus2,id2"); - }); - - - it("testCustomOrderingCommaSeparatedCsvFormatter", () => { - - let row1:Array = ["id1", "name1", "status1"]; - let row2:Array = ["id2", "name2", "status2"]; - - let asciiArray:DefaultAsciiArray = new DefaultAsciiArray(); - asciiArray.withListRows(row1, row2).withTitles("id", "name", "status").withFormatter("CSV").withFormatColumns("status,NAME"); - - let result:string = asciiArray.toAscii(); - - expect(result).to.equal("STATUS,NAME\nstatus1,name1\nstatus2,name2"); - }); - - -}); diff --git a/dockerfiles/lib/src/spi/ascii/default-ascii-array.ts b/dockerfiles/lib/src/spi/ascii/default-ascii-array.ts deleted file mode 100644 index 34e8177e2744..000000000000 --- a/dockerfiles/lib/src/spi/ascii/default-ascii-array.ts +++ /dev/null @@ -1,528 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import {AsciiFormatter} from "./ascii-formatter"; -import {FormatterMode} from "./formatter-mode"; -import {CSVFormatter} from "./csv-formatter"; -import {AsciiArray} from "./ascii-array"; -import {AsciiArrayInfo} from "./ascii-array-info"; -import {AsciiFormat} from "./ascii-format"; -import {ModernFormatter} from "./modern-formatter"; - - -/** - * Implementation of {@link AsciiArray} - * @author Florent Benoit - */ -export class DefaultAsciiArray implements AsciiArray { - - /** - * Columns of this array - */ - private columns:Array>; - - /** - * Columns of this array - */ - private rows:Array>; - - /** - * Titles of each column (if any) - */ - private titles:Array; - - /** - * Formatters. - */ - private formatters:Map; - - /** - * Formatter - */ - private formatterMode:FormatterMode; - - - /** - * Show the titles. - */ - private showTitles:boolean = true; - - - /** - * Order and name of column titles - */ - private formatColumnTitles:Array; - - - /** - * Used when rendering. number of columns to render. - */ - private numberOfColumns:number; - - /** - * Used when rendering. - */ - private columnMapping:Array; - - - /** - * Default constructor - */ - public constructor() { - this.columns = new Array>(); - this.rows = new Array>(); - this.titles = new Array(); - this.formatters = new Map(); - this.formatColumnTitles = new Array(); - //this.formatters.se(EIGHTIES, new EightiesFormatter()); - this.formatters.set('MODERN', new ModernFormatter()); - this.formatters.set('CSV', new CSVFormatter()); - this.columnMapping = new Array(); - this.formatterMode = 'MODERN'; - } - - /** - * Specify the titles for this array - * - * @param columnsTitle - * the given titles - * @return the current array - */ - - public withTitles(...columnsTitle:Array):AsciiArray { - this.titles = columnsTitle; - return this; - } - - - /** - * Specify the columns (containing data) for this array - * - * @param columns - * the given data column - * @return the current array - */ - - public withColumns(...columns:Array>):AsciiArray { - if (this.rows.length > 0) { - throw new Error("Array is already built with columns, cannot mix both inputs"); - } - - columns.forEach((column) => { - this.addColumn(column); - }); - return this; - } - - /** - * Specify the rows (containing data) for this array - * - * @param rows - * the given data column - * @return the current array - */ - - public withRows(rows:Array>):AsciiArray { - if (this.columns.length > 0) { - throw new Error("Array is already built with columns, cannot mix both inputs"); - } - rows.forEach((row) => { - this.addRow(row); - }); - return this; - } - - /** - * Specify the rows (containing data) for this array - * - * @param rows - * the given data column - * @return the current array - */ - - public withListRows(...rows:Array>):AsciiArray { - if (this.columns.length > 0) { - throw new Error("Array is already built with columns, cannot mix both inputs"); - } - rows.forEach((row) => { - this.addRow(row); - }); - return this; - } - - /** - * Add the given column - * - * @param column - * the column - */ - protected addColumn(column:Array):void { - this.columns.push(column); - } - - - /** - * Add the given row - * - * @param row - * the row - */ - protected addRow(row:Array):void { - this.rows.push(row); - } - - - /** - * Checks that the array is valid before trying to get its stringified version - */ - protected checkIntegrity():void { - // check that columns have the same row length - if (this.columns.length > 0) { - let size:number = this.columns[0].length; - - this.columns.forEach((column) => { - if (column.length != size) { - throw new Error("The columns have not the same sized. : " + column.length + " vs " + size); - } - }); - - // if there are titles check that we've the same number of columns - if (this.titles) { - if (this.columns.length > 0) { - if (this.titles.length != this.columns.length) { - throw new Error( - "Invalid expected titles. There are " + this.columns.length + " while there are " + this.titles.length + " titles."); - } - } - } - - } - } - - - /** - * Transform the given data into an ascii array - * - * @return stringified table of the array - */ - - public toAscii():string { - - // check - this.checkIntegrity(); - - // handle empty - if (this.columns.length === 0 && this.rows.length === 0) { - return ""; - } - - // compute mapping - this.computeMapping(); - - // first line is the border - let computeBorder:string = this.getBorderLine(); - let beginBorderLine:string; - let endBorderLine:string; - if (computeBorder != null) { - beginBorderLine = computeBorder + "%n"; - endBorderLine = computeBorder; - } else { - beginBorderLine = ""; - endBorderLine = ""; - } - - let buffer:string = beginBorderLine; - let formatter:string = this.getFormatter(); - let titleFormatter:string = this.getTitleFormatter(); - - // now add titles if any - if (this.titles.length > 0 && this.showTitles) { - let value:Array = this.titles; - if (this.formatColumnTitles.length > 0) { - value = this.getMappingRow(value); - } - - - buffer += AsciiFormat.format(titleFormatter, value); - - - buffer += beginBorderLine; - } - - // data ? - if (this.rows.length > 0) { - this.rows.forEach((row) => { - if (this.formatColumnTitles.length > 0) { - row = this.getMappingRow(row); - } - - buffer += AsciiFormat.format(formatter, row); - }); - buffer += endBorderLine; - - } - - - if (this.columns.length > 0) { - let nbRows:number = this.columns[0].length; - - - for (let row:number = 0; row < nbRows; row++) { - let rowElements = this.getRow(row); - if (this.formatColumnTitles.length > 0) { - rowElements = this.getMappingRow(rowElements); - } - buffer += AsciiFormat.format(formatter, rowElements); - } - buffer += endBorderLine; - } - - - if (buffer.length > 0 && buffer.slice(-1) === '\n') { - // remove it - buffer = buffer.slice(0, -1); - } - - return buffer; - - } - - /** - * Extract columns from the existing row - * @param row the row to analyze and extract and sort column - * @returns {Array} - */ - protected getMappingRow(row:Array):Array { - let mapped:Array = new Array(); - for (let i = 0; i < this.numberOfColumns; i++) { - mapped.push(row[this.columnMapping[i]]); - } - return mapped; - } - - /** - * Get content of a selected row for the given array - * - * @param index - * the index in the columns - * @return the content - */ - protected getRow(index:number):Array { - let row:Array = new Array(); - let i:number = 0; - this.columns.forEach((column) => { - row[i++] = column[index]; - }); - return row; - } - - /** - * @return formatter - */ - protected getFormatterMode():AsciiFormatter { - return this.formatters.get(this.formatterMode); - } - - protected getArrayInfo():AsciiArrayInfo { - return new MyAsciiArrayInfo(this); - } - - /** - * @return formatter used to format row content - */ - protected getFormatter():string { - return this.getFormatterMode().getFormatter(this.getArrayInfo()); - } - - /** - * @return formatter used to format title content - */ - protected getTitleFormatter():string { - return this.getFormatterMode().getTitleFormatter(this.getArrayInfo()); - } - - - /** - * @return value used as border of the array - */ - protected getBorderLine():string { - return this.getFormatterMode().getBorderLine(this.getArrayInfo()); - } - - - /** - * Compute a mapping between existing columns and the columns that need to be displayed. - */ - protected computeMapping():void { - if (this.formatColumnTitles.length > 0) { - this.numberOfColumns = this.formatColumnTitles.length; - - // compute column ordering. - for (let column:number = 0; column < this.numberOfColumns; column++) { - // indexOf - - var foundIndex = -1; - this.titles.some((element, i) => { - if (this.formatColumnTitles[column].toLowerCase() === element.toLowerCase()) { - foundIndex = i; - return true; - } - }); - if (foundIndex === -1) { - throw new Error("There is no column with name '" + this.formatColumnTitles[column] + "'. Existing names are " + this.titles); - } - this.columnMapping[column] = foundIndex; - } - - } else { - if (this.rows.length > 0) { - this.numberOfColumns = this.rows[0].length; - } else { - this.numberOfColumns = this.columns.length; - } - for (let column:number = 0; column < this.numberOfColumns; column++) { - // no mapping - this.columnMapping[column] = column; - } - - } - } - - /** - * @return the size of the column (by searching max size of each column, including title) - */ - public getColumnsSize():Array { - let lengths:Array = new Array(); - - // Array with rows input - if (this.rows.length > 0) { - - - // column number is first row length - for (let column:number = 0; column < this.numberOfColumns; column++) { - // for each column, set the max length - let maxLength:number = 0; - - // for title - if (this.titles && this.titles.length > 0 && this.showTitles) { - let currentLength:number = this.titles[this.columnMapping[column]].length; - if (currentLength > maxLength) { - maxLength = currentLength; - } - } - - this.rows.forEach((row) => { - let currentLength = row[this.columnMapping[column]].length; - if (currentLength > maxLength) { - maxLength = currentLength; - } - - }); - - lengths.push(maxLength); - - - } - } - - // Array with columns input - if (this.columns.length > 0) { - for (let column:number = 0; column < this.columns.length; column++) { - // for each column, set the max length - let maxLength:number = 0; - - // for title - if (this.titles && this.titles.length > 0 && this.showTitles) { - let currentLength:number = this.titles[column].length; - if (currentLength > maxLength) { - maxLength = currentLength; - } - } - - // for content - let columnData:Array = this.columns[column]; - columnData.forEach((row) => { - let currentLength:number = row.length; - if (currentLength > maxLength) { - maxLength = currentLength; - } - }); - lengths.push(maxLength); - } - } - - return lengths; - - } - - public withFormatter(formatterMode:FormatterMode):AsciiArray { - if (!formatterMode) { - return this; - } - - if (formatterMode !== 'CSV' && formatterMode !== 'MODERN') { - throw new Error("The formatter mode " + formatterMode + " is not supported. Current support is CSV or MODERN.") - } - - this.formatterMode = formatterMode; - return this; - } - - /** - * Show or not the title when getting result - * @param showTitles if true, display it - * @returns {DefaultAsciiArray} - */ - withShowTitles(showTitles:boolean):AsciiArray { - if (!showTitles) { - this.showTitles = false; - } - return this; - } - - /** - * Specify the order and columns that need to be displayed. - * @param columnTitles an array of name of columns - */ - withFormatColumnTitles(...columnTitles:Array):AsciiArray { - this.formatColumnTitles = columnTitles; - return this; - } - - - /** - * Specify the order and columns that need to be displayed. - * @param columnNames a comma separated list of columns - */ - withFormatColumns(columnNames:string):AsciiArray { - if (columnNames) { - this.formatColumnTitles = columnNames.split(","); - } - return this; - } - - -} - -/** - * Inner class with column size data. - */ -export class MyAsciiArrayInfo implements AsciiArrayInfo { - private array:DefaultAsciiArray; - - constructor(array:DefaultAsciiArray) { - this.array = array; - } - - public getColumnsSize():Array { - return this.array.getColumnsSize(); - } -} diff --git a/dockerfiles/lib/src/spi/ascii/default-ascii-form.spec.ts b/dockerfiles/lib/src/spi/ascii/default-ascii-form.spec.ts deleted file mode 100644 index a37fd45f22af..000000000000 --- a/dockerfiles/lib/src/spi/ascii/default-ascii-form.spec.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import {DefaultAsciiForm} from "./default-ascii-form"; -import {AsciiForm} from "./ascii-form"; -let expect = require('chai').expect; - -/** - * Provides Unit Tests for AsciiForm - * @author Florent Benoit - */ - -describe("AsciiForm tests", () => { - - it("testEmptyForm", () => { - - let asciiForm:DefaultAsciiForm = new DefaultAsciiForm(); - let result:string = asciiForm.toAscii(); - expect(result.length).to.equal(0); - expect(result).to.equal(""); - }); - - - it("testOneLineForm", () => { - - let asciiForm:AsciiForm = new DefaultAsciiForm().withEntry("id", "value1"); - let result:string = asciiForm.toAscii(); - expect(result.length).to.above(0); - expect(result).to.equal("id value1"); - }); - - - - it("testThreeLinesFormUppercase", () => { - - let asciiForm:AsciiForm = new DefaultAsciiForm().withEntry("id", "value1").withEntry("a very long Id", "123456789").withEntry("short id", "abc").withUppercasePropertyName(); - let result:string = asciiForm.toAscii(); - expect(result.length).to.above(0); - expect(result).to.equal("ID value1\n" + "A VERY LONG ID 123456789\n" + - "SHORT ID abc"); - }); - - -}); diff --git a/dockerfiles/lib/src/spi/ascii/default-ascii-form.ts b/dockerfiles/lib/src/spi/ascii/default-ascii-form.ts deleted file mode 100644 index e2adc9ad74e8..000000000000 --- a/dockerfiles/lib/src/spi/ascii/default-ascii-form.ts +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import {AsciiForm} from "./ascii-form"; -import {FormatterMode} from "./formatter-mode"; -import {AsciiFormatter} from "./ascii-formatter"; -import {CSVFormatter} from "./csv-formatter"; -import {AsciiFormInfo} from "./ascii-form-info"; -import {AsciiFormEntry} from "./ascii-form-entry"; -import {ModernFormatter} from "./modern-formatter"; - -/** - * Default implementation of {@link AsciiForm} - * @author Florent Benoit - */ -export class DefaultAsciiForm implements AsciiForm { - - private entries:Array; - - private alphabeticalSortValue:boolean = false; - - private uppercasePropertyName:boolean = false; - - /** - * Formatters. - */ - private formatters:Map; - - /** - * Formatter - */ - private formatterMode:FormatterMode; - - /** - * Default constructor - */ - public constructor() { - this.entries = new Array(); - this.formatters = new Map(); - this.formatters.set('MODERN', new ModernFormatter()); - this.formatters.set('CSV', new CSVFormatter()); - - this.formatterMode = 'MODERN'; - } - - - /** - * Adds a new entry in the form - * - * @param propertyName - * the name of the property - * @param propertyValue - * the value of the property - * @return {@link com.codenvy.cli.command.builtin.util.ascii.AsciiForm} - */ - - public withEntry(propertyName:string, propertyValue:string):AsciiForm { - this.entries.push(new AsciiFormEntry(propertyName, propertyValue)); - return this; - } - - /** - * Order all properties by using alphabetical order. - * - * @return {@link com.codenvy.cli.command.builtin.util.ascii.AsciiForm} - */ - public alphabeticalSort():AsciiForm { - this.alphabeticalSortValue = true; - return this; - } - - /** - * Use uppercase for the property name - * - * @return {@link com.codenvy.cli.command.builtin.util.ascii.AsciiForm} - */ - - public withUppercasePropertyName():AsciiForm { - this.uppercasePropertyName = true; - return this; - } - - - public withFormatter(formatterMode:FormatterMode):AsciiForm { - this.formatterMode = formatterMode; - return this; - } - - /** - * Transform the given form into an ascii form - * - * @return stringified table of the form - */ - - public toAscii():string { - // compute each line - - // sort entries if alphabetical sort - if (this.alphabeticalSort) { - //Collections.sort(entries); - } - - let output:string = ""; - - this.entries.forEach((entry) => { - // first get title - let title:string = this.getFormatterMode().formatFormTitle(entry.getName(), new MyAsciiFormInfo(this)); - let value:string = this.getFormatterMode().formatFormValue(entry.getValue(), new MyAsciiFormInfo(this)); - output += title + value + "\n"; - }); - - if (output.length > 0 && output.slice(-1) === '\n') { - // remove it - output = output.slice(0, -1); - } - - return output; - - } - - /** - * @return formatter - */ - protected getFormatterMode():AsciiFormatter { - return this.formatters.get(this.formatterMode); - } - - - public getTitleColumnSize():number { - let length:number = 0; - this.entries.forEach((entry) => { - // length is without ansi - length = Math.max(length, entry.getName().length); - }); - return length; - } - - public getValueColumnSize():number { - let length:number = 0; - this.entries.forEach((entry) => { - // length is without ansi - length = Math.max(length, entry.getValue().length); - }); - - return length; - } - - public isUppercasePropertyName():boolean { - return this.uppercasePropertyName; - } - -} -export class MyAsciiFormInfo implements AsciiFormInfo { - private form:DefaultAsciiForm; - - public constructor(form:DefaultAsciiForm) { - this.form = form; - } - - - public getTitleColumnSize():number { - return this.form.getTitleColumnSize(); - } - - public getValueColumnSize():number { - return this.form.getValueColumnSize(); - } - - public isUppercasePropertyName():boolean { - return this.form.isUppercasePropertyName(); - } -} \ No newline at end of file diff --git a/dockerfiles/lib/src/spi/ascii/formatter-mode.ts b/dockerfiles/lib/src/spi/ascii/formatter-mode.ts deleted file mode 100644 index b87dc95802b8..000000000000 --- a/dockerfiles/lib/src/spi/ascii/formatter-mode.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -/** - * Possible modes of formatters - * @author Florent Benoit - */ -export type FormatterMode = 'MODERN' | 'CSV' diff --git a/dockerfiles/lib/src/spi/ascii/modern-formatter.ts b/dockerfiles/lib/src/spi/ascii/modern-formatter.ts deleted file mode 100644 index d33a2ad2b4b0..000000000000 --- a/dockerfiles/lib/src/spi/ascii/modern-formatter.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import {AsciiFormatter} from "./ascii-formatter"; -import {AsciiArrayInfo} from "./ascii-array-info"; -import {AsciiFormInfo} from "./ascii-form-info"; -import {AsciiFormat} from "./ascii-format"; - -/** - * Modern formatter with spaces (2 spaces) between columns and left-aligned values. - */ -export class ModernFormatter implements AsciiFormatter { - - - /** - * No border for modern formatter - * @param asciiArrayInfo - * @return empty - */ - - public getBorderLine(asciiArrayInfo:AsciiArrayInfo):string { - return null; - } - - - public getFormatter(asciiArrayInfo:AsciiArrayInfo):string { - let buffer:string = ""; - - asciiArrayInfo.getColumnsSize().forEach((columnSize) => { - buffer += "%-" + columnSize + "s"; - buffer += " "; - }); - buffer += "%n"; - - return buffer; - - } - - public getTitleFormatter(asciiArrayInfo:AsciiArrayInfo):string { - let buffer:string = ""; - - asciiArrayInfo.getColumnsSize().forEach((columnSize) => { - // uppercase - buffer += "%-" + columnSize + "S"; - buffer += " "; - }); - buffer += "%n"; - - return buffer; - - } - - - public formatFormTitle(name:string, asciiFormInfo:AsciiFormInfo):string { - let entryName:string = name; - - // format it - let flag:string = "s"; - if (asciiFormInfo.isUppercasePropertyName()) { - flag = "S"; - } - return AsciiFormat.format("%-" + (asciiFormInfo.getTitleColumnSize()) + flag, [name]); - } - - - public formatFormValue(value:string, asciiFormInfo:AsciiFormInfo):string { - if (!value) { - return " "; - } - - // just adding text after adding a space - return " " + value; - } - -} diff --git a/dockerfiles/lib/src/spi/decorator/argument-processor.ts b/dockerfiles/lib/src/spi/decorator/argument-processor.ts deleted file mode 100644 index fa5c28f4febc..000000000000 --- a/dockerfiles/lib/src/spi/decorator/argument-processor.ts +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import {ArgumentTypeDesc} from "./parameter"; -import {ParameterTypeDesc} from "./parameter"; -import {Log} from "../log/log"; -import {DefaultAsciiForm} from "../ascii/default-ascii-form"; -import {AsciiForm} from "../ascii/ascii-form"; - -/** - * Manage the injection of annotations @Parameter or @Argument - * @author Florent Benoit - */ -export class ArgumentProcessor { - - - static displayHelp(metadataArguments:Array , metadataParameters:Array) : void { - // display help menu - let asciiFormParameters : AsciiForm = new DefaultAsciiForm(); - if (metadataParameters && metadataParameters.length > 0) { - asciiFormParameters.withEntry(" Parameters:", ""); - metadataParameters.forEach((metadataParameter) => { - let val = ""; - if (metadataParameter.type !== 'Boolean') { - val = "=" - } - asciiFormParameters.withEntry(" [" + metadataParameter.names + "]" + val, metadataParameter.description); - }); - } - - if (metadataArguments && metadataArguments.length > 0) { - - asciiFormParameters.withEntry(" Arguments:", ""); - metadataArguments.forEach((metadataArgument) => { - asciiFormParameters.withEntry(" <" + metadataArgument.fieldName + ">", metadataArgument.description); - }); - } - Log.getLogger().log("multiline:direct", asciiFormParameters.toAscii()); - } - - static help(object : any) : void { - var metadataArguments:Array = object.__arguments; - var metadataParameters:Array = object.__parameters; - ArgumentProcessor.displayHelp(metadataArguments, metadataParameters); - } - - - static inject(object : any, args: Array) : Array { - var metadataArguments:Array = object.__arguments; - var metadataParameters:Array = object.__parameters; - - var updatedArgs:Array = args; - if (!updatedArgs) { - updatedArgs = new Array(); - } - - // handle special help feature - if (updatedArgs.length == 1 && ('--help' === updatedArgs[0] || 'help' === updatedArgs[0])) { - ArgumentProcessor.displayHelp(metadataArguments, metadataParameters); - process.exit(0); - } - - - var optionsEnabled : Array = new Array(); - - // loop on each argument - if (metadataParameters) { - var i : number = 0; - while (i < updatedArgs.length) { - - var currentArg : string = updatedArgs[i]; - Log.getLogger().debug('checking currentArg', currentArg); - - - metadataParameters.forEach((metadataParameter) => { - metadataParameter.names.forEach((name) => { - - Log.getLogger().debug('checking metadataParameter', name + '=', 'against', currentArg); - - // toggle like '--p=value' - if (ArgumentProcessor.startsWith(currentArg, name + '=')) { - Log.getLogger().debug('it is equals to name='); - // need to split key from value as it's --key=value - let splitter:string[] = currentArg.split("="); - let value = splitter[1]; - object[metadataParameter.fieldName] = value; - optionsEnabled.push(name + '(' + metadataParameter.description + ') =>' + value); - Log.getLogger().debug('= removedOptionsArgs before', updatedArgs, 'with index=', i); - updatedArgs.splice(i, 1); - i--; - Log.getLogger().debug('= match removedOptionsArgs after', updatedArgs, 'with index=', i); - Log.getLogger().debug('= match is object[metadataParameter.fieldName] ', object[metadataParameter.fieldName] ); - } else if (name === currentArg && ArgumentProcessor.startsWith(currentArg, '-')) { - // like -a - if (metadataParameter.type === 'Boolean') { - object[metadataParameter.fieldName] = true; - updatedArgs.splice(i, 1); - i--; - } else { - object[metadataParameter.fieldName] = updatedArgs[i +1]; - updatedArgs.splice(i, 2); - i = i-2; - } - optionsEnabled.push(name + '(' + metadataParameter.description + ') =>' + object[metadataParameter.fieldName]); - - } else if (currentArg === name) { - // flag is matching exact argument without value - Log.getLogger().debug('exact match is', name, 'for currentArg', currentArg); - if (metadataParameter.type === 'Boolean') { - object[metadataParameter.fieldName] = true; - } - Log.getLogger().debug('exact match is object[metadataParameter.fieldName] ', metadataParameter.fieldName); - optionsEnabled.push(name + '(' + metadataParameter.description + ') =>' + object[metadataParameter.fieldName]); - Log.getLogger().debug('exact match removedOptionsArgs before', updatedArgs, 'with index=', i); - updatedArgs.splice(i, 1); - i--; - Log.getLogger().debug('exact match removedOptionsArgs and after we have', updatedArgs); - } - - }); - - }); - i++; - } - - } - - // display sum up of what has been processed - if (optionsEnabled.length > 0) { - optionsEnabled.forEach((option) => { - Log.getLogger().debug(option); - }); - } - - Log.getLogger().debug('start metadata arguments with args', updatedArgs); - - // we have arguments, needs to fill them - if (metadataArguments) { - metadataArguments.forEach((argument) => { - // we're requiring an argument but it's not there - if (updatedArgs.length == 0) { - Log.getLogger().error('Expecting mandatory argument : ' + argument.description); - ArgumentProcessor.displayHelp(metadataArguments, metadataParameters); - if (object.help) { - object.help(); - } - process.exit(1); - } - - object[argument.fieldName] = updatedArgs[0]; - // shift args - updatedArgs = updatedArgs.slice(1); - }) - } - - Log.getLogger().debug('end metadata arguments with args', updatedArgs); - - return updatedArgs; - } - - - static startsWith(value:string, searchString: string) : boolean { - if (!value) { - return false; - } - if (!searchString) { - return false; - } - return value.substr(0, searchString.length) === searchString; - } - - static contains(a : Array, obj : any) : boolean{ - for (var i = 0; i < a.length; i++) { - if (a[i] === obj) { - return true; - } - } - return false; -} - -} \ No newline at end of file diff --git a/dockerfiles/lib/src/spi/decorator/message.ts b/dockerfiles/lib/src/spi/decorator/message.ts deleted file mode 100644 index e33295a07e2b..000000000000 --- a/dockerfiles/lib/src/spi/decorator/message.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import 'reflect-metadata'; -import {I18n} from "../i18n/i18n"; -import {Log} from "../log/log"; - - - -/** - * Handle annotation/decorator for the Message - * @param propertyKey - * @returns {function(any, string, PropertyDescriptor): undefined} - */ -export function Message(key: string) : any { - return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => { - - var t = Reflect.getMetadata("design:type", target, propertyKey); - - let path: any = require('path'); - - // get file - let rootFolder : string = path.resolve(path.resolve(__dirname, '..' + path.sep), '..' + path.sep); - let filename : string = path.resolve(rootFolder, key + '.properties'); - - let i18n:I18n = new I18n(); - try { - // load file content of message properties file, or display warn if file is not found - var propertiesContent = require('fs').readFileSync(filename).toString(); - - require('fs').readFileSync(filename).toString().split('\n').forEach((line) => { - let split:Array = line.split('='); - i18n.add(split[0], split[1]); - }); - } catch (error) { - Log.getLogger().warn('Unable to locate file', filename); - } - - target.i18n = i18n; - - }; - - -} - -function walk(dir, results) { - var list = require('fs').readdirSync(dir) - list.forEach((file) => { - file = dir + '/' + file - var stat = require('fs').statSync(file) - if (stat && stat.isDirectory()) results = results.concat(walk(file, results)) - else results.push(file) - }) -} \ No newline at end of file diff --git a/dockerfiles/lib/src/spi/decorator/parameter.ts b/dockerfiles/lib/src/spi/decorator/parameter.ts deleted file mode 100644 index a0eeb7a558a4..000000000000 --- a/dockerfiles/lib/src/spi/decorator/parameter.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import 'reflect-metadata'; - -export interface ParameterType { - - names: Array; - - description? : string; -} - -export interface ParameterTypeDesc extends ParameterType { - fieldName: string; - type : string; -} - - -export interface ArgumentType { - - description? : string; -} - -export interface ArgumentTypeDesc extends ArgumentType { - fieldName: string; - type : boolean; -} - -/** - * Handle annotation/decorator for the given parameter - * @param propertyKey - * @returns {function(any, string, PropertyDescriptor): undefined} - * @constructor - */ -export function Parameter(parameterType: ParameterType) : any { - return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => { - - var t = Reflect.getMetadata("design:type", target, propertyKey); - let option : ParameterTypeDesc = {names: parameterType.names, description: parameterType.description, fieldName : propertyKey, type : t.name}; - - if (target.__parameters) { - target.__parameters.push(option); - } else { - let options : Array = [option]; - target.__parameters = options; - } - - }; - -} - - - -/** - * Handle annotation/decorator for the given parameter - * @param propertyKey - * @returns {function(any, string, PropertyDescriptor): undefined} - * @constructor - */ -export function Argument(argumentType: ArgumentType) : any { - return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => { - - var t = Reflect.getMetadata("design:type", target, propertyKey); - let option : ArgumentTypeDesc = {description: argumentType.description, fieldName : propertyKey, type : t.name}; - if (target.__arguments) { - target.__arguments.push(option); - } else { - let options : Array = [option]; - target.__arguments = options; - } - - - }; - - -} diff --git a/dockerfiles/lib/src/spi/docker/container-version.ts b/dockerfiles/lib/src/spi/docker/container-version.ts deleted file mode 100644 index 97e64620da90..000000000000 --- a/dockerfiles/lib/src/spi/docker/container-version.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -/** - * Run in the container the command to get image being launched so we can detect the version of the image - * @author Florent Benoit - */ -export class ContainerVersion { - - static version: string; - - constructor() { - if (!ContainerVersion.version) { - let execSync = require('child_process').execSync; - ContainerVersion.version = execSync("docker inspect --format='{{.Config.Image}}' `hostname` | cut -d : -f2 -s").toString().replace(/[\n\r]/g, ''); - } - } - - - getVersion() : string { - return ContainerVersion.version; - } - -} diff --git a/dockerfiles/lib/src/spi/docker/recipebuilder.ts b/dockerfiles/lib/src/spi/docker/recipebuilder.ts deleted file mode 100644 index dda81d53ee22..000000000000 --- a/dockerfiles/lib/src/spi/docker/recipebuilder.ts +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ - -import {Log} from "../log/log"; -import {CheFileStructWorkspace} from "../../internal/dir/chefile-struct/che-file-struct"; -/** - * Build a default recipe. - * @author Florent Benoit - */ -export class RecipeBuilder { - - static DEFAULT_DOCKERFILE_CONTENT: string = 'FROM codenvy/ubuntu_jdk8'; - path: any; - fs: any; - currentFolder : any; - - constructor(currentFolder) { - this.path = require('path'); - this.fs = require('fs'); - this.currentFolder = currentFolder; - } - - - getRecipe(cheStructWorkspace : CheFileStructWorkspace) : any { - - // do we have a custom property in Chefile - if (cheStructWorkspace) { - if (cheStructWorkspace.runtime) { - if (cheStructWorkspace.runtime.docker) { - - // make it backward compliant - if (cheStructWorkspace.runtime.docker.content) { - cheStructWorkspace.runtime.docker.dockerfile = cheStructWorkspace.runtime.docker.content; - } - - if (cheStructWorkspace.runtime.docker.image) { - return {"contentType": "text/x-dockerfile", "type": "dockerimage", "content": cheStructWorkspace.runtime.docker.image}; - } else if (cheStructWorkspace.runtime.docker.content) { - return { - "contentType": "text/x-dockerfile", - "type": "dockerfile", - "content": cheStructWorkspace.runtime.docker.content - }; - } else if (cheStructWorkspace.runtime.docker.dockerfile) { - return { - "contentType": "text/x-dockerfile", - "type": "dockerfile", - "content": cheStructWorkspace.runtime.docker.dockerfile - }; - } else if (cheStructWorkspace.runtime.docker.composefile) { - return { - "contentType": "application/x-yaml", - "type": "compose", - "content": cheStructWorkspace.runtime.docker.composefile - }; - } else if (cheStructWorkspace.runtime.docker.location) { - return { - "contentType": "text/x-dockerfile", - "type": "recipe", - "location": cheStructWorkspace.runtime.docker.location - }; - } - } - } - } - - // build path to the Dockerfile in current directory - var dockerFilePath = this.path.resolve(this.currentFolder, 'Dockerfile'); - - // use synchronous API - try { - var stats = this.fs.statSync(dockerFilePath); - Log.getLogger().info('Using a custom project Dockerfile \'' + dockerFilePath + '\' for the setup of the workspace.'); - var content = this.fs.readFileSync(dockerFilePath, 'utf8'); - return {"contentType": "text/x-dockerfile", "type": "dockerfile", "content": content}; - } catch (e) { - // file does not exist, return default - return {"contentType": "text/x-dockerfile", "type": "dockerfile", "content": RecipeBuilder.DEFAULT_DOCKERFILE_CONTENT} ; - } - - } - - - -} diff --git a/dockerfiles/lib/src/spi/docker/remoteip.ts b/dockerfiles/lib/src/spi/docker/remoteip.ts deleted file mode 100644 index 415108d25568..000000000000 --- a/dockerfiles/lib/src/spi/docker/remoteip.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import {ContainerVersion} from "./container-version"; - -/** - * Defines a way to grab remote ip - * @author Florent Benoit - */ -export class RemoteIp { - - static ip: string; - - constructor() { - if (!RemoteIp.ip) { - var execSync = require('child_process').execSync; - let containerVersion : string = new ContainerVersion().getVersion(); - RemoteIp.ip = execSync('docker run --net host --rm eclipse/che-ip:' + containerVersion).toString().replace(/[\n\r]/g, ''); - } - } - - - getIp() : string { - return RemoteIp.ip; - } - -} diff --git a/dockerfiles/lib/src/spi/docker/ssh-generator.ts b/dockerfiles/lib/src/spi/docker/ssh-generator.ts deleted file mode 100644 index 28267441d45d..000000000000 --- a/dockerfiles/lib/src/spi/docker/ssh-generator.ts +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import {ContainerVersion} from "./container-version"; - - -/** - * Defines a way to get ssh key (private key and public key) - * @author Florent Benoit - */ -export class SSHGenerator { - - - generateKey() : any { - let map : Map = new Map(); - var execSync = require('child_process').execSync; - let output:string = execSync('docker run --rm --entrypoint /bin/sh codenvy/alpine_jdk8 -c "sudo /usr/bin/ssh-keygen -t rsa -A && echo PRIVATE_KEY_START && sudo cat /etc/ssh/ssh_host_rsa_key && echo PRIVATE_KEY_END && echo PUBLIC_KEY_START && sudo cat /etc/ssh/ssh_host_rsa_key.pub &&echo PUBLIC_KEY_END"').toString(); - - // now grab private key - let isPrivateKey : boolean = false; - let isPublicKey : boolean = false; - let publicKey: string = ''; - let privateKey : string = ''; - let lines : Array = output.split("\n"); - let i : number = 0; - - // TODO : use regexp there - while (i < lines.length) { - let line = lines[i]; - if (line === 'PRIVATE_KEY_START') { - isPrivateKey = true; - i++; - continue; - } else if (line === 'PRIVATE_KEY_END') { - isPrivateKey = false; - i++; - continue; - } else if (line === 'PUBLIC_KEY_START') { - isPrivateKey = false; - isPublicKey = true; - i++; - continue; - } else if (line === 'PUBLIC_KEY_END') { - isPublicKey = false; - i++; - continue; - } - // line could have been moved - line = lines[i]; - - - if (isPrivateKey) { - if (privateKey.length > 0) { - privateKey = privateKey + '\n' + line; - } else { - privateKey = line; - } - } - - if (isPublicKey) { - if (publicKey.length > 0) { - publicKey = publicKey + '\n' + line; - } else { - publicKey = line; - } - } - i++; - } - - map.set('private', privateKey); - map.set('public', publicKey); - - return map; - } - -} - diff --git a/dockerfiles/lib/src/spi/error/error-message.ts b/dockerfiles/lib/src/spi/error/error-message.ts deleted file mode 100644 index e7653feb5632..000000000000 --- a/dockerfiles/lib/src/spi/error/error-message.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -/** - * Error message used to provide custom exit code - * @author Florent Benoit - */ -export class ErrorMessage { - - private exitCode? : number = 1; - - private error : any; - - constructor(error: any, exitCode : number) { - this.error = error; - if (exitCode) { - this.exitCode = exitCode; - } - } - - getExitCode() : number { - return this.exitCode; - } - - getError() : any { - return this.error; - } -} diff --git a/dockerfiles/lib/src/spi/http/default-http-json-request.ts b/dockerfiles/lib/src/spi/http/default-http-json-request.ts deleted file mode 100644 index 3a983ede69a7..000000000000 --- a/dockerfiles/lib/src/spi/http/default-http-json-request.ts +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import {AuthData} from "../../api/wsmaster/auth/auth-data"; -import {Log} from "../log/log"; -import {ErrorMessage} from "../error/error-message"; -import {ServerLocation} from "../../utils/server-location"; -/** - * Implementation of a Request on the remote server - * @author Florent Benoit - */ -export class DefaultHttpJsonRequest implements HttpJsonRequest { - - body : any = {}; - /** - * The HTTP library used to call REST API. - */ - http: any; - options: any; - expectedStatusCode : number; - - - constructor(authData : AuthData, server : ServerLocation, path : string, expectedStatusCode: number) { - if (!server) { - server = authData.getMasterLocation(); - } - if (server.isSecure()) { - this.http = require('https'); - } else { - this.http = require('http'); - } - this.expectedStatusCode = expectedStatusCode; - - this.options = { - hostname: server.getHostname(), - port: server.getPort(), - path: path, - method: 'GET', - headers: { - 'Accept': 'application/json, text/plain, */*', - 'Content-Type': 'application/json;charset=UTF-8' - } - }; - if (authData) { - this.options.headers.Authorization = authData.getAuthorizationHeaderValue(); - } - } - - - setMethod(methodName: string) : DefaultHttpJsonRequest { - this.options.method = methodName; - return this; - } - - - setBody(value : any) : DefaultHttpJsonRequest { - if (value.toJson) { - this.body = value.toJson(); - } else { - this.body = value; - } - return this; - } - - - request() : Promise { - Log.getLogger().debug('Request on ', this.options.hostname + ' with port ', this.options.port); - return new Promise( (resolve, reject) => { - var req = this.http.request(this.options, (res) => { - - var data: string = ''; - - res.on('error', (body)=> { - Log.getLogger().error('got the following error', body.toString()); - reject(body); - }); - - res.on('data', (body) => { - data += body; - }); - - res.on('end', () => { - Log.getLogger().debug('Reply for call', this.options.path, 'with method', this.options.method, 'statusCode:', res.statusCode, 'and got body:', data); - - if (res.statusCode == this.expectedStatusCode) { - // workspace created, continue - resolve(new DefaultHttpJsonResponse(res.statusCode, data)); - } else { - try { - var parsed = JSON.parse(data); - if (parsed.message) { - reject(new ErrorMessage('Call on rest url ' + this.options.path + ' returned invalid response code (' + res.statusCode + ') with error:' + parsed.message, res.statusCode)); - } else { - reject(new ErrorMessage('Call on rest url ' + this.options.path + ' returned invalid response code (' + res.statusCode + ') with error:' + data, res.statusCode)); - } - } catch (error) { - reject(new ErrorMessage('Call on rest url ' + this.options.path + ' returned invalid response code (' + res.statusCode + ') with error:' + data.toString(), res.statusCode)); - } - - } - }); - - }); - - req.on('error', (err) => { - Log.getLogger().debug('http error using the following options', this.options, JSON.stringify(err)); - if (err.code && (err.code === 'ECONNREFUSED' || err.code === 'EHOSTUNREACH')) { - reject('Unable to connect to the remote host ' + this.options.hostname + ' on port ' + this.options.port - + '. Please check the server is listening and that there is no network issue to reach this host. Full error: ' + err); - } else { - reject('HTTP error: ' + err); - } - }); - - let stringified : string = JSON.stringify(this.body); - Log.getLogger().debug('Send request', this.options.path, 'with method', this.options.method, "using ip/port", this.options.hostname + ":" + this.options.port, ' body:', stringified); - req.write(stringified); - req.end(); - - }); - } - - -} - - -export class DefaultHttpJsonResponse implements HttpJsonResponse { - - responseCode : number; - data : any; - - constructor (responseCode : number, data : any) { - this.responseCode = responseCode; - this.data = data; - } - - getData() : any { - return this.data; - } - - - asDto(dtoImplementation : any) : any { - //let interfaceName: string = dtoClass.name; - return new dtoImplementation(JSON.parse(this.data)); - } - - asArrayDto(dtoImplementation : any) : Array { - let parsed : any = JSON.parse(this.data); - let arrayDto:Array = new Array(); - parsed.forEach((entry) => { - let implementationInstance = new dtoImplementation(entry); - arrayDto.push(implementationInstance); - }); - return arrayDto; - } - -} - -export interface HttpJsonResponse { - - getData() : any; - - asDto(dtoImplementation : any) : any; - - asArrayDto(dtoImplementation : any) : Array; - -} - -export interface HttpJsonRequest { - - setMethod(methodName: string) : DefaultHttpJsonRequest; - - setBody(body : any) : DefaultHttpJsonRequest; - - request() : Promise; -} \ No newline at end of file diff --git a/dockerfiles/lib/src/spi/i18n/i18n.ts b/dockerfiles/lib/src/spi/i18n/i18n.ts deleted file mode 100644 index 998c03c652a0..000000000000 --- a/dockerfiles/lib/src/spi/i18n/i18n.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 class I18n { - - mapOfConstants : Map; - - constructor() { - this.mapOfConstants = new Map(); - } - - get(key: string, ...optional: Array) : string { - - let constant : string = this.mapOfConstants.get(key); - // not found, return the key - if (!constant) { - return key; - } - - // replace values - return constant.replace(/{(\d+)}/g, (match, number) => { - return typeof optional[number] != 'undefined' - ? optional[number] - : match - }); - } - - - add(key : string, value : string) { - this.mapOfConstants.set(key, value); - } - -} \ No newline at end of file diff --git a/dockerfiles/lib/src/spi/index.ts b/dockerfiles/lib/src/spi/index.ts deleted file mode 100644 index ad4c3dce96ce..000000000000 --- a/dockerfiles/lib/src/spi/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 * from './decorator/argument-processor'; -export * from './decorator/message'; -export * from './decorator/parameter'; -export * from './docker/container-version'; -export * from './docker/recipebuilder'; -export * from './docker/remoteip'; -export * from './http/default-http-json-request'; -export * from './i18n/i18n'; -export * from './log/log'; -export * from './websocket/messagebus-subscriber'; -export * from './websocket/websocket'; diff --git a/dockerfiles/lib/src/spi/log/log.ts b/dockerfiles/lib/src/spi/log/log.ts deleted file mode 100644 index d9cb7c5d2a7f..000000000000 --- a/dockerfiles/lib/src/spi/log/log.ts +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ - -import {ProductName} from "../../utils/product-name"; -/** - * Logging class allowing to log message - * @author Florent Benoit - */ -export class Log { - - static debugEnabled : boolean = false; - static context : string = ProductName.getDisplayName(); - static logger : Log; - static disabledPrefix : boolean = false; - - static BLUE: string = '\u001b[34m'; - static GREEN : string = '\u001b[32m'; - static RED : string = '\u001b[31m'; - static ORANGE: string = '\u001b[33m'; - static NC : string = '\u001b[39m'; - - static INFO_PREFIX: string = Log.GREEN + 'INFO:' + Log.NC; - static DEBUG_PREFIX: string = Log.BLUE + 'DEBUG:' + Log.NC; - static WARN_PREFIX: string = Log.ORANGE + 'WARN:' + Log.NC; - static ERROR_PREFIX: string = Log.RED + 'ERROR:' + Log.NC; - - static getLogger() : Log { - if (!Log.logger) { - Log.logger = new Log(); - } - return Log.logger; - } - - info(message : string, ...optional: Array) { - this.log('info', message, optional); - } - - warn(message : string, ...optional: Array) { - this.log('warn', message, optional); - } - - error(message : string, ...optional: Array) { - this.log('error', message, optional); - } - - debug(message : string, ...optional: Array) { - if (Log.debugEnabled) { - this.log('debug', message, optional); - } - } - - /** - * Direct option is that it doesn't show any logger trace - */ - direct(message : string, ...optional: Array) { - this.log('direct', message, optional); - } - - - log(type: LogType, message: string, optional?: Array) { - let useContext : boolean = true; - var prefix: String; - var displayEachLine : boolean = false; - if ('info' === type) { - prefix = Log.INFO_PREFIX; - } else if ('debug' === type) { - prefix = Log.DEBUG_PREFIX; - } else if ('warn' === type) { - prefix = Log.WARN_PREFIX; - } else if ('error' === type) { - prefix = Log.ERROR_PREFIX; - } else if ('direct' === type) { - prefix = ''; - useContext = false; - } else if ('multiline:info' === type) { - prefix = Log.INFO_PREFIX; - displayEachLine = true; - } else if ('multiline:direct' === type) { - prefix = ''; - useContext = false; - displayEachLine = true; - } - - if (useContext && Log.context) { - prefix += ' ' + Log.context + ': '; - } - if (Log.disabledPrefix) { - prefix = ''; - } - - var consoleMethod : any; - if ('error' === type) { - consoleMethod = console.error; - } else { - consoleMethod = console.log; - } - - if (displayEachLine) { - message.split("\n").forEach((line) => { - consoleMethod(prefix + line); - }) - } else { - if (optional && optional.length > 0) { - consoleMethod(prefix + message, optional.join(' ')); - } else { - consoleMethod(prefix + message); - } - } - - } - - - static enableDebug() : void { - Log.debugEnabled = true; - } - - static disablePrefix() : void { - Log.disabledPrefix = true; - } - -} - - -export type LogType = 'info' | 'debug' | 'warn' | 'error' | 'direct' | 'multiline:info' | 'multiline:direct'; diff --git a/dockerfiles/lib/src/spi/websocket/json-rpc-bus.ts b/dockerfiles/lib/src/spi/websocket/json-rpc-bus.ts deleted file mode 100644 index a8d4b5f5f2ad..000000000000 --- a/dockerfiles/lib/src/spi/websocket/json-rpc-bus.ts +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import {MessageBusSubscriber} from './messagebus-subscriber'; -import {MessageBuilder} from './messagebuilder'; -import {Log} from "../log/log"; -import {Websocket} from "./websocket"; - - -/** - * Allow to handle calls to the JSON RPC bus running inside Eclipse Che by sending and receiving the messages. - * It handles the UUID messages and subscribers that can subscribe/unsubscribe - * @author Florent Benoit - */ -export class JsonRpcBus { - - websocketConnection : any; - subscribers : Array; - websocketClient : any; - closed : boolean; - websocket : Websocket; - - constructor(websocketClient : any, url: string, websocket: Websocket, resolve : any, reject : any) { - - this.websocketClient = websocketClient; - this.websocket = websocket; - - this.closed = false; - - var client = websocketClient.on('connectFailed', (error) => { - Log.getLogger().error('Connect Error: ' + error.toString()); - reject(error); - }); - - - client.on('error', error => { - Log.getLogger().error('websocketclient error', error.toString()); - reject(error); - }); - - client.on('connect', (connection) => { - // resolve the promise of connecting to the bus - this.websocketConnection = connection; - - connection.on('error', (error) => { - if (!this.closed) { - Log.getLogger().error("Connection Error: " + error.toString()); - } - }); - connection.on('close', () => { - if (!this.closed) { - Log.getLogger().error('Websocket connection closed'); - } - }); - connection.on('message', (message) => { - if (message.type === 'utf8') { - this.handleMessage(message.utf8Data); - } - }); - resolve(this); - - }); - - // now connect - websocketClient.connect(url); - this.subscribers = new Array(); - - } - - close() { - this.closed = true; - this.websocketConnection.close(); - } - - /** - * Subscribes a new callback which will listener for messages sent to the specified channel. - * Upon the first subscribe to a channel, a message is sent to the server to - * subscribe the client for that channel. Subsequent subscribes for a channel - * already previously subscribed to do not trigger a send of another message - * to the server because the client has already a subscription, and merely registers - * (client side) the additional handler to be fired for events received on the respective channel. - */ - subscribe(callback) { - // already subscribed ? - var existingSubscriberIndex = this.subscribers.indexOf(callback); - if (existingSubscriberIndex === -1) { - // register callback - this.subscribers.push(callback); - } - } - - /** - * Asynchronous subscribe method that is returning promise that will be resolved when subscribe callback has been sent from the remote side - * @param channel the channel on which we want to subscribe - * @param callback the callback subscriber - * @returns {any} promise - */ - subscribeAsync(channel, callback) : Promise { - // already subscribed ? - var existingSubscriberIndex = this.subscribers.indexOf(callback); - if (existingSubscriberIndex === -1) { - // register callback - this.subscribers.push(callback); - var subscribeOrder = new MessageBuilder().subscribe(channel).build(); - this.send(subscribeOrder); - } - return Promise.resolve("true"); - } - - /** - * Unsubscribes a previously subscribed handler listening on the specified channel. - * If it's the last unsubscribe to a channel, a message is sent to the server to - * unsubscribe the client for that channel. - */ - unsubscribe(callback) { - // already subscribed ? - var existingSubscriberIndex: number = this.subscribers.indexOf(callback); - if (existingSubscriberIndex > 0) { - delete this.subscribers[existingSubscriberIndex]; - } - } - - send(message) { - var stringified = JSON.stringify(message); - this.websocketConnection.sendUTF(stringified); - } - - handleMessage(message) { - // handling the receive of a message - // needs to parse it - var jsonMessage = JSON.parse(message); - this.processMessage(jsonMessage); - } - - /** - * Process the JSON given message by using the given channelHeader value - * @param jsonMessage the message to parse and then send to subscribers - */ - processMessage(jsonMessage : any) { - // message for a channel, look at current subscribers - this.subscribers.forEach((subscriber : MessageBusSubscriber) => { - subscriber.handleMessage(jsonMessage); - }); - } - -} diff --git a/dockerfiles/lib/src/spi/websocket/messagebuilder.ts b/dockerfiles/lib/src/spi/websocket/messagebuilder.ts deleted file mode 100644 index 3fd4037a62c6..000000000000 --- a/dockerfiles/lib/src/spi/websocket/messagebuilder.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import {UUID} from "../../utils/index"; - -/** - * Generator of the messages to send with the {@link MessageBus} object. - * @author Florent Benoit - */ -export class MessageBuilder { - - method: string; - params: any; - message: any; - - constructor(method? : string, params? : any) { - if (method) { - this.method = method; - } - if (params) { - this.params = params; - } else { - this.params = {}; - } - this.message = {}; - this.message.jsonrpc = '2.0' - this.message.method = this.method; - this.message.params = this.params; - } - - subscribe(channel) { - this.message.method = 'subscribe'; - this.message.params.method = channel; - return this; - } - - unsubscribe(channel) { - this.message.method = 'unSubscribe'; - this.message.params.method = channel; - return this; - } - - /** - * Prepares ping frame for server. - * - * @returns {MessageBuilder} - */ - ping() { - return this; - } - - build() { - return this.message; - } - -} diff --git a/dockerfiles/lib/src/spi/websocket/messagebus-subscriber.ts b/dockerfiles/lib/src/spi/websocket/messagebus-subscriber.ts deleted file mode 100644 index b77622c6620c..000000000000 --- a/dockerfiles/lib/src/spi/websocket/messagebus-subscriber.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -/** - * Interface required to be implemented to subscribe to message bus messages. - * @author Florent Benoit - */ -export interface MessageBusSubscriber { - - handleMessage(message: string); - - -} diff --git a/dockerfiles/lib/src/spi/websocket/resolve-subscribe-promise-subscriber.ts b/dockerfiles/lib/src/spi/websocket/resolve-subscribe-promise-subscriber.ts deleted file mode 100644 index b7f0f84409d1..000000000000 --- a/dockerfiles/lib/src/spi/websocket/resolve-subscribe-promise-subscriber.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ - -import {Log} from "../log/log"; -import {MessageBusSubscriber} from "./messagebus-subscriber"; -/** - * Handle a promise that will be resolved when system is stopped. - * If system has error, promise will be rejected - * @author Florent Benoit - */ -export class ResolveSubscribePromiseSubscriber implements MessageBusSubscriber { - - resolve : any; - reject : any; - promise: Promise; - channel : string; - - constructor(channel : string) { - this.channel = channel; - this.promise = new Promise((resolve, reject) => { - this.resolve = resolve; - this.reject = reject; - }); - } - - handleMessage(message: any) { - if (this.channel === message.channel) { - this.resolve(); - } else if ('ERROR' === message.eventType) { - try { - let stringify: any = JSON.stringify(message); - this.reject('Error when getting subscribe channel ' + stringify); - } catch (error) { - this.reject('Error when getting subscribe channel' + message.toString()); - } - } else { - this.reject('Error when getting subscribe channel ' + message.toString()); - } - - } - -} diff --git a/dockerfiles/lib/src/spi/websocket/websocket.ts b/dockerfiles/lib/src/spi/websocket/websocket.ts deleted file mode 100644 index a5fa5c755492..000000000000 --- a/dockerfiles/lib/src/spi/websocket/websocket.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ - -import {JsonRpcBus} from "./json-rpc-bus"; - -/** - * This class is handling the websocket handling by providing a {@link MessageBus} object - * @author Florent Benoit - */ -export class Websocket { - - /** - * Websocket client object. - */ - wsClient: any; - - - /** - * Default constructor initializing websocket. - */ - constructor() { - this.wsClient = require('websocket').client; - } - - /** - * Gets a MessageBus object for a remote workspace, by providing the remote URL to this websocket - * @param websocketURL the remote host base WS url - */ - getJsonRpcBus(websocketURL) : Promise { - var webSocketClient: any = new this.wsClient(); - var remoteWebsocketUrl: string = websocketURL; - let promise : Promise = new Promise((resolve, reject) => { - return new JsonRpcBus(webSocketClient, remoteWebsocketUrl, this, resolve, reject); - }); - return promise; - } - -} diff --git a/dockerfiles/lib/src/utils/index.ts b/dockerfiles/lib/src/utils/index.ts deleted file mode 100644 index 8b22ccdcf445..000000000000 --- a/dockerfiles/lib/src/utils/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 * from './string-utils'; -export * from './uuid'; diff --git a/dockerfiles/lib/src/utils/product-name.ts b/dockerfiles/lib/src/utils/product-name.ts deleted file mode 100644 index 07b6c8bb3a58..000000000000 --- a/dockerfiles/lib/src/utils/product-name.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ - -/** - * Creates an helper class for getting product name - * @author Florent Benoit - */ -export class ProductName { - static getDisplayName() : string { - let productName: string = process.env.CHE_PRODUCT_NAME; - if (!productName) { - return 'Eclipse Che'; - } - return productName; - } - - static getMiniDisplayName() : string { - let miniProductName: string = process.env.CHE_MINI_PRODUCT_NAME; - if (!miniProductName) { - return 'Eclipse Che'; - } - return miniProductName; - } - -} diff --git a/dockerfiles/lib/src/utils/server-location.ts b/dockerfiles/lib/src/utils/server-location.ts deleted file mode 100644 index 0a3256b5396d..000000000000 --- a/dockerfiles/lib/src/utils/server-location.ts +++ /dev/null @@ -1,60 +0,0 @@ -import {error, isUndefined} from "util"; - -/** - * Defines location of a server, e.g. hostname, port, etc. - * - * @author Oleksandr Garagatyi - */ -export class ServerLocation { - private port : number; - private hostname : string; - private secure: boolean; - - constructor(hostname : string, port : number, secure : boolean) { - if (!port || !hostname || isUndefined(secure)) { - error('ServerLocation object creation failed. Arguments should not be undefined') - } - this.port = port; - this.secure = secure; - this.hostname = hostname; - } - - static parse(stringUrl : string): ServerLocation { - if (!stringUrl) { - error('Server location parsing failed. Server url should not be undefined') - } - const url = require('url').parse(stringUrl); - let port: number; - let isSecured: boolean = false; - // do we have a port ? - if ('https:' === url.protocol || 'wss:' === url.protocol) { - isSecured = true; - } - if (!url.port) { - if ('http:' === url.protocol || 'ws:' === url.protocol) { - port = 80; - } else if ('https:' === url.protocol || 'wss:' === url.protocol) { - port = 443; - } - } else { - port = +url.port; - } - return new ServerLocation(url.hostname, port, isSecured); - } - - isSecure(): boolean { - return this.secure; - } - - getHostname(): string { - return this.hostname; - } - - getPort(): number { - return this.port; - } - - setPort(port : number) { - this.port = port; - } -} diff --git a/dockerfiles/lib/src/utils/string-utils.spec.ts b/dockerfiles/lib/src/utils/string-utils.spec.ts deleted file mode 100644 index 2f05049d6838..000000000000 --- a/dockerfiles/lib/src/utils/string-utils.spec.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ -import {StringUtils} from './string-utils'; - -let expect = require('chai').expect; -let vm = require('vm'); - -describe("String Utils tests", () => { - it("not included", () => { - expect(StringUtils.startsWith("toto", 'n')).to.be.false; - }); - - it("starts with", () => { - expect(StringUtils.startsWith("toto", "t")).to.be.true; - }); - - - it("remove # comments", () => { - let text : string = "This is a string\n" + "# THis is a comment\n" + " and here it is not a # comment"; - let expectedText : string = "This is a string\n\n" + " and here it is not a # comment"; - expect(StringUtils.removeSharpComments(text)).to.equal(expectedText); - }); - - - it("Check dockerfile are handled with raw strings", () => { - let workspace : any = {}; - workspace.content = ""; - let text : string = "workspace.content=\`" + String.raw` - FROM Image - - RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - locales \ - openssh-server \ - sudo && \ - rm -rf /var/lib/apt/lists/* && \ - mkdir /var/run/sshd && \ - sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd && \ - echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ - useradd -u 1000 -G users,sudo -p $(openssl rand -base64 32) -s /bin/bash -m user && \ - echo "#! /bin/bash\n set -e\n sudo /usr/sbin/sshd -D &\n exec \"\$@\"" > /home/user/entrypoint.sh && \ - chmod a+x /home/user/entrypoint.sh -`+ "\`"; - - text = StringUtils.keepWorkspaceRawStrings(text); - - // create sandboxed object - var sandbox = { "workspace": workspace}; - vm.runInNewContext(text, sandbox); - - expect(workspace.content).to.contain(String.raw`s@session\s*required\s*`); - }); - - -}); diff --git a/dockerfiles/lib/src/utils/string-utils.ts b/dockerfiles/lib/src/utils/string-utils.ts deleted file mode 100644 index 3a31eaee997e..000000000000 --- a/dockerfiles/lib/src/utils/string-utils.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ - -/** - * Handle some operations on strings. - * @author Florent Benoit - */ -export class StringUtils { - - /** - * Check if the given value string i starting with searchString - * @param value the original string - * @param searchString the value to search - * @returns {boolean} true if it starts with - */ - static startsWith(value:string, searchString:string):boolean { - return value.substr(0, searchString.length) === searchString; - } - - /** - * Remove from the given string all the given comments starting by # - * @param value - * @returns {string} - */ - static removeSharpComments(value : string) : string { - return value.replace(/^#.*/gm, ''); - } - - /** - * If string literals es6 def for workspace, use raw strings to keep dockerfile content - * @param value - * @returns {string} - */ - static keepWorkspaceRawStrings(value : string) : string { - return value.replace(/^(workspace.)(.*)=\`(.*)$/gm, '$1$2=String.raw`$3'); - } - -} - diff --git a/dockerfiles/lib/src/utils/uuid.ts b/dockerfiles/lib/src/utils/uuid.ts deleted file mode 100644 index 66e5400a520d..000000000000 --- a/dockerfiles/lib/src/utils/uuid.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2016-2017 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 - */ - -/** - * Creates an helper class for building UUID (like for message bus channels, etc) - * @author Florent Benoit - */ -export class UUID { - static build() : string { - var time = new Date().getTime(); - return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (match) => { - var rem = (time + 16 * Math.random()) % 16 | 0; - time = Math.floor(time / 16); - return (match === 'x' ? rem : rem & 7 | 8).toString(16); - }); - } - -} \ No newline at end of file diff --git a/dockerfiles/lib/tsconfig.json b/dockerfiles/lib/tsconfig.json deleted file mode 100644 index c10f91e39e27..000000000000 --- a/dockerfiles/lib/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "target": "es6", - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "sourceMap": true, - "outDir": "lib", - "module": "commonjs", - "moduleResolution": "node", - "types": [ - "node", - "mocha" - ] - }, - "include": [ - "src/**/*" - ],"exclude": [ - "node_modules", - "jspm_packages", - "dependencies" -] -} diff --git a/dockerfiles/mount/Dockerfile b/dockerfiles/mount/Dockerfile deleted file mode 100644 index 1b45aa7896f9..000000000000 --- a/dockerfiles/mount/Dockerfile +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright (c) 2012-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 -# -# Contributors: -# Tyler Jewell - Initial implementation -# -# build: -# docker build -t eclipse/che-mount . -# -# use: -# On linux: -# docker run --rm -it --cap-add SYS_ADMIN --device /dev/fuse -# --name che-mount -# -v ${HOME}/.ssh:${HOME}/.ssh -# -v ${HOME}/.unison:${HOME}/.unison -# -v /etc/group:/etc/group:ro -# -v /etc/passwd:/etc/passwd:ro -# -u $(id -u ${USER}) -# -v :/mnthost codenvy/che-mount -# -# On Mac or Windows: -# docker run --rm -it --cap-add SYS_ADMIN --device /dev/fuse -# --name che-mount -# -v ~/.ssh:/root/.ssh -# -v :/mnthost codenvy/che-mount -# -# RUN IN CONTAINER: -# echo "secret" | $(echo "yes" | sshfs user@10.0.75.2:/projects /mntssh -p 32774) -# -# TO UNMOUNT IN CONTAINER -# fusermount -u /mntssh -# -# INTERNAL SYNC SCRIPT -# /bin/synch.sh -FROM alpine:3.5 - -ENV UNISON_VERSION=2.51.2 - -RUN apk add --update build-base curl bash sshfs ocaml && \ - curl -L https://www.seas.upenn.edu/~bcpierce/unison/download/releases/unison-$UNISON_VERSION/unison-$UNISON_VERSION.tar.gz | tar xzv -C /tmp && \ - cd /tmp/src && \ - sed -i -e 's/GLIBC_SUPPORT_INOTIFY 0/GLIBC_SUPPORT_INOTIFY 1/' fsmonitor/linux/inotify_stubs.c && \ - make && \ - cp /tmp/src/unison /usr/local/bin && \ - cp /tmp/src/unison-fsmonitor /usr/local/bin && \ - apk del ocaml curl build-base bash && \ - rm -rf /tmp /var/cache/apk/* && \ - mkdir /mntssh && chmod -R 777 /mntssh && \ - mkdir /mnthost && chmod -R 777 /mnthost - -ENV DOCKER_BUCKET get.docker.com -ENV DOCKER_VERSION 1.6.0 - -RUN set -x \ - && apk add --no-cache \ - ca-certificates \ - curl \ - openssl \ - && curl -sL "https://${DOCKER_BUCKET}/builds/Linux/x86_64/docker-$DOCKER_VERSION" \ - > /usr/bin/docker; chmod +x /usr/bin/docker \ - && apk del curl ca-certificates openssl - -COPY /entrypoint.sh /bin/entrypoint.sh - -ENTRYPOINT ["/bin/entrypoint.sh"] diff --git a/dockerfiles/mount/build.sh b/dockerfiles/mount/build.sh deleted file mode 100755 index 80e4cd3424b3..000000000000 --- a/dockerfiles/mount/build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2017 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:mount "$@" -build diff --git a/dockerfiles/mount/entrypoint.sh b/dockerfiles/mount/entrypoint.sh deleted file mode 100755 index 8526010b9204..000000000000 --- a/dockerfiles/mount/entrypoint.sh +++ /dev/null @@ -1,178 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2017 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: -# Tyler Jewell - Initial implementation -# -init_logging() { - BLUE='\033[1;34m' - GREEN='\033[0;32m' - RED='\033[0;31m' - NC='\033[0m' -} - -init_global_variables() { - - USAGE=" -Usage on Linux - docker run --rm -it --cap-add SYS_ADMIN --device /dev/fuse - --name che-mount - -v \${HOME}/.ssh:\${HOME}/.ssh - -v /etc/group:/etc/group:ro - -v /etc/passwd:/etc/passwd:ro - -v :/profile - -u \$(id -u \${USER}) - -v /:/mnthost eclipse/che-mount - - ID or Name of the workspace or namespace:workspace-name - -Usage on Mac or Windows: - docker run --rm -it --cap-add SYS_ADMIN --device /dev/fuse - --name che-mount - -v :/profile - -v /:/mnthost eclipse/che-mount - - ID or Name of the workspace or namespace:workspace-name -" - UNISON_REPEAT_DELAY_IN_SEC=2 - WORKSPACE_NAME= - COMMAND_EXTRA_ARGS= -} - -is_verbose() { - for i in "$@" ; do - if [ $i = "--unison-verbose" ]; then - echo "true" - exit 0 - fi - done - echo "false" -} - -parse_command_line () { - if [ $# -eq 0 ]; then - usage - return 1 - fi - - # See if profile document was provided - mkdir -p $HOME/.unison - if [ -f /profile/default.prf ]; then - cp -rf /profile/default.prf $HOME/.unison/default.prf - fi - - WORKSPACE_NAME=$1 - shift - COMMAND_EXTRA_ARGS="$*" -} - -usage () { - printf "%s" "${USAGE}" -} - -info() { - printf "${GREEN}INFO:${NC} %s\n" "${1}" -} - -debug() { - printf "${BLUE}DEBUG:${NC} %s\n" "${1}" -} - -error() { - echo "---------------------------------------" - echo "!!!" - echo "!!! ${1}" - echo "!!!" - echo "---------------------------------------" - return 1 -} - -stop_sync() { - echo "Received interrupt signal. Exiting." - exit 1 -} - -# See: https://sipb.mit.edu/doc/safe-shell/ -set -u - -# on callback, kill the last background process, which is `tail -f /dev/null` and execute the specified handler -trap 'stop_sync' SIGHUP SIGTERM SIGINT - -init_logging -init_global_variables -parse_command_line "$@" -status=$? -if [ $status -ne 0 ]; then - exit 1 -fi - -docker run --rm -v /var/run/docker.sock:/var/run/docker.sock eclipse/che-action:${CHE_VERSION} get-ssh-data ${WORKSPACE_NAME} ${COMMAND_EXTRA_ARGS} > $HOME/env -if [ $? -ne 0 ]; then - error "ERROR: Error when trying to get workspace data for workspace named ${WORKSPACE_NAME}" - echo "List of workspaces are:" - docker run --rm -v /var/run/docker.sock:/var/run/docker.sock eclipse/che-action:${CHE_VERSION} list-workspaces - return 1 -fi - -source $HOME/env - -# store private key -mkdir $HOME/.ssh -echo "${SSH_PRIVATE_KEY}" > $HOME/.ssh/id_rsa -chmod 600 $HOME/.ssh/id_rsa - -info "INFO: (che mount): Mounting ${SSH_USER}@${SSH_IP}:/projects with SSHFS" -sshfs ${SSH_USER}@${SSH_IP}:/projects /mntssh -p ${SSH_PORT} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no - -status=$? -if [ $status -ne 0 ]; then - error "ERROR: Fatal error occurred ($status)" - exit 1 -fi -info "INFO: (che mount): Successfully mounted ${SSH_USER}@${SSH_IP}:/projects (${SSH_PORT})" -info "INFO: (che mount): Initial sync...Please wait." - -local UNISON_ARGS=""; -if [ $(is_verbose "$@") = true ]; then - UNISON_ARGS="-batch -fat -auto -prefer=newer" - info "using verbose mode" -else - UNISON_ARGS="-silent -fat -auto -prefer=newer -log=false > /dev/null 2>&1" -fi - -UNISON_COMMAND="unison /mntssh /mnthost ${UNISON_ARGS}" -if [ $(is_verbose "$@") = true ]; then - debug "Using command ${UNISON_COMMAND}" -fi - -eval "${UNISON_COMMAND}" - -status=$? -if [ $status -ne 0 ]; then - error "ERROR: Fatal error occurred ($status)" - exit 1 -fi -info "INFO: (che mount): Background sync continues every ${UNISON_REPEAT_DELAY_IN_SEC} seconds." -info "INFO: (che mount): This terminal will block while the synchronization continues." -info "INFO: (che mount): To stop, issue a SIGTERM or SIGINT, usually CTRL-C." - -if [ $(is_verbose "$@") = true ]; then - info "Background sync unison verbose mode" - UNISON_ARGS="-batch -retry 10 -fat -copyonconflict -auto -prefer=newer -repeat=${UNISON_REPEAT_DELAY_IN_SEC}" -else - UNISON_ARGS="-batch -retry 10 -fat -silent -copyonconflict -auto -prefer=newer -repeat=${UNISON_REPEAT_DELAY_IN_SEC} -log=false > /dev/null 2>&1" -fi - -UNISON_COMMAND="unison /mntssh /mnthost ${UNISON_ARGS}" -if [ $(is_verbose "$@") = true ]; then - debug "Using command ${UNISON_COMMAND}" -fi - -# run application -eval "${UNISON_COMMAND}" diff --git a/dockerfiles/postgres/build.sh b/dockerfiles/postgres/build.sh index 110ce6f530b3..cdbc81d8accd 100755 --- a/dockerfiles/postgres/build.sh +++ b/dockerfiles/postgres/build.sh @@ -10,12 +10,5 @@ base_dir=$(cd "$(dirname "$0")"; pwd) . "${base_dir}"/../build.include -DIR=$(cd "$(dirname "$0")"; pwd) -# copy user and realm json templates -cp -r "${DIR}"/../init/modules/postgres/templates/* "${DIR}" - init --name:postgres "$@" build - -# remove jsons -rm "${DIR}"/*.erb diff --git a/dockerfiles/init/modules/postgres/templates/init-che-user-and-run.sh.erb b/dockerfiles/postgres/init-che-user-and-run.sh.erb similarity index 100% rename from dockerfiles/init/modules/postgres/templates/init-che-user-and-run.sh.erb rename to dockerfiles/postgres/init-che-user-and-run.sh.erb diff --git a/dockerfiles/init/modules/postgres/templates/init-che-user.sh.erb b/dockerfiles/postgres/init-che-user.sh.erb similarity index 100% rename from dockerfiles/init/modules/postgres/templates/init-che-user.sh.erb rename to dockerfiles/postgres/init-che-user.sh.erb diff --git a/dockerfiles/test/.require b/dockerfiles/test/.require deleted file mode 100644 index a65b41774ad5..000000000000 --- a/dockerfiles/test/.require +++ /dev/null @@ -1 +0,0 @@ -lib diff --git a/dockerfiles/test/Dockerfile b/dockerfiles/test/Dockerfile deleted file mode 100644 index dec776e22492..000000000000 --- a/dockerfiles/test/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2017 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 -# -# build: -# docker build -t eclipse/che-test . -# -# use: -# docker run -v /var/run/docker.sock:/var/run/docker.sock eclipse/che-test [command] - -FROM ${BUILD_ORGANIZATION}/${BUILD_PREFIX}-lib:${BUILD_TAG} - -ENTRYPOINT ["node", "/che-lib/index.js", "che-test"] diff --git a/dockerfiles/test/README.md b/dockerfiles/test/README.md deleted file mode 100644 index bd5f7d638533..000000000000 --- a/dockerfiles/test/README.md +++ /dev/null @@ -1,22 +0,0 @@ -### Testing local or remote Eclipse Che instance with a Docker container - -## Build container -``` -$ build.sh (on Unix) -``` - -## Run a test -``` -docker run --rm -v /var/run/docker.sock:/var/run/docker.sock eclipse/che-test -``` - -## Get available tests -``` -docker run --rm -v /var/run/docker.sock:/var/run/docker.sock eclipse/che-test -``` - -## Get help on a test -``` -docker run --rm -v /var/run/docker.sock:/var/run/docker.sock eclipse/che-test --help -``` - diff --git a/dockerfiles/test/build.sh b/dockerfiles/test/build.sh deleted file mode 100755 index 390865efa95f..000000000000 --- a/dockerfiles/test/build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -# Copyright (c) 2017 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:test "$@" -build