summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
2c23d69)
After the tests are run, the results are put in an archive
and pushed in nexus.
JIRA:VAL-78
Signed-off-by: valentin.radulescu <valentin.radulescu@enea.com>
Change-Id: I1021f30f560ec67433e83f22b14877b340f489c7
set -e
set -o errexit
set -o pipefail
set -e
set -o errexit
set -o pipefail
+export PATH=$PATH:/home/jenkins/.local/bin
cwd=$(pwd)
current_user=$(whoami)
cwd=$(pwd)
current_user=$(whoami)
logger -s -t "run_blu_val.info" "$*"
}
logger -s -t "run_blu_val.info" "$*"
}
+has_substring() {
+ [ "$1" != "${2/$1/}" ]
+}
+
change_res_owner() {
# change owner of results created by root in container
if [ -d "$results_dir" ]
change_res_owner() {
# change owner of results created by root in container
if [ -d "$results_dir" ]
usage() {
echo "usage: $0" >&2
echo "[-n <blueprint_name>">&2
usage() {
echo "usage: $0" >&2
echo "[-n <blueprint_name>">&2
- echo "[-r <results_dir> results dir">&2
echo "[-b <blueprint_yaml> blueprint definition">&2
echo "[-k <k8s_config_dir> k8s config dir">&2
echo "[-j <k8s_master> k8s master">&2
echo "[-b <blueprint_yaml> blueprint definition">&2
echo "[-k <k8s_config_dir> k8s config dir">&2
echo "[-j <k8s_master> k8s master">&2
s) ssh_key=${OPTARG} ;;
b) blueprint_yaml=${OPTARG} ;;
l) blueprint_layer=${OPTARG} ;;
s) ssh_key=${OPTARG} ;;
b) blueprint_yaml=${OPTARG} ;;
l) blueprint_layer=${OPTARG} ;;
- r) results_dir=${OPTARG} ;;
n) blueprint_name=${OPTARG} ;;
u) sh_user=${OPTARG} ;;
o) is_optional="true" ;;
n) blueprint_name=${OPTARG} ;;
u) sh_user=${OPTARG} ;;
o) is_optional="true" ;;
# Testing configuration
version=${version:-$VERSION}
# Testing configuration
version=${version:-$VERSION}
-results_dir=${results_dir:-$cwd/results}
+results_dir=$cwd/results
k8s_master=${k8s_master:-$K8S_MASTER_IP}
ssh_user=${sh_user:-$K8S_SSH_USER}
blueprint_layer=${blueprint_layer:-$LAYER}
k8s_master=${k8s_master:-$K8S_MASTER_IP}
ssh_user=${sh_user:-$K8S_SSH_USER}
blueprint_layer=${blueprint_layer:-$LAYER}
if [ $? -ne 0 ]; then
change_res_owner
if [ $? -ne 0 ]; then
change_res_owner
- error "Bluval validation failed!"
+ error "Bluval validation FAIL "
+if has_substring "$NODE_NAME" "snd-"
+then
+ echo "In sandbox the logs are not pushed"
+else
+ TIMESTAMP=$(date +'%Y%m%d-%H%M%S')
+ NEXUS_URL=https://nexus.akraino.org/
+ NEXUS_PATH="${LAB_SILO}/bluval_results/${blueprint_name}/${VERSION}/${TIMESTAMP}"
+ BUILD_URL="${JENKINS_HOSTNAME}/job/${JOB_NAME}/${BUILD_NUMBER}/"
+ zip -r results.zip ./results
+ lftools deploy nexus-zip "$NEXUS_URL" logs "$NEXUS_PATH" results.zip
+fi
+
+rm results.zip
+rm -f ~/.netrc
+
name: OPTIONAL
default: ''
description: 'If set to yes run optional tests'
name: OPTIONAL
default: ''
description: 'If set to yes run optional tests'
+ - string:
+ name: LAB_SILO
+ default: ''
+ description: 'Folder in nexus where the logs are pushed.'
+ - string:
+ name: SETTINGS_FILE
+ default: '/home/jenkins/settings.xml'
+ description: 'Path to credentials file'
- job-template:
name: 'bluval-daily-{stream}'
- job-template:
name: 'bluval-daily-{stream}'
timeout: '{submodule-timeout}'
choosing-strategy: default
timeout: '{submodule-timeout}'
choosing-strategy: default
builders:
- description-setter:
description: "POD: $NODE_NAME"
builders:
- description-setter:
description: "POD: $NODE_NAME"
+ - lf-infra-create-netrc:
+ server-id: logs
- shell: !include-raw-escape:
- ../shell/run_bluval.sh
- shell: !include-raw-escape:
- ../shell/run_bluval.sh
builders:
- trigger-builds:
- project: 'bluval-daily-{stream}'
builders:
- trigger-builds:
- project: 'bluval-daily-{stream}'
+ predefined-parameters:
+ LAB_SILO={validation_lab}
same-node: true
current-parameters: true
same-node: true
current-parameters: true