Skip to content

Commit

Permalink
Release 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bdpiprava committed Sep 20, 2017
1 parent 15b741a commit eaff838
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 70 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
## 1.1.5 - TBD
## 2.0.0 - 2019-09-19

### Added

- Support for private docker registry support
- Tooltip help text on elastic profile fields
- Support for binding secrets with containers
- Plugin uses elastic agent extension v2 and supports status report

**_Note:_** *_This requires GoCD version `17.9.0` or above_*

## 1.1.4 - 2017-04-27

Expand Down
127 changes: 62 additions & 65 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,71 +113,60 @@ Docker URI (for mac and linux) — unix:///var/run/docker.sock
Auto register timeout - between 1-3 minutes
```
Now setup the config.xml —
* add `agentAutoRegisterKey="some-secret-key"` to the `<server/>` tag.
* setup a job —
```xml
<server agentAutoRegisterKey="...">
<elastic>
<profiles>
<profile id="docker.unit-tests" pluginId="cd.go.contrib.elastic-agent.docker-swarm">
<!-- The following properties are currently supported -->
<property>
<!-- Allows you to select the docker image that the build should run with -->
<key>Image</key>
<value>gocd/gocd-agent-alpine-3.5</value>
</property>
<property>
<!-- Allows you to set the environment variables when starting the docker container -->
<key>Environment</key>
<value>
JAVA_HOME=/opt/java
MAKE_OPTS=-j8
</value>
</property>
<property>
<!-- Allows you to set the memory limit on the container use a KB, MB, GB suffix -->
<key>MaxMemory</key>
<value>2GB</value>
</property>
<property>
<!-- Allows you to set the memory reservation on the container use a KB, MB, GB suffix -->
<key>ReservedMemory</key>
<value>1GB</value>
</property>
<property>
<!-- Allows you to set the command that should be run on the container, separate executable and each args by a newline -->
<key>Command</key>
<value>
ls
-al
/usr/bin
</value>
</property>
</profile>
</profiles>
</elastic>
</server>
...
<pipelines group="defaultGroup">
<pipeline name="Foo">
<materials>
<git url="YOUR GIT URL" />
</materials>
<stage name="defaultStage">
<jobs>
<job name="defaultJob" elasticProfileId="docker.unit-tests">
<tasks>
<exec command="ls" />
</tasks>
</job>
</jobs>
</stage>
</pipeline>
</pipelines>
```
Now Let's configure the plugin —

## Plugin settings

In order to use the plugin user have to configure the plugin settings.

1. Login to `GoCD server` as admin and navigate to **_Admin_** _>_ **_Plugins_**

![Plugins][1]

2. Open a plugin settings for the `GoCD Elastic agent plugin for Docker Swarm`
- Provide Go server url (`https://YOUR_HOST_OR_IP_ADDRESS:8154/go`). Server hostname/ip must resolve in your container. Don't use `localhost` or `127.0.0.1`.
- Specify agent auto-register timeout(in minutes)
- Specify maximum docker containers to run at any given point in time. Plugin will not create more container when running container count reached to specified limits.
- Specify docker uri.
- If your Go Server is running on local machine then use(for mac and linux) — `unix:///var/run/docker.sock`
- Save the plugin settings
![Configure plugin settings][2]
## Create an elastic profile
1. Login to `GoCD server` as admin and navigate to **_Admin_** _>_ **_Elastic Agent Profiles_**
![Elastic Profiles][3]
2. Click on **_Add_** to create new elastic agent profile
1. Specify `id` for profile.
2. Select `GoCD Docker Swarm Elastic Agents` for **_Plugin id_**
3. Specify GoCD elastic agent docker image name.
4. Specify Soft memory limit. Container will start with memory specified here.
5. Specify hard memory limit. The maximum amount of memory the container can use.
6. Save your profile
![Create elastic profile][4]
### Configure job to use an elastic agent profile
1. Click the gear icon on **_Pipeline_**
![Pipeline][5]
2. Click on **_Quick Edit_** button
![Quick edit][6]
3. Click on **_Stages_**
4. Create/Edit a job
5. Enter the `unique id` of an elastic profile in Job Settings
![Configure a job][7]
6. Save your changes
## Troubleshooting
Expand Down Expand Up @@ -210,3 +199,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

[1]: images/plugins.png "Plugins"
[2]: images/plugin-settings.png "Configure plugin settings"
[3]: images/profiles_page.png "Elastic profiles"
[4]: images/profile.png "Create elastic profile"
[5]: images/pipeline.png "Pipeline"
[6]: images/quick-edit.png "Quick edit"
[7]: images/configure-job.png "Configure a job"
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ apply plugin: 'java'
apply from: 'plugin-common.gradle'

group = 'cd.go.contrib'
version = '1.1.4'
version = '2.0.0'
description = 'GoCD Docker Swarm Elastic Agents'

project.ext.pluginDesc = [
Expand Down Expand Up @@ -83,7 +83,7 @@ jar {
from(configurations.compile) {
into "lib/"
}
from(sourceSets.main.java) {
into "/"
}
// from(sourceSets.main.java) {
// into "/"
// }
}
Binary file added images/configure-job.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pipeline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/plugin-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/plugins.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/profiles_page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/quick-edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit eaff838

Please sign in to comment.