diff --git a/CHANGELOG.md b/CHANGELOG.md index 4aa28e3a..686f1ed5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 88bbf608..cbbbab85 100644 --- a/README.md +++ b/README.md @@ -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 `` tag. -* setup a job — - -```xml - - - - - - - - Image - gocd/gocd-agent-alpine-3.5 - - - - Environment - - JAVA_HOME=/opt/java - MAKE_OPTS=-j8 - - - - - MaxMemory - 2GB - - - - ReservedMemory - 1GB - - - - Command - - ls - -al - /usr/bin - - - - - - -... - - - - - - - - - - - - - - - - -``` +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 @@ -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" \ No newline at end of file diff --git a/build.gradle b/build.gradle index 373281b3..78af4bf8 100644 --- a/build.gradle +++ b/build.gradle @@ -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 = [ @@ -83,7 +83,7 @@ jar { from(configurations.compile) { into "lib/" } - from(sourceSets.main.java) { - into "/" - } +// from(sourceSets.main.java) { +// into "/" +// } } diff --git a/images/configure-job.png b/images/configure-job.png new file mode 100644 index 00000000..69257d20 Binary files /dev/null and b/images/configure-job.png differ diff --git a/images/pipeline.png b/images/pipeline.png new file mode 100644 index 00000000..3966ba28 Binary files /dev/null and b/images/pipeline.png differ diff --git a/images/plugin-settings.png b/images/plugin-settings.png new file mode 100644 index 00000000..91d6de4f Binary files /dev/null and b/images/plugin-settings.png differ diff --git a/images/plugins.png b/images/plugins.png new file mode 100644 index 00000000..90812dc6 Binary files /dev/null and b/images/plugins.png differ diff --git a/images/profile.png b/images/profile.png new file mode 100644 index 00000000..30c802ab Binary files /dev/null and b/images/profile.png differ diff --git a/images/profiles_page.png b/images/profiles_page.png new file mode 100644 index 00000000..e85d43bc Binary files /dev/null and b/images/profiles_page.png differ diff --git a/images/quick-edit.png b/images/quick-edit.png new file mode 100644 index 00000000..33309ada Binary files /dev/null and b/images/quick-edit.png differ