Updated Jenkinsfile and Jenkinsjob.xml
This commit is contained in:
parent
53295d75b9
commit
9f30f61a0f
|
|
@ -0,0 +1,41 @@
|
|||
pipeline {
|
||||
|
||||
agent none
|
||||
|
||||
parameters {
|
||||
string(name: "gcube_settings",
|
||||
defaultValue: "/home/jenkins/.m2/jenkins-job-settings.xml",
|
||||
description: "The maven settings")
|
||||
string(name: 'local_repo',
|
||||
defaultValue: "/home/jenkins/.m2/local-snapshot",
|
||||
description: "The local_repo")
|
||||
string(name: "maven_activation_property",
|
||||
defaultValue: "",
|
||||
description: "Maven activation properties")
|
||||
booleanParam(name: "continuous_deploy",
|
||||
defaultValue: false,
|
||||
description: "Enable continuos deploy")
|
||||
string(name: "continuous_deploy_destination",
|
||||
defaultValue: "development",
|
||||
description: "The deploy environment")
|
||||
string(name: "gcube_agent",
|
||||
defaultValue: "gcube-agent-jdk17",
|
||||
description: "The agent that build the component")
|
||||
}
|
||||
|
||||
environment {
|
||||
MAVEN_CONFIG_FOLDER = "/home/jenkins/.m2"
|
||||
SKIP_TESTS = "true"
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('BUILD') {
|
||||
agent { label "${params.gcube_agent}" }
|
||||
steps {
|
||||
echo "Building ${env.JOB_NAME}"
|
||||
echo "Agent: ${params.gcube_agent}"
|
||||
sh "mvn -f pom.javax.xml deploy --settings ${params.gcube_settings} ${params.maven_activation_property} -Dmaven.repo.local=${params.local_repo} -Dmaven.artifact.threads=3 -DskipTests=${SKIP_TESTS} -T 2C dependency:tree"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version='1.1' encoding='UTF-8'?>
|
||||
<flow-definition plugin="workflow-job">
|
||||
<actions>
|
||||
<org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobAction plugin="pipeline-model-definition"/>
|
||||
<org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobPropertyTrackerAction plugin="pipeline-model-definition">
|
||||
<jobProperties/>
|
||||
<triggers/>
|
||||
<parameters>
|
||||
<string>gcube_settings</string>
|
||||
<string>local_repo</string>
|
||||
<string>maven_activation_property</string>
|
||||
<string>continuous_deploy</string>
|
||||
<string>continuous_deploy_destination</string>
|
||||
<string>gcube_agent</string>
|
||||
</parameters>
|
||||
<options/>
|
||||
</org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobPropertyTrackerAction>
|
||||
</actions>
|
||||
<description>gcube-secrets pipeline</description>
|
||||
<keepDependencies>false</keepDependencies>
|
||||
<properties>
|
||||
<jenkins.model.BuildDiscarderProperty>
|
||||
<strategy class="hudson.tasks.LogRotator">
|
||||
<daysToKeep>-1</daysToKeep>
|
||||
<numToKeep>3</numToKeep>
|
||||
<artifactDaysToKeep>-1</artifactDaysToKeep>
|
||||
<artifactNumToKeep>-1</artifactNumToKeep>
|
||||
<removeLastBuild>false</removeLastBuild>
|
||||
</strategy>
|
||||
</jenkins.model.BuildDiscarderProperty>
|
||||
<com.suryagaddipati.jenkins.SlaveUtilizationProperty plugin="slave-utilization-plugin">
|
||||
<needsExclusiveAccessToNode>false</needsExclusiveAccessToNode>
|
||||
<singleInstancePerSlave>false</singleInstancePerSlave>
|
||||
<slaveUtilizationPercentage>0</slaveUtilizationPercentage>
|
||||
</com.suryagaddipati.jenkins.SlaveUtilizationProperty>
|
||||
<org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty>
|
||||
<triggers>
|
||||
<org.jenkinsci.plugins.pipeline.maven.trigger.WorkflowJobDependencyTrigger plugin="pipeline-maven">
|
||||
<spec></spec>
|
||||
</org.jenkinsci.plugins.pipeline.maven.trigger.WorkflowJobDependencyTrigger>
|
||||
<hudson.triggers.SCMTrigger>
|
||||
<spec></spec>
|
||||
<ignorePostCommitHooks>false</ignorePostCommitHooks>
|
||||
</hudson.triggers.SCMTrigger>
|
||||
</triggers>
|
||||
</org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty>
|
||||
<hudson.model.ParametersDefinitionProperty>
|
||||
<parameterDefinitions>
|
||||
<hudson.model.StringParameterDefinition>
|
||||
<name>gcube_settings</name>
|
||||
<description>The maven settings</description>
|
||||
<defaultValue>/home/jenkins/.m2/gcube-settings.xml</defaultValue>
|
||||
<trim>false</trim>
|
||||
</hudson.model.StringParameterDefinition>
|
||||
<hudson.model.StringParameterDefinition>
|
||||
<name>local_repo</name>
|
||||
<description>The local_repo</description>
|
||||
<defaultValue>/home/jenkins/.m2/local-snapshot</defaultValue>
|
||||
<trim>false</trim>
|
||||
</hudson.model.StringParameterDefinition>
|
||||
<hudson.model.StringParameterDefinition>
|
||||
<name>maven_activation_property</name>
|
||||
<description>Maven activation properties</description>
|
||||
<trim>false</trim>
|
||||
</hudson.model.StringParameterDefinition>
|
||||
<hudson.model.BooleanParameterDefinition>
|
||||
<name>continuous_deploy</name>
|
||||
<description>Enable continuos deploy</description>
|
||||
<defaultValue>false</defaultValue>
|
||||
</hudson.model.BooleanParameterDefinition>
|
||||
<hudson.model.StringParameterDefinition>
|
||||
<name>continuous_deploy_destination</name>
|
||||
<description>The deploy environment</description>
|
||||
<defaultValue>development</defaultValue>
|
||||
<trim>false</trim>
|
||||
</hudson.model.StringParameterDefinition>
|
||||
<hudson.model.StringParameterDefinition>
|
||||
<name>gcube_agent</name>
|
||||
<description>The agent that build the component</description>
|
||||
<defaultValue>gcube-agent-jdk17</defaultValue>
|
||||
<trim>false</trim>
|
||||
</hudson.model.StringParameterDefinition>
|
||||
</parameterDefinitions>
|
||||
</hudson.model.ParametersDefinitionProperty>
|
||||
</properties>
|
||||
<definition class="org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition" plugin="workflow-cps">
|
||||
<scm class="hudson.plugins.git.GitSCM" plugin="git">
|
||||
<configVersion>2</configVersion>
|
||||
<userRemoteConfigs>
|
||||
<hudson.plugins.git.UserRemoteConfig>
|
||||
<url>https://code-repo.d4science.org/gCubeSystem/gcube-secrets</url>
|
||||
<credentialsId>gitea-jenkins</credentialsId>
|
||||
</hudson.plugins.git.UserRemoteConfig>
|
||||
</userRemoteConfigs>
|
||||
<branches>
|
||||
<hudson.plugins.git.BranchSpec>
|
||||
<name>*/master</name>
|
||||
</hudson.plugins.git.BranchSpec>
|
||||
</branches>
|
||||
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
|
||||
<browser class="org.jenkinsci.plugin.gitea.GiteaBrowser" plugin="gitea">
|
||||
<url>https://code-repo.d4science.org/gCubeSystem/gcube-secrets</url>
|
||||
</browser>
|
||||
<submoduleCfg class="empty-list"/>
|
||||
<extensions>
|
||||
<hudson.plugins.git.extensions.impl.CloneOption>
|
||||
<shallow>true</shallow>
|
||||
<noTags>false</noTags>
|
||||
<reference></reference>
|
||||
<depth>1</depth>
|
||||
<honorRefspec>false</honorRefspec>
|
||||
</hudson.plugins.git.extensions.impl.CloneOption>
|
||||
</extensions>
|
||||
</scm>
|
||||
<scriptPath>Jenkinsfile-javax</scriptPath>
|
||||
<lightweight>true</lightweight>
|
||||
</definition>
|
||||
<triggers/>
|
||||
<disabled>false</disabled>
|
||||
</flow-definition>
|
||||
Loading…
Reference in New Issue