Skip to content

Commit

Permalink
Improve dev file (#42)
Browse files Browse the repository at this point in the history
* Use newer go-lang language server. Make development container working on the minishift. Improve devfile tasks.

Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>

* Use stable editor for development. Improve some commands.

Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
  • Loading branch information
AndrienkoAleksandr authored Aug 12, 2019
1 parent 9c264be commit 2f38b1d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 21 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ For communication with che-machine-exec use websocket protocol.

#### Stop che-machine-exec server

To stop che-machine-exec server you can use task with name `kill exec server`.
To stop che-machine-exec server you can use task with name `stop exec server`.
24 changes: 13 additions & 11 deletions devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@ projects:
type: git
location: https://github.com/eclipse/che-machine-exec.git
components:
- alias: theia-editor
type: cheEditor
id: eclipse/che-theia/next
- alias: exec-plugin
type: chePlugin
id: eclipse/che-machine-exec-plugin/0.0.1
- alias: ms-vscode.go
type: chePlugin
id: ms-vscode/go/0.9.2
id: ms-vscode/go/0.11.0
- alias: typescript-plugin
type: chePlugin
id: che-incubator/typescript/1.30.2
Expand All @@ -34,7 +31,7 @@ components:
memoryLimit: 3Gi
- alias: dev
type: dockerimage
image: eclipse/che-machine-exec-dev
image: eclipse/che-machine-exec-dev:next
mountSources: true
endpoints:
- name: exec-server
Expand All @@ -47,9 +44,11 @@ components:
memoryLimit: 1024M
env:
- name: GOPATH
value: $(CHE_PROJECTS_ROOT)
value: /go:$(CHE_PROJECTS_ROOT)
- name: GOCACHE
value: $(GOPATH)/.cache
# replicate the GOCACHE from the plugin, even though the cache is not shared
# between the two
value: /tmp/.cache
commands:
- name: compile
actions:
Expand All @@ -67,22 +66,25 @@ commands:
actions:
- type: exec
component: dev
command: go fmt ./...
command: go fmt ./... && printf "\033[32mDone.\033[0m"
workdir: /projects/src/github.com/eclipse/che-machine-exec
- name: update dependencies
actions:
- type: exec
component: dev
command: dep ensure
command: dep ensure && printf "\033[32mDone.\033[0m"
workdir: /projects/src/github.com/eclipse/che-machine-exec
- name: start exec server
actions:
- type: exec
component: dev
command: ./che-machine-exec --url 0.0.0.0:5555
workdir: /projects/src/github.com/eclipse/che-machine-exec
- name: kill exec server
- name: stop exec server
actions:
- type: exec
component: dev
command: ps aux | grep "[.]/che-machine-exec" | head -1 | cut -d " " -f 2 | xargs kill
command: >-
pid=$(pidof che-machine-exec) && kill ${pid} &&
printf "\033[32mDone.\033[0m" ||
printf "\033[32mNothing to stop... Done.\033[0m"
12 changes: 3 additions & 9 deletions dockerfiles/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,10 @@
# Dockerfile defines che-machine-exec development image eclipse/che-machine-exec-dev
#

FROM golang:1.10.3-alpine
FROM quay.io/eclipse/che-golang-1.10:nightly

ARG DEP_LOCATION=/go/bin/dep

RUN apk add --update git bash wget less && \
wget https://github.com/golang/dep/releases/download/v0.5.1/dep-linux-amd64 -O ${DEP_LOCATION} && \
chmod +x ${DEP_LOCATION} && \
apk del wget
RUN wget https://github.com/golang/dep/releases/download/v0.5.1/dep-linux-amd64 -O ${DEP_LOCATION} && \
chmod +x ${DEP_LOCATION}
EXPOSE 5555 5555

WORKDIR /projects

CMD tail -f /dev/null

0 comments on commit 2f38b1d

Please sign in to comment.