summaryrefslogtreecommitdiffstats
path: root/Jenkinsfile
diff options
context:
space:
mode:
authorCatalin Scrieciu <catalin.scrieciu@enea.com>2016-07-08 12:57:54 +0200
committerCatalin Scrieciu <catalin.scrieciu@enea.com>2016-07-08 12:57:54 +0200
commitfe75f088b15777718303d9811494ed5437515468 (patch)
treefd3edd984827812cc2cebe7b341b62dc21c33d56 /Jenkinsfile
parente025cd48ce9db156503f46f7b72ff477cfd12cff (diff)
downloadel_manifests-standard-fe75f088b15777718303d9811494ed5437515468.tar.gz
test
Diffstat (limited to 'Jenkinsfile')
-rw-r--r--Jenkinsfile84
1 files changed, 84 insertions, 0 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..7bb5422
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,84 @@
1// Defining the closure to be used for building a target
2
3def target_build = {machine->
4 print "This is the build for target $machine"
5 // sh 'mkdir $machine'
6 // dir ('$machine') {
7 // pwd()
8 // unstash 'eltf_scripts'
9 // }
10 }
11
12def constructor_function(trg) {{it->print "This is another build for the target $trg"}}
13
14node {
15 // Start the fist stage which sets up the pipeline environment
16 stage 'Set up environment'
17 // Cleaning the workspace
18 deleteDir()
19
20 // The first step is to freeze the manifest repositiries
21 print "To add a job to freeze the manifest repositories"
22
23 def targets = TARGET_LIST.split(',')
24 for (item in targets) {print item}
25
26 // Old implementation of the git clone. Changed as it does not support target directory
27 //git url: 'git@git.enea.se:eltf/scripts.git', branch: 'master', relativeTargetDir: 'eltf_scripts'
28
29 // Clone eltf/scripts.git repository
30 checkout([$class: 'GitSCM',
31 branches: [[name: '*/master']],
32 doGenerateSubmoduleConfigurations: false,
33 extensions: [[$class: 'RelativeTargetDirectory',
34 relativeTargetDir: 'eltf_scripts']],
35 submoduleCfg: [],
36 userRemoteConfigs: [[url: 'git@git.enea.se:eltf/scripts.git']]])
37
38 // Stash the ELTF scripts in order to be used on other nodes
39 stash includes: 'eltf_scripts/*', name: 'eltf_scripts', useDefaultExcludes: false
40
41 // Start the next stages for Build, Test and Document
42
43 stage 'Build'
44
45 build_jobs = [:]
46 for (item in targets){build_jobs.put(item, constructor_function(item))}
47 print "I am here"
48
49 try {
50 parallel build_jobs
51 }
52 catch (java.io.NotSerializableException stupid_error){
53
54 print "Finished parallel step and entered the catch statement"
55 print stupid_error
56 //stage 'Test'
57 print "hello from stage 3"
58 }
59 try {
60 stage 'Document'
61 print "hello from stage 4"
62 stage 'Build Documentation'
63 print "hello from stage 5"
64 stage 'Build Release Candidate'
65 echo "hello...it's me...:)"
66 stage 'Publish Release Candidate'
67 def PUBLISH_RC = input(
68 id: 'PUBLISH_RC', message: 'Publish RC?', ok: 'Yes', parameters: [
69 [$class: 'StringParameterDefinition', defaultValue: 'RC1', description: 'This is the RC number to be published', name: 'RC_NUMBER'],
70 [$class: 'StringParameterDefinition', defaultValue: 'EL6_RC2', description: 'This is the tag to be applied in the manifest repo', name: 'RC_TAG']
71 ])
72 echo ("The RC number is: "+PUBLISH_RC['RC_NUMBER'])
73 print "hello from stage 5"
74 echo ("The RC number is: "+PUBLISH_RC['RC_NUMBER'])
75 stage 'Pubilsh Official Release'
76 echo ("The RC number is: "+PUBLISH_RC['RC_NUMBER'])
77 }
78 catch (err) {
79 print err
80 }
81 }
82
83
84