Skip to content

Commit

Permalink
added elastic_profile_id; release 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tomzo committed Dec 16, 2016
1 parent e2ffbdf commit 51bb6d3
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 4 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# 0.4.0 (16 Dec 2016)

* fixed IO error reporting
* added elastic_profile_id in job

# 0.3.0 (07 Nov 2016)

* added validation of duplicate keys

# 0.2.0 (21 Oct 2016)

* added optional `timeout` field to job
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,17 @@ test:
...
```

*Note: timeout is added since 0.2.0*
*Note: timeout is added since 0.2.0 version of yaml plugin*

### Elastic agent profile id

Job configuration may define elastic agents profile id, as such:
```yaml
elastic_profile_id: "docker.unit-test"
```

It MUST NOT be specified along with `resources`.
Available in GoCD server since v16.10.0, yaml plugin 0.4.0.

### Run many instances

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'cd.go.plugin.config.yaml'
version '0.2.0'
version '0.4.0'

apply plugin: 'java'

Expand Down
2 changes: 1 addition & 1 deletion release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [ ! -f linux-amd64-github-release.tar.bz2 ]; then
fi
tar xf linux-amd64-github-release.tar.bz2

VERSION="0.2.0"
VERSION="0.4.0"
GHRELEASE_BIN="./bin/linux/amd64/github-release"

$GHRELEASE_BIN release \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public class JobTransform {
private static final String JSON_JOB_TABS_FIELD = "tabs";
private static final String JSON_JOB_RESOURCES_FIELD = "resources";
private static final String YAML_JOB_RESOURCES_FIELD = "resources";
private static final String JSON_JOB_ELASTIC_PROFILE_FIELD = "elastic_profile_id";
private static final String YAML_JOB_ELASTIC_PROFILE_FIELD = "elastic_profile_id";
private static final String YAML_JOB_ARTIFACTS_FIELD = "artifacts";
private static final String JSON_JOB_ARTIFACTS_FIELD = "artifacts";
private static final String JSON_JOB_ARTIFACT_SOURCE_FIELD = "source";
Expand Down Expand Up @@ -70,6 +72,7 @@ public JsonObject transform(String jobName, Map<String, Object> jobMap) {
jobJson.add(JSON_ENV_VAR_FIELD, jsonEnvVariables);
addTabs(jobJson, jobMap);
addOptionalStringList(jobJson, jobMap, JSON_JOB_RESOURCES_FIELD, YAML_JOB_RESOURCES_FIELD);
addOptionalString(jobJson, jobMap, JSON_JOB_ELASTIC_PROFILE_FIELD, YAML_JOB_ELASTIC_PROFILE_FIELD);
addArtifacts(jobJson, jobMap);
addProperties(jobJson, jobMap);
addTasks(jobJson, jobMap);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<go-plugin id="yaml.config.plugin" version="1">
<about>
<name>YAML Configuration Plugin</name>
<version>0.2.0</version>
<version>0.4.0</version>
<target-go-version>16.7.0</target-go-version>
<description>
GoCD pipelines and environments configuration in YAML
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ public void shouldTransformCompleteJob() throws IOException {
testTransform("complete");
}

@Test
public void shouldTransformElasticProfileJob() throws IOException {
testTransform("elastic_profile");
}

private JsonObject testTransform(String caseFile) throws IOException {
return testTransform(caseFile, caseFile);
}
Expand Down
7 changes: 7 additions & 0 deletions src/test/resources/parts/jobs/elastic_profile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "test",
"elastic_profile_id" : "profile-id",
"tasks": [
null
]
}
4 changes: 4 additions & 0 deletions src/test/resources/parts/jobs/elastic_profile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
test:
elastic_profile_id: "profile-id"
tasks:
- null

0 comments on commit 51bb6d3

Please sign in to comment.