In order to use this plugin, users have to configure the following in the GoCD server.
- Configure plugin settings - The plugin settings are used to provide global level configurations for the plugin. Configurations such as AWS credentials, EC2 Instance settings, Docker Container settings, ECS Cluster configurations are provided in plugin settings.
- Create an elastic agent profile - The Elastic Agent Profile is used to define the configuration of a docker container. The profile is used to configure the docker image, set memory limits, provide docker command and environment variables.
- Configure job to use an elastic agent profile - This is a job level configuration to specify the elastic profile to be used for a job. When a job is scheduled the plugin would spin up a docker container using the configuration provided in the associated elastic profile.
Configure plugin settings
- Navigate to Admin > Plugins in the main menu
- Click on gear icon next to the
GoCD Elastic Agent Plugin for Amazon ECSand enter the required plugin configuration.
We will be soon introducing the plugin settings API in GoCD. If you prefer, this API can be used to configure the plugin over using the UI.
Create an elastic agent profile for ECS
The elastic agent profile apart from having docker container configurations, provides an ability to configure an EC2 Instance. This would be useful in cases where a docker container cannot be created on the EC2 Instance provisioned using configurations provided in the plugin settings.
- Navigate to Admin > Elastic Agent Profiles in the main menu
- Click the Add button to create a new elastic agent profile
- Specify a unique id for this profile
GoCD Elastic Agent Plugin for Amazon ECSas Plugin Id
- Specify the properties for docker container(s) which will be used to spawn ecs elastic agent for GoCD
- Specify the configuration for the EC2 instance. This is optional. If specified, then the docker container(s) will be spawned on this EC2 instance. Otherwise, it will be spawned on EC2 instance created using the global configuration specified in
- Save your changes
Configure job to use an elastic agent profile
- Click the gear icon on Pipeline
- Click on Quick Edit button
- Click on Stages
- Create/Edit a job
- Enter the unique id of an elastic profile in
- Save your changes