Skip to content

Commit

Permalink
fix losing git scm resource
Browse files Browse the repository at this point in the history
  • Loading branch information
jgramoll committed Jul 31, 2019
1 parent 5b54ec1 commit 9588a33
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,8 @@ resource "jenkins_job_gerrit_branch" "main" {
1. import resources
1. Refactor unmarshall to use map
1. Refactor types = reflect checks
1. DatadogJobProperty
<!-- <org.datadog.jenkins.plugins.datadog.DatadogJobProperty plugin="datadog@0.7.1">
<emitOnCheckout>false</emitOnCheckout>
</org.datadog.jenkins.plugins.datadog.DatadogJobProperty> -->
1. Fragile TestAccJobBuildDiscarderPropertyStrategyLogRotatorBasic test
2 changes: 1 addition & 1 deletion client/job_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func NewJobActions() *JobActions {

func (actions *JobActions) Append(action JobAction) *JobActions {
newActions := NewJobActions()
if actions.Items != nil {
if actions != nil && actions.Items != nil {
*newActions.Items = append(*actions.Items, action)
} else {
*newActions.Items = []JobAction{action}
Expand Down
4 changes: 2 additions & 2 deletions client/job_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ type jobConfig struct {
KeepDependencies bool `xml:"keepDependencies"`
Properties *JobProperties `xml:"properties"`
Definition *JobDefinitionXml `xml:"definition"`
// triggers
Disabled bool `xml:"disabled"`
Triggers string `xml:"trigger"`
Disabled bool `xml:"disabled"`
}

func JobConfigFromJob(job *Job) *jobConfig {
Expand Down
1 change: 1 addition & 0 deletions client/job_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ func TestJobConfigSerialize(t *testing.T) {
<scriptPath></scriptPath>
<lightweight>false</lightweight>
</definition>
<trigger></trigger>
<disabled>false</disabled>
</flow-definition>`
if result != expected {
Expand Down
7 changes: 4 additions & 3 deletions provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ func Provider() terraform.ResourceProvider {
"jenkins_job_declarative_job_action": jobDeclarativeJobActionResource(),
"jenkins_job_declarative_job_property_tracker_action": jobDeclarativeJobPropertyTrackerActionResource(),

"jenkins_job_git_scm_user_remote_config": jobGitScmUserRemoteConfigResource(),
"jenkins_job_git_scm_branch": jobGitScmBranchResource(),
"jenkins_job_git_scm": jobGitScmResource(),
"jenkins_job_git_scm_user_remote_config": jobGitScmUserRemoteConfigResource(),
"jenkins_job_git_scm_branch": jobGitScmBranchResource(),
"jenkins_job_git_scm_clean_before_checkout_extension": jobGitScmCleanBeforeCheckoutExtensionResource(),

"jenkins_job_git_scm_clean_before_checkout_extension": jobGitScmCleanBeforeCheckoutExtensionResource(),
"jenkins_job_build_discarder_property": jobBuildDiscarderPropertyResource(),
"jenkins_job_build_discarder_property_log_rotator_strategy": jobBuildDiscarderPropertyStrategyLogRotatorResource(),

Expand Down

0 comments on commit 9588a33

Please sign in to comment.