Skip to content

Commit

Permalink
Fix create resource jenkins_authorization_global_matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
ringanta committed Jan 5, 2021
1 parent c7dd94d commit c93f7c7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ HOSTNAME=ringanta.id
NAMESPACE=ringanta
NAME=jenkins
BINARY=terraform-provider-${NAME}
VERSION=0.2
VERSION=0.2.1
OS_ARCH=darwin_amd64
export COMPOSE_FILE=./docker_compose/docker-compose.yml

Expand Down
4 changes: 3 additions & 1 deletion examples/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ resource "jenkins_authorization_global_matrix" "test" {
"Overall/Read",
"Job/Build",
"Job/Cancel",
"Job/Read"
"Job/Read",
"Run/Update",
"Run/Delete"
]
}

Expand Down
2 changes: 1 addition & 1 deletion examples/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
jenkins = {
source = "ringanta.id/ringanta/jenkins"
version = "~> 0.1.0"
version = "0.2.1"
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions jenkins/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,12 @@ def permissionIds = Permission.all.findAll { permission ->
def strategy = Jenkins.instance.getAuthorizationStrategy()
def result = [error: false, msg: '', data: [:]]
def user_permissions = [{{range .Permissions}}'{{.}}',{{end}}]
user_permissions.removeAll([null])
user_permissions.collect {
strategy.add(permissionIds[it], '{{ .Username }}')
}
Jenkins.instance.save()
result['msg'] = 'Permissions for user {{ .Username }} is created'
Expand Down

0 comments on commit c93f7c7

Please sign in to comment.