Skip to content

Commit

Permalink
Initial commit by kingsoftgames (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
wengchaoxi authored Aug 3, 2022
1 parent 435a98d commit e5f661b
Show file tree
Hide file tree
Showing 19 changed files with 85 additions and 195 deletions.
18 changes: 0 additions & 18 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

11 changes: 0 additions & 11 deletions .github/dependabot.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/release.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/stale.yml

This file was deleted.

73 changes: 0 additions & 73 deletions .github/workflows/test.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ terraform.tfstate*
vendor
dist/
coverage.txt
.vscode/
33 changes: 20 additions & 13 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,44 @@
# behavior.
before:
hooks:
# this is just an example and not a requirement for provider building/publishing
- go mod tidy
builds:
- env:
# goreleaser does not work with CGO, it could also complicate
# usage by users in CI/CD systems like Terraform Cloud where
# they are unable to install libraries.
- CGO_ENABLED=0
mod_timestamp: "{{ .CommitTimestamp }}"
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath
ldflags:
- "-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}"
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
goos:
- freebsd
- windows
- linux
- darwin
goarch:
- amd64
- "386"
- arm
- arm64
ignore:
- goos: darwin
goarch: "386"
binary: "{{ .ProjectName }}_v{{ .Version }}"
- goos: windows
goarch: arm64
- goos: linux
goarch: arm64
binary: '{{ .ProjectName }}_v{{ .Version }}'
archives:
- format: zip
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
extra_files:
- glob: 'terraform-registry-manifest.json'
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
algorithm: sha256
signs:
- artifacts: checksum
args:
# if you are using this is a GitHub action or some other automated pipeline, you
# if you are using this in a GitHub action or some other automated pipeline, you
# need to pass the batch flag to indicate its not interactive.
- "--batch"
- "--local-user"
Expand All @@ -48,4 +49,10 @@ signs:
- "--detach-sign"
- "${artifact}"
release:
draft: false
extra_files:
- glob: 'terraform-registry-manifest.json'
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
# If you want to manually examine the release before its live, uncomment this line:
# draft: true
snapshot:
name_template: '{{ .Env.BRANCH_NAME }}_b{{ .Env.BUILD_NUMBER }}_{{ time "2006-01-02" }}'
46 changes: 46 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env groovy

pipeline {
agent {
label 'os:linux && terraform'
}
options {
skipDefaultCheckout()
disableConcurrentBuilds()
ansiColor('xterm')
}
parameters {
string(name: 'RELEASE_VERSION',
defaultValue: '',
description: 'The version of the terraform provider. (MAJOR.MINOR.PATCH, e.g. 0.0.1). If the version is left empty, release stage will be skipped.',
trim:true)
}
stages {
stage("Checkout") {
steps {
checkout scm
}
}
stage("Build") {
when {
expression {
params.RELEASE_VERSION == ''
}
}
steps {
goreleaser snapshot: true
archiveArtifacts artifacts: 'dist/*.zip', fingerprint: true
}
}
stage("Release") {
when {
expression {
params.RELEASE_VERSION != ''
}
}
steps {
goreleaser releaseVersion: params.RELEASE_VERSION
}
}
}
}
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Terraform Provider

![Unit Tests](https://github.com/taiidani/terraform-provider-jenkins/workflows/Unit%20Tests/badge.svg)
![Acceptance Tests](https://github.com/taiidani/terraform-provider-jenkins/workflows/Acceptance%20Tests/badge.svg)

- Website: https://www.terraform.io
- [![Gitter chat](https://badges.gitter.im/hashicorp-terraform/Lobby.png)](https://gitter.im/hashicorp-terraform/Lobby)
- Mailing list: [Google Groups](http://groups.google.com/group/terraform-tool)
Expand All @@ -11,13 +8,13 @@ This is a community provider and is not supported by Hashicorp.

## Installation

This provider has been published to the Terraform Registry at https://registry.terraform.io/providers/taiidani/jenkins. Please visit the registry for documentation and installation instructions.
This provider has been published to the Terraform Registry at https://registry.terraform.io/providers/kingsoftgames/jenkins. Please visit the registry for documentation and installation instructions.

## Contributors

This repository is actively maintained as free time allows for me to work on it. I am accepting Issues and Pull Requests and if you are interested in helping as a maintainer I am open to the possibility. Please allow for 2-3 weeks of turnaround time on your contributions.

The scope of the provider covers the entire (extendable) Jenkins API provided that the https://github.com/bndr/gojenkins client library supports it. I accept submissions for functionality outside of Jenkins Core but expect that the plugin(s) required are _clearly stated_ in the documentation. See [jenkins_credential_vault_approle](https://registry.terraform.io/providers/taiidani/jenkins/latest/docs/resources/credential_vault_approle) for an example of this. I can only support these extensions as much as my own ability to test them allows -- Your Mileage May Vary.
The scope of the provider covers the entire (extendable) Jenkins API provided that the https://github.com/bndr/gojenkins client library supports it. I accept submissions for functionality outside of Jenkins Core but expect that the plugin(s) required are _clearly stated_ in the documentation. See [jenkins_credential_vault_approle](https://registry.terraform.io/providers/kingsoftgames/jenkins/latest/docs/resources/credential_vault_approle) for an example of this. I can only support these extensions as much as my own ability to test them allows -- Your Mileage May Vary.

## Developing the Provider

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/job.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ And in `job.xml`:
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<url>https://github.com/taiidani/terraform-provider-jenkins.git</url>
<url>https://github.com/kingsoftgames/terraform-provider-jenkins.git</url>
<credentialsId>github</credentialsId>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
Expand Down
2 changes: 1 addition & 1 deletion example/pipeline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<url>https://github.com/taiidani/terraform-provider-jenkins.git</url>
<url>https://github.com/kingsoftgames/terraform-provider-jenkins.git</url>
<credentialsId>github</credentialsId>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
Expand Down
2 changes: 1 addition & 1 deletion example/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ provider "jenkins" {
terraform {
required_providers {
jenkins = {
source = "taiidani/jenkins"
source = "kingsoftgames/jenkins"
version = ">= 0.5.0"
}
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/taiidani/terraform-provider-jenkins
module github.com/kingsoftgames/terraform-provider-jenkins

go 1.18

Expand Down
2 changes: 1 addition & 1 deletion jenkins/resource_jenkins_job_test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<url>https://github.com/taiidani/terraform-provider-jenkins.git</url>
<url>https://github.com/kingsoftgames/terraform-provider-jenkins.git</url>
<credentialsId>github</credentialsId>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
Expand Down
2 changes: 1 addition & 1 deletion jenkins/resource_jenkins_job_test_parameterized.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<url>https://github.com/taiidani/terraform-provider-jenkins.git</url>
<url>https://github.com/kingsoftgames/terraform-provider-jenkins.git</url>
<credentialsId>github</credentialsId>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
Expand Down
2 changes: 1 addition & 1 deletion jenkins/resource_jenkins_job_test_want.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<url>https://github.com/taiidani/terraform-provider-jenkins.git</url>
<url>https://github.com/kingsoftgames/terraform-provider-jenkins.git</url>
<credentialsId>github</credentialsId>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
//
// This file and the folder structure within the `jenkins/` subfolder conform to the Terraform provider expectations and
// best practices at https://www.terraform.io/docs/extend/. Please see the generated documentation at
// https://registry.terraform.io/providers/taiidani/jenkins for how to use the provider within Terraform itself.
// https://registry.terraform.io/providers/kingsoftgames/jenkins for how to use the provider within Terraform itself.
package main

import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/plugin"
"github.com/taiidani/terraform-provider-jenkins/jenkins"
"github.com/kingsoftgames/terraform-provider-jenkins/jenkins"
)

func main() {
Expand Down
Loading

0 comments on commit e5f661b

Please sign in to comment.