-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate jenkins_job 'parameters' property (#61)
* Deprecate parameters, update docs/examples * Early return when no parameters specified
- Loading branch information
Showing
16 changed files
with
186 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ jobs: | |
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.14 | ||
go-version: 1.16 | ||
- name: Import GPG key | ||
id: import_gpg | ||
uses: paultyng/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,11 +12,9 @@ resource "jenkins_folder" "example" { | |
resource "jenkins_job" "example" { | ||
name = "example" | ||
folder = jenkins_folder.example.id | ||
template = file("${path.module}/job.xml") | ||
parameters = { | ||
template = templatefile("${path.module}/job.xml", { | ||
description = "An example job created from Terraform" | ||
} | ||
}) | ||
} | ||
``` | ||
|
||
|
@@ -25,7 +23,7 @@ And in `job.xml`: | |
```xml | ||
<flow-definition plugin="[email protected]"> | ||
<actions/> | ||
<description>{{ .Parameters.description }}</description> | ||
<description>${description}</description> | ||
<keepDependencies>false</keepDependencies> | ||
<properties/> | ||
<definition class="org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition" plugin="[email protected]"> | ||
|
@@ -60,7 +58,7 @@ The following arguments are supported: | |
|
||
* `name` - (Required) The name of the job being created. | ||
* `folder` - (Optional) The folder namespace to store the job in. If creating in a nested folder structure you may separate folder names with `/`, such as `parent/child`. This name cannot be changed once the folder has been created, and all parent folders must be created in advance. | ||
* `parameters` - (Optional) A map of string values that are passed into the template for rendering. | ||
* `parameters` - (Optional) A map of string values that are passed into the template for rendering. **Deprecated:** Please use Terraform's built-in [templatefile](https://www.terraform.io/docs/language/functions/templatefile.html) function instead of this property. | ||
* `template` - (Required) A Jenkins-compatible XML template to describe the job. You can retrieve an existing jobs' XML by appending `/config.xml` to its URL and viewing the source in your browser. The `template` property is rendered using a Golang template that takes the other resource arguments as variables. Do not include the XML prolog in the definition. | ||
|
||
## Attribute Reference | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,15 @@ | ||
resource "jenkins_job" "pipeline" { | ||
name = "pipeline" | ||
folder = jenkins_folder.example.id | ||
template = file("${path.module}/pipeline.xml") | ||
|
||
parameters = { | ||
template = templatefile("${path.module}/pipeline.xml", { | ||
description = "An example pipeline job" | ||
} | ||
}) | ||
} | ||
|
||
resource "jenkins_job" "freestyle" { | ||
name = "freestyle" | ||
folder = jenkins_folder.example.id | ||
template = file("${path.module}/freestyle.xml") | ||
|
||
parameters = { | ||
template = templatefile("${path.module}/freestyle.xml", { | ||
description = "An example freestyle job" | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.1" encoding="UTF-8"?><flow-definition plugin="[email protected]"> | ||
<actions /> | ||
<description>{{ .Parameters.description }}</description> | ||
<description>${description}</description> | ||
<keepDependencies>false</keepDependencies> | ||
<properties /> | ||
<definition class="org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition" plugin="[email protected]"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.