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

Implement golang bootstrapper #5399

Merged
merged 6 commits into from
Jun 20, 2017
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
170 changes: 170 additions & 0 deletions agents/bootstrapper/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2012-2017 Codenvy, S.A.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html

Contributors:
Codenvy, S.A. - initial API and implementation

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>che-agents-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>5.13.0-SNAPSHOT</version>
</parent>
<artifactId>bootstrapper</artifactId>
<name>Agents :: Bootstrapper</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>copy-sources</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</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/src">
<fileset dir="${basedir}/../go-agents/vendor/" includes="**/*" />
</copy>
<copy todir="${project.build.directory}/go-workspace/src/github.com/eclipse/che/agents/go-agents">
<fileset dir="${basedir}/../go-agents/">
<exclude name="vendor/" />
<exclude name="target/" />
<include name="**/*.*go" />
</fileset>
</copy>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.soebes.maven.plugins</groupId>
<artifactId>iterator-maven-plugin</artifactId>
<version>0.5.0</version>
<executions>
<execution>
<id>compile-go-agents</id>
<phase>compile</phase>
<goals>
<goal>iterator</goal>
</goals>
<configuration>
<itemsWithProperties>
<itemWithProperty>
<name>linux_arm5</name>
<properties>
<go.target.os>linux</go.target.os>
<go.target.architecture>arm</go.target.architecture>
<go.target.arm.version>5</go.target.arm.version>
</properties>
</itemWithProperty>
<itemWithProperty>
<name>linux_arm6</name>
<properties>
<go.target.os>linux</go.target.os>
<go.target.architecture>arm</go.target.architecture>
<go.target.arm.version>6</go.target.arm.version>
</properties>
</itemWithProperty>
<itemWithProperty>
<name>linux_arm7</name>
<properties>
<go.target.os>linux</go.target.os>
<go.target.architecture>arm</go.target.architecture>
<go.target.arm.version>7</go.target.arm.version>
</properties>
</itemWithProperty>
<itemWithProperty>
<name>linux_amd64</name>
<properties>
<go.target.os>linux</go.target.os>
<go.target.architecture>amd64</go.target.architecture>
</properties>
</itemWithProperty>
<itemWithProperty>
<name>linux_i386</name>
<properties>
<go.target.os>linux</go.target.os>
<go.target.architecture>386</go.target.architecture>
</properties>
</itemWithProperty>
</itemsWithProperties>
<pluginExecutors>
<pluginExecutor>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
</plugin>
<goal>exec</goal>
<configuration>
<executable>go</executable>
<workingDirectory>${project.build.directory}/go-workspace/src/github.com/eclipse/che/agents/go-agents/bootstrapper</workingDirectory>
<arguments>
<argument>build</argument>
<argument>-a</argument>
<argument>-installsuffix</argument>
<argument>cgo</argument>
<argument>-o</argument>
<argument>${project.build.directory}/${item}/bootstrapper</argument>
</arguments>
<environmentVariables>
<CGO_ENABLED>0</CGO_ENABLED>
<GOPATH>${project.build.directory}/go-workspace</GOPATH>
<GOOS>${go.target.os}</GOOS>
<GOARCH>${go.target.architecture}</GOARCH>
<GOARM>${go.target.arm.version}</GOARM>
</environmentVariables>
</configuration>
</pluginExecutor>
</pluginExecutors>
</configuration>
</execution>
<execution>
<id>assembly</id>
<phase>package</phase>
<goals>
<goal>iterator</goal>
</goals>
<configuration>
<items>
<item>linux_arm5</item>
<item>linux_arm6</item>
<item>linux_arm7</item>
<item>linux_amd64</item>
<item>linux_i386</item>
</items>
<pluginExecutors>
<pluginExecutor>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<goal>single</goal>
<configuration>
<tarLongFileMode>posix</tarLongFileMode>
<descriptors>
<descriptor>${basedir}/src/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
</pluginExecutor>
</pluginExecutors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
33 changes: 33 additions & 0 deletions agents/bootstrapper/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!--

Copyright (c) 2012-2017 Codenvy, S.A.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html

Contributors:
Codenvy, S.A. - initial API and implementation

-->
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>${item}</id>
<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>bootstrapper</baseDirectory>
<formats>
<format>zip</format>
<format>tar.gz</format>
</formats>
<fileSets>
<fileSet>
<directory>${project.build.directory}/${item}</directory>
<includes>
<include>bootstrapper</include>
</includes>
<fileMode>0755</fileMode>
<outputDirectory></outputDirectory>
</fileSet>
</fileSets>
</assembly>
1 change: 1 addition & 0 deletions agents/go-agents/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
exec-agent/exec-agent
exec-agent/logs
terminal-agent/terminal-agent
bootstrapper/bootstrapper
Loading