Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: Deprecate server:start command #909

Merged
merged 4 commits into from
Oct 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"name": "Debug Openshift Install",
"program": "${workspaceFolder}/bin/run",
"args": [
"server:start",
"server:deploy",
"--platform",
"openshift",
"--installer",
Expand Down
8 changes: 4 additions & 4 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"tasks": [
{
"label": "Custom che-operator Minikube",
"command": "./bin/run server:start -n che -m -p minikube --che-operator-image=${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/che-operator:nightly --cheimage=${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/che-server:nightly",
"command": "./bin/run server:deploy -n che -m -p minikube --che-operator-image=${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/che-operator:nightly --cheimage=${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/che-server:nightly",
"type": "shell",
"args": [],
"problemMatcher": [
Expand All @@ -16,7 +16,7 @@
},
{
"label": "Custom che-operator and che-server Minikube",
"command": "./bin/run server:start -n che -m -p minikube --che-operator-image=${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/che-operator:nightly --cheimage=${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/che-server:nightly",
"command": "./bin/run server:deploy -n che -m -p minikube --che-operator-image=${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/che-operator:nightly --cheimage=${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/che-server:nightly",
"type": "shell",
"args": [],
"problemMatcher": [
Expand All @@ -29,7 +29,7 @@
},
{
"label": "Custom che-operator Openshift",
"command": "./bin/run server:start -n che -m -p openshift -a operator --che-operator-image=${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/che-operator:nightly",
"command": "./bin/run server:deploy -n che -m -p openshift -a operator --che-operator-image=${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/che-operator:nightly",
"type": "shell",
"args": [],
"problemMatcher": [
Expand All @@ -42,7 +42,7 @@
},
{
"label": "Custom che-operator and che-server Openshift",
"command": "./bin/run server:start -n che -m -p openshift -a operator --che-operator-image=${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/che-operator:nightly --cheimage=${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/che-server:nightly",
"command": "./bin/run server:deploy -n che -m -p openshift -a operator --che-operator-image=${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/che-operator:nightly --cheimage=${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/che-server:nightly",
"type": "shell",
"args": [],
"problemMatcher": [
Expand Down
63 changes: 33 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ USAGE
* [`chectl help [COMMAND]`](#chectl-help-command)
* [`chectl server:debug`](#chectl-serverdebug)
* [`chectl server:delete`](#chectl-serverdelete)
* [`chectl server:deploy`](#chectl-serverdeploy)
* [`chectl server:logs`](#chectl-serverlogs)
* [`chectl server:start`](#chectl-serverstart)
* [`chectl server:status`](#chectl-serverstatus)
* [`chectl server:stop`](#chectl-serverstop)
* [`chectl server:update`](#chectl-serverupdate)
Expand Down Expand Up @@ -277,37 +277,13 @@ OPTIONS

_See code: [src/commands/server/delete.ts](https://github.com/che-incubator/chectl/blob/v0.0.2/src/commands/server/delete.ts)_

## `chectl server:logs`

Collect Eclipse Che logs

```
USAGE
$ chectl server:logs

OPTIONS
-d, --directory=directory Directory to store logs into
-h, --help show CLI help

-n, --chenamespace=chenamespace [default: che] Kubernetes namespace where Eclipse Che server is supposed to
be deployed

--deployment-name=deployment-name [default: che] Eclipse Che deployment name

--listr-renderer=default|silent|verbose [default: default] Listr renderer

--skip-kubernetes-health-check Skip Kubernetes health check
```

_See code: [src/commands/server/logs.ts](https://github.com/che-incubator/chectl/blob/v0.0.2/src/commands/server/logs.ts)_

## `chectl server:start`
## `chectl server:deploy`

start Eclipse Che server

```
USAGE
$ chectl server:start
$ chectl server:deploy

OPTIONS
-a, --installer=helm|operator|olm|minishift-addon
Expand Down Expand Up @@ -455,14 +431,41 @@ OPTIONS
the latest known version.
This parameter is used only when the installer is 'olm'.

--workspace-engine=legacy|dev-workspace
[default: legacy] Workspace Engine. If not set, default is "legacy". "dev-workspace" is experimental.
--workspace-engine=che-server|dev-workspace
[default: che-server] Workspace Engine. If not set, default is "che-server". "dev-workspace" is experimental.

--workspace-pvc-storage-class-name=workspace-pvc-storage-class-name
persistent volume(s) storage class name to use to store Eclipse Che workspaces data

ALIASES
$ chectl server:start
```

_See code: [src/commands/server/start.ts](https://github.com/che-incubator/chectl/blob/v0.0.2/src/commands/server/start.ts)_
_See code: [src/commands/server/deploy.ts](https://github.com/che-incubator/chectl/blob/v0.0.2/src/commands/server/deploy.ts)_

## `chectl server:logs`

Collect Eclipse Che logs

```
USAGE
$ chectl server:logs

OPTIONS
-d, --directory=directory Directory to store logs into
-h, --help show CLI help

-n, --chenamespace=chenamespace [default: che] Kubernetes namespace where Eclipse Che server is supposed to
be deployed

--deployment-name=deployment-name [default: che] Eclipse Che deployment name

--listr-renderer=default|silent|verbose [default: default] Listr renderer

--skip-kubernetes-health-check Skip Kubernetes health check
```

_See code: [src/commands/server/logs.ts](https://github.com/che-incubator/chectl/blob/v0.0.2/src/commands/server/logs.ts)_

## `chectl server:status`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ import { CommonPlatformTasks } from '../../tasks/platforms/common-platform-tasks
import { PlatformTasks } from '../../tasks/platforms/platform'
import { getCommandSuccessMessage, initializeContext, isOpenshiftPlatformFamily } from '../../util'

export default class Start extends Command {
export default class Deploy extends Command {
static description = 'start Eclipse Che server'
static aliases = ['server:start']

static flags: flags.Input<any> = {
help: flags.help({ char: 'h' }),
Expand Down Expand Up @@ -342,7 +343,11 @@ export default class Start extends Command {
}

async run() {
const { flags } = this.parse(Start)
if (process.argv.indexOf('server:start')) {
this.warn('\'server:start\' command is deprecated. Use \'server:deploy\' instead.')
}

const { flags } = this.parse(Deploy)
const ctx = initializeContext()
ctx.directory = path.resolve(flags.directory ? flags.directory : path.resolve(os.tmpdir(), 'chectl-logs', Date.now().toString()))
const listrOptions: Listr.ListrOptions = { renderer: (flags['listr-renderer'] as any), collapse: false, showSubtasks: true } as Listr.ListrOptions
Expand Down
2 changes: 1 addition & 1 deletion src/commands/server/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default class Update extends Command {
await preInstallTasks.run(ctx)

if (!ctx.isCheDeployed) {
this.error('Eclipse Che deployment is not found. Use `chectl server:start` to initiate a new deployment.')
this.error('Eclipse Che deployment is not found. Use `chectl server:deploy` to initiate a new deployment.')
} else {
if (isKubernetesPlatformFamily(flags.platform!)) {
await this.setDomainFlag(flags)
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/minikube.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ const PLATFORM = 'kubernetes'
const binChectl = `${process.cwd()}/bin/run`

describe('Eclipse Che deploy test suite', () => {
describe('server:start using operator and self signed certificates', () => {
describe('server:deploy using operator and self signed certificates', () => {
test
.stdout({ print: true })
.stderr({ print: true })
.command(['server:start', '--platform=minikube', '--che-operator-cr-patch-yaml=test/e2e/util/cr-test.yaml', '--tls', '--installer=operator', '--skip-cluster-availability-check'])
.command(['server:deploy', '--platform=minikube', '--che-operator-cr-patch-yaml=test/e2e/util/cr-test.yaml', '--tls', '--installer=operator', '--skip-cluster-availability-check'])
.exit(0)
.it('uses minikube as platform, operator as installer and auth is enabled')
test
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/minishift.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ const PLATFORM = 'openshift'
const binChectl = `${process.cwd()}/bin/run`

describe('Eclipse Che deploy test suite', () => {
describe('server:start using operator and self signed certificates', () => {
it('server:start using operator and self signed certificates', async () => {
const command = `${binChectl} server:start --platform=minishift --che-operator-cr-patch-yaml=test/e2e/util/cr-test.yaml --tls --installer=operator`
describe('server:deploy using operator and self signed certificates', () => {
it('server:deploy using operator and self signed certificates', async () => {
const command = `${binChectl} server:deploy --platform=minishift --che-operator-cr-patch-yaml=test/e2e/util/cr-test.yaml --tls --installer=operator`
const { exitCode, stdout, stderr } = await execa(command, { shell: true })

expect(exitCode).equal(0)
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/openshift.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ const PLATFORM = 'openshift'
const binChectl = `${process.cwd()}/bin/run`

describe('Eclipse Che deploy test suite', () => {
describe('server:start using operator and self signed certificates', () => {
it('server:start using operator and self signed certificates', async () => {
const command = `${binChectl} server:start --platform=${PLATFORM} --che-operator-cr-patch-yaml=test/e2e/util/cr-test.yaml --tls --installer=operator`
describe('server:deploy using operator and self signed certificates', () => {
it('server:deploy using operator and self signed certificates', async () => {
const command = `${binChectl} server:deploy --platform=${PLATFORM} --che-operator-cr-patch-yaml=test/e2e/util/cr-test.yaml --tls --installer=operator`
const { exitCode, stdout, stderr } = await execa(command, { shell: true })

expect(exitCode).equal(0)
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2094,19 +2094,19 @@ ecc-jsbn@~0.1.1:

"eclipse-che-devfile-workspace-operator@git://github.com/devfile/devworkspace-operator#master":
version "0.0.0"
resolved "git://github.com/devfile/devworkspace-operator#27dc45b83bd235789d72aee2cac4ac8f79ed430d"
resolved "git://github.com/devfile/devworkspace-operator#4ea0394233e7b90a3512a4e1323eb25590309ff3"

"eclipse-che-minishift@git://github.com/minishift/minishift#master":
version "0.0.0"
resolved "git://github.com/minishift/minishift#4b58f8954421fcbb7996ca67cba7ed8c58092a88"

"eclipse-che-operator@git://github.com/eclipse/che-operator#master":
version "0.0.0"
resolved "git://github.com/eclipse/che-operator#c5ab66b099d6ae64a7aafb856fa9da3c7d6c3a7a"
resolved "git://github.com/eclipse/che-operator#227046459c196fe8b95fd66a444a69808cac97e3"

"eclipse-che@git://github.com/eclipse/che#master":
version "0.0.0"
resolved "git://github.com/eclipse/che#695e6bddd33bd8081c008a70603439e8623fb522"
resolved "git://github.com/eclipse/che#00591be5ff0cd25d7dbf340adb419cae64e2f060"

editorconfig@^0.15.0:
version "0.15.3"
Expand Down