-
Notifications
You must be signed in to change notification settings - Fork 395
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #598 from zgyorffi/support-dockerfile-agent-declar…
…ation-with-filename Support dockerfile agent declaration with filename
- Loading branch information
Showing
5 changed files
with
100 additions
and
44 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
55 changes: 55 additions & 0 deletions
55
...ain/groovy/com/lesfurets/jenkins/unit/declarative/agent/DockerfileAgentDeclaration.groovy
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package com.lesfurets.jenkins.unit.declarative.agent | ||
|
||
|
||
import com.lesfurets.jenkins.unit.declarative.GenericPipelineDeclaration | ||
import groovy.transform.ToString | ||
|
||
@ToString(includePackage = false, includeNames = true, ignoreNulls = true) | ||
class DockerfileAgentDeclaration extends GenericPipelineDeclaration { | ||
String additionalBuildArgs | ||
String args | ||
String customWorkspace | ||
String dockerfileDir | ||
String filename | ||
String label | ||
String registryCredentialsId | ||
String registryUrl | ||
Boolean reuseNode | ||
|
||
def additionalBuildArgs(String additionalBuildArgs) { | ||
this.additionalBuildArgs = additionalBuildArgs | ||
} | ||
|
||
def args(String args) { | ||
this.args = args | ||
} | ||
|
||
def customWorkspace(final String customWorkspace) { | ||
this.customWorkspace = customWorkspace | ||
} | ||
|
||
def dir(String dir) { | ||
this.dockerfileDir = dir | ||
} | ||
|
||
def filename(String filename) { | ||
this.filename = filename | ||
} | ||
|
||
def label(final String label) { | ||
this.label = label | ||
} | ||
|
||
def registryCredentialsId(final String registryCredentialsId) { | ||
this.registryCredentialsId = registryCredentialsId | ||
} | ||
|
||
def registryUrl(final String registryUrl) { | ||
this.registryUrl = registryUrl | ||
} | ||
|
||
def reuseNode(boolean reuse) { | ||
this.reuseNode = reuse | ||
} | ||
|
||
} |
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
9 changes: 9 additions & 0 deletions
9
src/test/jenkins/jenkinsfiles/Dockerfile_Agent_Default_Jenkinsfile
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
pipeline { | ||
stages { | ||
stage('Build') { | ||
agent { | ||
dockerfile true | ||
} | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/test/jenkins/jenkinsfiles/Dockerfile_Agent_Only_Filename_JenkinsFile
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
pipeline { | ||
stages { | ||
stage('Build') { | ||
agent { | ||
dockerfile { | ||
filename 'Dockerfile' | ||
} | ||
} | ||
} | ||
} | ||
} |