Skip to content

Commit

Permalink
Use latest tool version. Fix npm packages version. Install devon4j so…
Browse files Browse the repository at this point in the history
…nar plugin
  • Loading branch information
dario-rodriguez committed Feb 28, 2020
1 parent f3f7200 commit 94e85b4
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 71 deletions.
12 changes: 6 additions & 6 deletions devon4j-mts/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ pipeline {
//Add nodejs
//public boolean addNodeJS_Version(String installName, String nodeJS_Version, String npmPackages="", String home="", long npmPackagesRefreshHours=100) {
println "Trying to install nodejs config"
String installName = "NodeJS 12.16.0"
String nodeJS_Version = "12.16.0"
String installName = "NodeJS 12.16.1"
String nodeJS_Version = "12.16.1"
String npmPackages = "yarn"
String home = ""
long npmPackagesRefreshHours = 100

nodeJSInstallSuccess = jenkinsConfiguration.addNodeJS_Version(installName, nodeJS_Version, npmPackages, home, npmPackagesRefreshHours)
jdkInstallSuccess = jenkinsConfiguration.addJdkVersion("OpenJDK11", "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.5%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.5_10.tar.gz", "jdk-11.0.5+10")
jdkInstallSuccess = jenkinsConfiguration.addJdkVersion("OpenJDK11", "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.6_10.tar.gz", "jdk-11.0.6+10")
dependencyCheckConfig.installDependencyCheck('dependency-check', '5.2.4','')

//Add the required script approval
Expand Down Expand Up @@ -194,7 +194,7 @@ pipeline {
defaultValue('nexus-api')
description('registry credentials')
}
stringParam('registryUrl', 'https://docker-registry-devon.s2-eu.capgemini.com', 'docker registry url')
stringParam('registryUrl', 'REPLACE_ME', 'docker registry url')
stringParam('VERSION', '3.2.0', 'Version number')
stringParam('dockerNetwork', 'my-thai-star', 'The docker network for the deployed container')
}
Expand Down Expand Up @@ -228,7 +228,7 @@ pipeline {
defaultValue('nexus-api')
description('registry credentials')
}
stringParam('registryUrl', 'https://docker-registry-devon.s2-eu.capgemini.com', 'docker registry url')
stringParam('registryUrl', 'REPLACE_ME', 'docker registry url')
stringParam('VERSION', '3.2.0', 'Version number')
stringParam('dockerNetwork', 'my-thai-star', 'The docker network for the deployed container')
}
Expand Down Expand Up @@ -263,7 +263,7 @@ pipeline {
description('registry credentials')
}
booleanParam('buildReverseProxy', false, 'Build again the reverse proxy image?')
stringParam('registryUrl', 'https://docker-registry-devon.s2-eu.capgemini.com', 'docker registry url')
stringParam('registryUrl', 'REPLACE_ME', 'docker registry url')
stringParam('VERSION', '3.2.0', 'Version number')
stringParam('dockerNetwork', 'my-thai-star', 'The docker network for the deployed container')
}
Expand Down
19 changes: 7 additions & 12 deletions devon4j-pl/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pipeline{
}

environment {
NODE_VERSION = '12.16.0'
NODE_VERSION = '12.16.1'
}

stages {
Expand Down Expand Up @@ -74,7 +74,7 @@ pipeline{
long npmPackagesRefreshHours = 100

nodeJSInstallSuccess = jenkinsConfiguration.addNodeJS_Version(installName, nodeJS_Version, npmPackages, home, npmPackagesRefreshHours)
jdkInstallSuccess = jenkinsConfiguration.addJdkVersion("OpenJDK11", "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.5%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.5_10.tar.gz", "jdk-11.0.5+10")
jdkInstallSuccess = jenkinsConfiguration.addJdkVersion("OpenJDK11", "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.6_10.tar.gz", "jdk-11.0.6+10")

// Get the Pl Url
env.PL_URL = JENKINS_URL.replace("https://", "").split("/")[0]
Expand Down Expand Up @@ -116,11 +116,11 @@ pipeline{
message 'Introduce the openshift host'
parameters {
string defaultValue: 'default', description: 'Openshift configuration name', name: 'OC_NAME', trim: true
credentials(credentialType: 'com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl', defaultValue: 'nexus-devon', description: 'Nexus registry integration user credentials', name: 'DOCKER_REGISTRY_CREDENTIALS', required: true)
credentials(credentialType: 'com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl', defaultValue: 'nexus-api', description: 'Nexus registry integration user credentials', name: 'DOCKER_REGISTRY_CREDENTIALS', required: true)
}
}
environment {
OPENJDK_TAG='jre-11.0.4_11-alpine'
OPENJDK_TAG='jre-11.0.6_10-alpine'
PORT='8080'
CPU='100m'
MEMORY='600Mi'
Expand Down Expand Up @@ -224,15 +224,10 @@ pipeline{
git {
id('${UUID.randomUUID().toString()}')
remote('${ProductionLineGlobals.GITLAB_BASE_URL}/${params.GITLAB_CREATE_GROUP_NAME}/${PROJECT_NAME_FULL}.git')
credentialsId('github-ci')
credentialsId('')
includes('master release* develop')
}
}
orphanedItemStrategy {
discardOldItems {
numToKeep(10)
}
}
}
"""

Expand All @@ -251,7 +246,7 @@ pipeline{
cleanWs()
deleteDir()

sh 'sudo env "PATH=\$PATH" npm i -g @devonfw/cicdgen'
sh 'sudo env "PATH=\$PATH" npm i -g @devonfw/cicdgen@1.5'
}
}

Expand Down Expand Up @@ -283,7 +278,7 @@ pipeline{

dir(PROJECT_NAME_FULL){
sh 'git init'
sh 'git config user.email "jenkins-pl@capgemini.com"'
sh 'git config user.email "jenkins-pl@example.com"'
sh 'git config user.name "Jenkins"'
sh "cicdgen generate devon4j ${ocString}${dockerString}"
}
Expand Down
15 changes: 5 additions & 10 deletions devon4net-pl/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pipeline{
}

environment {
NODE_VERSION = '12.16.0'
NODE_VERSION = '12.16.1'
}

stages {
Expand Down Expand Up @@ -110,7 +110,7 @@ pipeline{
message 'Introduce the openshift host'
parameters {
string defaultValue: 'default', description: 'Openshift configuration name', name: 'OC_NAME', trim: true
credentials(credentialType: 'com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl', defaultValue: 'nexus-devon', description: 'Nexus registry integration user credentials', name: 'DOCKER_REGISTRY_CREDENTIALS', required: true)
credentials(credentialType: 'com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl', defaultValue: 'nexus-api', description: 'Nexus registry integration user credentials', name: 'DOCKER_REGISTRY_CREDENTIALS', required: true)
}
}
environment {
Expand Down Expand Up @@ -216,15 +216,10 @@ pipeline{
git {
id('${UUID.randomUUID().toString()}')
remote('${ProductionLineGlobals.GITLAB_BASE_URL}/${params.GITLAB_CREATE_GROUP_NAME}/${PROJECT_NAME_FULL}.git')
credentialsId('github-ci')
credentialsId('')
includes('master release* develop')
}
}
orphanedItemStrategy {
discardOldItems {
numToKeep(10)
}
}
}
"""

Expand Down Expand Up @@ -262,7 +257,7 @@ fi""", '/usr/bin')
cleanWs()
deleteDir()

sh 'npm i -g @devonfw/cicdgen'
sh 'npm i -g @devonfw/cicdgen@1.5'
}
}

Expand Down Expand Up @@ -301,7 +296,7 @@ fi""", '/usr/bin')

dir(PROJECT_NAME_FULL) {
sh "git init"
sh 'git config user.email "jenkins-pl@capgemini.com"'
sh 'git config user.email "jenkins-pl@example.com"'
sh 'git config user.name "Jenkins"'
sh "cicdgen generate devon4net ${ocString}${dockerString}--groupid ${params.GROUP_ID} --appname ${PROJECT_NAME_FULL} --appversion 0.0.1"
}
Expand Down
19 changes: 7 additions & 12 deletions devon4ng-pl/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ pipeline{
parameters {
string(name: 'PROJECT_NAME', defaultValue: 'devonfw', description: 'Name of the project.')
string(name: 'PROJECT_SUFFIX', defaultValue: 'frontend', description: 'Suffix of the project. For example, if your project name is devonfw and your suffix is frontend, the project name will be devonfw-frontend.')
string(name: 'GROUP_ID', defaultValue: 'com.devonfw', description: 'The group id of the project.')
credentials(credentialType: 'com.dabsquared.gitlabjenkins.connection.GitLabApiTokenImpl', defaultValue: 'gitlab-api-token', description: 'NEEDS TO BE SET!. Private Token of a Production Line Gitlab User that can be used to create repositories.', name: 'GITLAB_USER_PRIVATE_TOKEN', required: true)
string(name: 'GROUP_ID', defaultValue: 'com.devonfw', description: 'The group id of the project.')
credentials(credentialType: 'com.dabsquared.gitlabjenkins.connection.GitLabApiTokenImpl', defaultValue: '-token', description: 'NEEDS TO BE SET!. Private Token of a Production Line Gitlab User that can be used to create repositories.', name: 'GITLAB_USER_PRIVATE_TOKEN', required: true)
string(name: 'GITLAB_CREATE_GROUP_NAME', defaultValue: 'devonfw', description: 'Name of the GitLab group. The repository will be create inside this group.')
string(name: 'GITLAB_CREATE_PROJECT_DESCRIPTION', defaultValue: 'devonfw for angular PL template', description: 'Description of the repository.')
choice choices: ['none', 'docker', 'openshift'], description: 'Choose the environment where you want to deploy', name: 'DEPLOY'
}

environment {
NODE_VERSION = '12.16.0'
NODE_VERSION = '12.16.1'
}

stages {
Expand Down Expand Up @@ -110,7 +110,7 @@ pipeline{
message 'Introduce the openshift host'
parameters {
string defaultValue: 'default', description: 'Openshift configuration name', name: 'OC_NAME', trim: true
credentials(credentialType: 'com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl', defaultValue: 'nexus-devon', description: 'Nexus registry integration user credentials', name: 'DOCKER_REGISTRY_CREDENTIALS', required: true)
credentials(credentialType: 'com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl', defaultValue: 'nexus-api', description: 'Nexus registry integration user credentials', name: 'DOCKER_REGISTRY_CREDENTIALS', required: true)
}
}
environment {
Expand Down Expand Up @@ -216,15 +216,10 @@ pipeline{
git {
id('${UUID.randomUUID().toString()}')
remote('${ProductionLineGlobals.GITLAB_BASE_URL}/${params.GITLAB_CREATE_GROUP_NAME}/${PROJECT_NAME_FULL}.git')
credentialsId('github-ci')
credentialsId('')
includes('master release* develop')
}
}
orphanedItemStrategy {
discardOldItems {
numToKeep(10)
}
}
}
"""

Expand All @@ -243,7 +238,7 @@ pipeline{
cleanWs()
deleteDir()

sh 'npm i -g @angular/cli @devonfw/cicdgen'
sh 'npm i -g @angular/cli@9 @devonfw/cicdgen@1.5'
}
}

Expand Down Expand Up @@ -277,7 +272,7 @@ pipeline{
}

dir(PROJECT_NAME_FULL) {
sh 'git config user.email "jenkins-pl@capgemini.com"'
sh 'git config user.email "jenkins-pl@example.com"'
sh 'git config user.name "Jenkins"'
sh "cicdgen generate devon4ng ${ocString}${dockerString}--groupid ${params.GROUP_ID}"
}
Expand Down
15 changes: 5 additions & 10 deletions devon4node-pl/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pipeline{
}

environment {
NODE_VERSION = '12.16.0'
NODE_VERSION = '12.16.1'
}

stages {
Expand Down Expand Up @@ -110,7 +110,7 @@ pipeline{
message 'Introduce the openshift host'
parameters {
string defaultValue: 'default', description: 'Openshift configuration name', name: 'OC_NAME', trim: true
credentials(credentialType: 'com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl', defaultValue: 'nexus-devon', description: 'Nexus registry integration user credentials', name: 'DOCKER_REGISTRY_CREDENTIALS', required: true)
credentials(credentialType: 'com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl', defaultValue: 'nexus-api', description: 'Nexus registry integration user credentials', name: 'DOCKER_REGISTRY_CREDENTIALS', required: true)
}
}
environment {
Expand Down Expand Up @@ -215,15 +215,10 @@ pipeline{
git {
id('${UUID.randomUUID().toString()}')
remote('${ProductionLineGlobals.GITLAB_BASE_URL}/${params.GITLAB_CREATE_GROUP_NAME}/${PROJECT_NAME_FULL}.git')
credentialsId('github-ci')
credentialsId('')
includes('master release* develop')
}
}
orphanedItemStrategy {
discardOldItems {
numToKeep(10)
}
}
}
"""

Expand All @@ -241,7 +236,7 @@ pipeline{
cleanWs()
deleteDir()

sh 'sudo env "PATH=\$PATH" npm i -g @devon4node/cli @devonfw/cicdgen'
sh 'sudo env "PATH=\$PATH" npm i -g @devon4node/cli@1.1 @devonfw/cicdgen@1.5'
}
}
stage('devon4node new') {
Expand Down Expand Up @@ -273,7 +268,7 @@ pipeline{
}

dir(PROJECT_NAME_FULL) {
sh 'git config user.email "jenkins-pl@capgemini.com"'
sh 'git config user.email "jenkins-pl@example.com"'
sh 'git config user.name "Jenkins"'
sh "cicdgen generate devon4node ${ocString}${dockerString}--groupid ${params.GROUP_ID}"
}
Expand Down
2 changes: 1 addition & 1 deletion mrchecker/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pipeline{
params.GITLAB_CREATE_PROJECT_NAME,
params.GITLAB_CREATE_PROJECT_DESCRIPTION,
params.GITLAB_CREATE_BRANCH,
"https://github.com/devonfw/devonfw-testing.git",
"https://github.com/devonfw/mrchecker.git",
"public"
)
}
Expand Down
19 changes: 1 addition & 18 deletions template-utils/initialize-instance/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ fi""", "/usr/bin")
println "SonarQube webhook already added"
}
// Install sonarqube plugins
def sonarPlugins = ['java', 'javascript', 'typescript', 'csharp', 'web', 'cssfamily', 'jacoco', 'checkstyle', 'cobertura', 'smells', 'findbugs', 'scmgit', 'ansible']
def sonarPlugins = ['java', 'javascript', 'typescript', 'csharp', 'web', 'cssfamily', 'jacoco', 'checkstyle', 'cobertura', 'smells', 'findbugs', 'scmgit', 'ansible', 'devon4j']

sonarPlugins.each {
try {
Expand Down Expand Up @@ -143,9 +143,6 @@ fi""", "/usr/bin")
jobDsl scriptText: """
pipelineJob("UTILS/Install_SonarQube_Plugin") {
description('Install a plugin in the SonarQube')
parameters {
stringParam('plugin_download_url', '', 'Download URL for the plugin to install')
}
definition {
cpsScm {
scm {
Expand All @@ -169,9 +166,6 @@ fi""", "/usr/bin")
jobDsl scriptText: """
pipelineJob("UTILS/Docker_Configuration") {
description('Configure jenkins to deploy using Docker')
parameters {
stringParam('NEW_DOCKER_HOST', 'tcp://127.0.0.1:2375', 'Remote docker url')
}
definition {
cpsScm {
scm {
Expand All @@ -195,17 +189,6 @@ fi""", "/usr/bin")
jobDsl scriptText: """
pipelineJob("UTILS/Openshift_Configuration") {
description('Configure jenkins to deploy using Openshift')
parameters {
stringParam('ocName', 'default', 'Openshift configuration name')
stringParam('ocUrl', 'https://ocp.itaas.s2-eu.capgemini.com', 'Openshift url')
stringParam('ocProject', 's2portaldev', 'Openshift project')
credentialsParam('ocToken') {
type('com.openshift.jenkins.plugins.OpenShiftTokenCredentials')
required()
defaultValue('')
description('The openshift auth token. You can get it with the command: oc whoami -t')
}
}
definition {
cpsScm {
scm {
Expand Down
Loading

0 comments on commit 94e85b4

Please sign in to comment.