Apostolos Fanakis
5 years ago
6 changed files with 26 additions and 54 deletions
@ -0,0 +1,7 @@ |
|||
VIRTUAL_HOST=jenkins.mthmmy.tk |
|||
VIRTUAL_PORT=8080 |
|||
LETSENCRYPT_HOST=jenkins.mthmmy.tk |
|||
LETSENCRYPT_EMAIL=apotwohd@gmail.com |
|||
SONARQUBE_HOST=127.0.0.1:9000 |
|||
JENKINS_URL=https://jenkins.mthmmy.tk/ |
|||
GITHUB_TOKEN=testssss |
@ -0,0 +1,7 @@ |
|||
VIRTUAL_HOST=sonar.mthmmy.tk |
|||
VIRTUAL_PORT=9000 |
|||
LETSENCRYPT_HOST=sonar.mthmmy.tk |
|||
LETSENCRYPT_EMAIL=apotwohd@gmail.com |
|||
sonar.jdbc.username=sonar |
|||
sonar.jdbc.password=sonar |
|||
sonar.jdbc.url=jdbc:postgresql://sonar-db:5432/sonar |
@ -1,37 +0,0 @@ |
|||
import jenkins.model.* |
|||
import com.cloudbees.plugins.credentials.* |
|||
import com.cloudbees.plugins.credentials.common.* |
|||
import com.cloudbees.plugins.credentials.domains.* |
|||
import com.cloudbees.plugins.credentials.impl.* |
|||
import com.cloudbees.jenkins.plugins.sshcredentials.impl.* |
|||
import org.jenkinsci.plugins.plaincredentials.* |
|||
import org.jenkinsci.plugins.plaincredentials.impl.* |
|||
import hudson.util.Secret |
|||
import hudson.plugins.sshslaves.* |
|||
import org.apache.commons.fileupload.* |
|||
import org.apache.commons.fileupload.disk.* |
|||
import java.nio.file.Files |
|||
|
|||
def env = System.getenv() |
|||
|
|||
GITHUB_TOKEN = env['GITHUB_TOKEN'] |
|||
|
|||
domain = Domain.global() |
|||
store = Jenkins.instance.getExtensionList('com.cloudbees.plugins.credentials.SystemCredentialsProvider')[0].getStore() |
|||
|
|||
println("== multibranch-github-pipeline.groovy => Starting.") |
|||
if ( GITHUB_TOKEN ) { |
|||
println("== multibranch-github-pipeline.groovy => Adding token.") |
|||
secretText = new StringCredentialsImpl( |
|||
CredentialsScope.GLOBAL, |
|||
"github-token", |
|||
"This is the token used for Github source branch plugin", |
|||
Secret.fromString(GITHUB_TOKEN) |
|||
) |
|||
|
|||
store.addCredentials(domain, secretText) |
|||
println("== multibranch-github-pipeline.groovy => token added.") |
|||
|
|||
} |
|||
|
|||
println("== multibranch-github-pipeline.groovy => Done.") |
Loading…
Reference in new issue