Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Colas Pomies
LbNightlyTools
Commits
fb47e695
Commit
fb47e695
authored
May 08, 2015
by
cpomies
Browse files
Minor changes
parent
acef3901
Changes
5
Hide whitespace changes
Inline
Side-by-side
jenkins/checkout.sh
View file @
fb47e695
...
...
@@ -26,6 +26,6 @@ checkout_slot \
"
${
peojects_list
}
"
push_artifact
"
${
ARTIFACTS_DIR
}
"
"
${
flavour
}
"
"
${
slot
}
"
"
${
slot_build_id
}
"
check_preconditions
"
${
config_file_checkout
}
"
check_preconditions
"
${
config_file_checkout
}
"
"
${
slot
}
"
"
${
slot_build_id
}
"
"
${
platforms
}
"
jenkins/utils.d/check_preconditions.sh
View file @
fb47e695
function
check_preconditions
{
local
USAGE
=
"check_preconditions config_file"
local
USAGE
=
"check_preconditions config_file
slot slot_build_id [platforms]
"
if
[
$#
!=
1
]
;
then
if
[
$#
!=
3
-a
$#
!=
4
]
;
then
echo
"ERROR : Usage :
${
USAGE
}
"
exit
1
fi
...
...
@@ -13,6 +13,14 @@ function check_preconditions {
fi
local
config
=
"
$1
"
local
slot
=
"
$2
"
local
slot_build_id
=
"
$3
"
local
platforms_opt
=
''
if
[
$#
==
4
-a
"
$4
"
!=
""
]
;
then
lbn-check-preconditions
--verbose
"
${
config
}
"
"
$slot
"
"
$slot_build_id
"
--platforms
"
$4
"
else
lbn-check-preconditions
--verbose
"
${
config
}
"
"
$slot
"
"
$slot_build_id
"
fi
lbn-check-preconditions
--verbose
"
${
config
}
"
}
jenkins/utils.d/set_common.sh
View file @
fb47e695
...
...
@@ -12,7 +12,7 @@ function set_common {
done
export
HOME
=
$PWD
export
CMTCONFIG
=
${
platform
}
# default (backward-compatible) build flavour
if
[
"
${
flavour
}
"
==
""
]
;
then
export
flavour
=
nightly
...
...
@@ -58,7 +58,7 @@ function set_common {
export
LOGIN_POST_SCRIPT
=
${
GROUP_DIR
}
/post/login
# FIXME: LbLogin cannot handle the special CMTCONFIG "*-test"
.
/afs/cern.ch/lhcb/software/releases/LBSCRIPTS/
${
LbScriptsVersion
}
/InstallArea/scripts/LbLogin.sh
--no-cache
-c
${
platform
/-test/-opt
}
export
CMTCONFIG
=
${
platform
}
#
export CMTCONFIG=${platform}
# FIXME: path to the new gdb should be implicit in the build/run-time
# environment
# See https://its.cern.ch/jira/browse/LBCORE-151
...
...
python/LbNightlyTools/CheckSlotPreconditions.py
View file @
fb47e695
...
...
@@ -8,14 +8,13 @@
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
from
platform
import
platform
'''
Module containing the classes and functions used to check if a slot have
preconditions and write files with parameters for next jobs in Jenkins
'''
__author__
=
'Colas Pomies <colas.pomies@cern.ch>'
import
os
from
LbNightlyTools.Configuration
import
load
from
LbNightlyTools.Utils
import
JobParams
...
...
@@ -32,37 +31,50 @@ class Script(LbUtils.Script.PlainScript):
{"preconditions": [{"name": "waitForFile",
"args": {"path": "path/to/file"}}]}
'''
__usage__
=
'%prog [options] <config.json>'
__usage__
=
'%prog [options] <config.json>
<slot> <slot_build_id>
'
__version__
=
''
def
defineOpts
(
self
):
self
.
parser
.
add_option
(
'--platforms'
,
action
=
'store'
,
help
=
'Platforms to build the slot'
)
self
.
parser
.
set_defaults
(
platforms
=
""
)
def
main
(
self
):
'''
Script main function.
'''
if
len
(
self
.
args
)
!=
1
:
if
len
(
self
.
args
)
!=
3
:
self
.
parser
.
error
(
'wrong number of arguments'
)
opts
=
self
.
options
data
=
load
(
self
.
args
[
0
])
slot
=
self
.
args
[
1
]
slot_build_id
=
self
.
args
[
2
]
preconds
=
data
.
get
(
u
'preconditions'
,
[])
if
preconds
:
self
.
log
.
info
(
'Find precondition for %s'
,
os
.
environ
[
'
slot
'
]
)
self
.
log
.
info
(
'Find precondition for %s'
,
slot
)
output_file
=
'slot-precondition-{0}-{1}.txt'
else
:
self
.
log
.
info
(
'No precondition for %s'
,
os
.
environ
[
'
slot
'
]
)
self
.
log
.
info
(
'No precondition for %s'
,
slot
)
output_file
=
'slot-build-{0}-{1}.txt'
if
os
.
environ
.
has_key
(
'platforms'
)
and
os
.
environ
[
'platforms'
]
!=
''
:
platforms
=
os
.
environ
[
'platforms'
].
split
()
else
:
platforms
=
opts
.
platforms
.
strip
().
split
()
if
not
platforms
:
platforms
=
data
.
get
(
u
'default_platforms'
,
[])
for
platform
in
platforms
:
os_label
=
platform
.
split
(
'-'
)[
1
]
+
'-build'
output_file_name
=
output_file
.
format
(
os
.
environ
[
'
slot
'
]
,
platform
)
output_file_name
=
output_file
.
format
(
slot
,
platform
)
open
(
output_file_name
,
'w'
)
\
.
write
(
str
(
JobParams
(
slot
=
os
.
environ
[
'
slot
'
]
,
slot_build_id
=
os
.
environ
[
'
slot_build_id
'
]
,
.
write
(
str
(
JobParams
(
slot
=
slot
,
slot_build_id
=
slot_build_id
,
platform
=
platform
,
os_label
=
os_label
,
))
+
'
\n
'
)
...
...
testMock.sh
View file @
fb47e695
#!/bin/bash
export
platform
=
${
CMTCONFIG
:-
x86_64
-slc6-gcc48-opt
}
export
slots
=
"lhcb-test-new-config"
export
platform
_checkout
=
${
CMTCONFIG
:-
x86_64
-slc6-gcc48-opt
}
export
slots
=
"lhcb-test-new-config
lhcb-compatibility
"
#export slots="lhcb-compatibility"
#export platforms="x86_64-slc6-gcc48-opt x86_64-slc6-gcc48-dbg"
#Clean all
jenkins/mock.sh mock/clean_rsync None master
jenkins/mock.sh mock/clean_build None master
...
...
@@ -23,7 +25,7 @@ for file in ${files}; do
slot
=
${
file
%.txt*
}
slot
=
${
slot
#*slot-params-
}
slots
=
"
${
slots
}
${
slot
}
"
jenkins/mock.sh checkout
${
slot
}
${
platform
}
jenkins/mock.sh checkout
${
slot
}
${
platform
_checkout
}
files_preconditions
=
"
${
files_preconditions
}
`
ls
slot-precondition-
*
.txt
`
"
files_build
=
"
${
files_build
}
`
ls
slot-
*
.txt
`
"
jenkins/mock.sh mock/clean_checkout
${
slot
}
${
platform
}
...
...
@@ -53,7 +55,6 @@ for slot in ${slots}; do
platform
=
${
platform
#*
${
slot
}
-
}
rm
${
file
}
jenkins/mock.sh build
${
slot
}
${
platform
}
exit
0
jenkins/mock.sh mock/clean_build
${
slot
}
${
platform
}
done
done
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment