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

CHE-4097: Refactor go agents package structure #4344

Merged
merged 2 commits into from
Mar 9, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 0 additions & 2 deletions agents/exec/.gitignore

This file was deleted.

59 changes: 0 additions & 59 deletions agents/exec/README.md

This file was deleted.

128 changes: 0 additions & 128 deletions agents/exec/src/auth/auth.go

This file was deleted.

65 changes: 0 additions & 65 deletions agents/exec/src/term/activity.go

This file was deleted.

2 changes: 2 additions & 0 deletions agents/go-agents/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
src/main/go/exec-agent/exec-agent
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that you should add this to gitignore?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is executable of go program. It may be created in development if user manually builds go sources.
Is something wrong with this exclusion?

src/main/go/exec-agent/logs
53 changes: 53 additions & 0 deletions agents/go-agents/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Summary
---
Golang based server for executing commands and streaming process output logs,
also websocket-terminal.


Requirements
--
- golang 1.6+


Docs
---
- jsonrpc2.0 based [Webscoket API](docs/ws_api.md)
- jsonrpc2.0 based [Events](docs/events.md)
- [REST API](docs/rest_api.md)

Development
---

##### Link the sources to standard go workspace

```bash
export CHE_PATH=~/code/che
mkdir $GOPATH/src/github.com/eclipse/che/agents/go-agents/src/main -p
ln -s $CHE_PATH/agents/go-agents/src/main/go $GOPATH/src/github.com/eclipse/che/agents/go-agents/src/main/go
```

That's it, `$GOPATH/src/github.com/eclipse/che/agents/go-agents` project is ready.

##### Building linked project

```bash
cd $GOPATH/src/github.com/eclipse/che/agents/go-agents/src/main/go && go build ./...
```

#### Building exec agent executable

```bash
cd $GOPATH/src/github.com/eclipse/che/agents/go-agents/src/main/go/exec-agent && go build
```

##### Running linked project tests

```bash
cd $GOPATH/src/github.com/eclipse/che/agents/go-agents/src/main/go && go test ./...
```

##### Formatting linked project sources

```bash
cd $GOPATH/src/github.com/eclipse/che/agents/go-agents/src/main/go && go fmt ./...
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
29 changes: 14 additions & 15 deletions agents/exec/pom.xml → agents/go-agents/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<groupId>org.eclipse.che</groupId>
<version>5.5.0-SNAPSHOT</version>
</parent>
<artifactId>exec-agent</artifactId>
<name>Exec Agent</name>
<artifactId>go-agents</artifactId>
<name>Agent :: Golang agents</name>
<properties>
<go.workspace.name>go-workspace</go.workspace.name>
</properties>
Expand Down Expand Up @@ -56,13 +56,10 @@
<artifactId>license-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>src/term/server.go</exclude>
<exclude>src/docs/**</exclude>
<exclude>src/vendor/**</exclude>
<exclude>src/Godeps/**</exclude>
<exclude>src/.idea/**</exclude>
<exclude>src/exec</exclude>
<exclude>src/*.iml</exclude>
<exclude>/docs/**</exclude>
<exclude>src/main/go/exec-agent/term/server.go</exclude>
<exclude>src/main/go/vendor/**</exclude>
<exclude>src/main/go/Godeps/**</exclude>
</excludes>
</configuration>
</plugin>
Expand All @@ -78,11 +75,13 @@
</goals>
<configuration>
<target>
<!--To not use godep tool vendored dependencies are copied into correct place of GOPATH
by maven-->
<copy todir="${project.build.directory}/${go.workspace.name}/src">
<fileset dir="./src/vendor/" includes="**/*" />
<fileset dir="src/main/go/vendor/" includes="**/*" />
</copy>
<copy todir="${project.build.directory}/${go.workspace.name}/src/github.com/eclipse/che/agents/exec">
<fileset dir="./src/" excludes="vendor/ target/" includes="**/*.*go **/static/*" />
<copy todir="${project.build.directory}/${go.workspace.name}/src/github.com/eclipse/che/agents/go-agents/src/main/go">
<fileset dir="src/main/go/" excludes="vendor/" includes="**/*.*go **/static/*" />
</copy>
</target>
</configuration>
Expand All @@ -95,7 +94,7 @@
<version>0.5.0</version>
<executions>
<execution>
<id>compile-exec-agent</id>
<id>compile-go-agents</id>
<phase>compile</phase>
<goals>
<goal>iterator</goal>
Expand Down Expand Up @@ -150,7 +149,7 @@
<goal>exec</goal>
<configuration>
<executable>go</executable>
<workingDirectory>${project.build.directory}/${go.workspace.name}/src/github.com/eclipse/che/agents/exec</workingDirectory>
<workingDirectory>${project.build.directory}/${go.workspace.name}/src/github.com/eclipse/che/agents/go-agents/src/main/go/exec-agent</workingDirectory>
<arguments>
<argument>build</argument>
<argument>-a</argument>
Expand Down Expand Up @@ -225,7 +224,7 @@
</goals>
<configuration>
<target unless="skipTests">
<exec dir="${project.build.directory}/${go.workspace.name}/src/github.com/eclipse/che/agents/exec" executable="go" failonerror="true">
<exec dir="${project.build.directory}/${go.workspace.name}/src/github.com/eclipse/che/agents/go-agents/src/main/go" executable="go" failonerror="true">
<env key="GOPATH" value="${project.build.directory}/${go.workspace.name}" />
<arg value="test" />
<arg value="-v" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,5 @@
<fileMode>0755</fileMode>
<outputDirectory></outputDirectory>
</fileSet>
<fileSet>
<directory>${project.build.directory}/${go.workspace.name}/src/github.com/eclipse/che/agents/exec/static</directory>
<outputDirectory></outputDirectory>
</fileSet>
</fileSets>
</assembly>
Loading