.tox/
archives/
jenkins.ini
+*.sw?
# Packer
.galaxy/
<<: *k8s_ssh_key
default: ''
-# IEC usecase(s) parameters
-- parameter:
- name: 'seba_on_arm-defaults'
- parameters:
- - string:
- name: PON_TYPE
- default: 'ponsim'
-
########################
# publisher macros
########################
recipients: armband@enea.com
- lf-infra-publish
-- publisher:
- name: 'iec-install-usecase-publisher'
- publishers:
- - iec-default-publisher
-
-- publisher:
- name: 'iec-test-usecase-publisher'
- publishers:
- - iec-default-publisher
- - robot:
- output-path: 'results'
- report-html: '**/report.html'
- log-html: '**/log.html'
- output-xml: '**/output.xml'
-
########################
# trigger macros
########################
name: 'iec-{iecType}-{installer}-{deploy_type}-{os}-daily-{stream}'
disabled: '{obj:disabled}'
concurrent: false
- node: '{slave-label}'
+ node: '{slave_label}'
properties:
- throttle:
enabled: true
id: akraino-iec-deploy
name: 'iec-{iecType}-deploy-{installer}-{deploy_type}-{os}-daily-{stream}'
concurrent: true
- node: '{slave-label}'
+ node: '{slave_label}'
properties: &properties
- throttle:
enabled: true
id: akraino-iec-destroy
name: 'iec-{iecType}-destroy-{installer}-{deploy_type}-{os}-daily-{stream}'
concurrent: true
- node: '{slave-label}'
+ node: '{slave_label}'
properties: *properties
parameters:
- lf-infra-parameters:
publishers:
- iec-default-publisher
-
-- job-template:
- id: akraino-iec-phase-usecase
- name: 'iec-{iecType}-{phase}-{usecase}-{installer}-{deploy_type}-{os}-daily-{stream}'
- concurrent: true
- node: '{slave-label}'
- properties: *properties
-
- parameters:
- - lf-infra-parameters:
- project: '{project}'
- stream: '{stream}'
- branch: '{branch}'
- - '{project}-defaults'
- - '{installer}-{os}-defaults'
- - '{usecase}-defaults'
-
- wrappers:
- - build-name:
- name: '$BUILD_NUMBER - Usecase: ${usecase} DeployType: ${installer}-${deploy_type}'
-
- scm: *scm
-
- builders:
- - shell:
- !include-raw-escape: ../iec/iec-{usecase}.sh
-
- publishers:
- - 'iec-{phase}-usecase-publisher'
---
- job-template:
id: akraino-rec-deploy
- name: 'rec-{slave-label}-{job-frequency}-{stream}'
+ name: 'rec-{slave_label}-{job_frequency}-{stream}'
disabled: '{obj:disabled}'
concurrent: false
- node: '{slave-label}'
+ node: '{slave_label}'
properties:
- throttle:
enabled: true
name: '$BUILD_NUMBER - Install REC Blueprint'
triggers:
- - 'rec-{job-frequency}-{stream}-trigger'
+ - 'rec-{job_frequency}-{stream}-trigger'
parameters:
- lf-infra-parameters:
project: '{project}'
stream: '{stream}'
branch: '{branch}'
- - 'rec-{slave-label}-defaults'
+ - 'rec-{slave_label}-defaults'
- 'rec-defaults'
builders:
- description-setter:
description: "SLAVE: $NODE_NAME"
- trigger-builds:
- - project: 'rec-{slave-label}-install-rec-{job-frequency}-{stream}'
+ - project: 'rec-{slave_label}-install-rec-{job_frequency}-{stream}'
current-parameters: true
same-node: true
block: true
OPTIONAL=false
PULL=yes
block: true
+ - project:
+ !j2: |
+ {%- for uc in usecase -%}
+ {%- for ph in phase -%}
+ rec-{{ slave_label }}-{{ ph }}-{{ uc }}-{{ job_frequency }}-{{ stream }}
+ {%- if not loop.last -%},{%- endif -%}
+ {%- endfor %}
+ {%- if not loop.last -%},{%- endif -%}
+ {%- endfor %}
+ current-parameters: true
+ same-node: true
+ block: true
+ block-thresholds:
+ build-step-failure-threshold: 'never'
+ failure-threshold: 'never'
+ unstable-threshold: 'FAILURE'
publishers: &rec-publishers
- email:
- job-template:
id: akraino-rec-install-rec
- name: 'rec-{slave-label}-install-rec-{job-frequency}-{stream}'
+ name: 'rec-{slave_label}-install-rec-{job_frequency}-{stream}'
concurrent: true
- node: '{slave-label}'
+ node: '{slave_label}'
properties:
- throttle:
enabled: true
project: '{project}'
stream: '{stream}'
branch: '{branch}'
- - 'rec-{slave-label}-defaults'
+ - 'rec-{slave_label}-defaults'
- 'rec-defaults'
scm:
--- /dev/null
+---
+##############
+# PARAMETERS #
+##############
+- parameter:
+ name: 'seba_on_arm-defaults'
+ parameters:
+ - string:
+ name: PON_TYPE
+ default: 'ponsim'
+
+########################
+# publisher macros
+########################
+- publisher:
+ name: 'seba_on_arm-install-publisher'
+ publishers:
+ - email:
+ recipients: armband@enea.com
+ - lf-infra-publish
+
+- publisher:
+ name: 'seba_on_arm-test-publisher'
+ publishers:
+ - seba_on_arm-install-publisher
+ - robot:
+ output-path: 'results'
+ report-html: '**/report.html'
+ log-html: '**/log.html'
+ output-xml: '**/output.xml'
--- /dev/null
+---
+- job-template: &akraino-usecase-phase-rec
+ id: akraino-usecase-phase-rec
+ name: 'rec-{slave_label}-{phase}-{usecase}-{job_frequency}-{stream}'
+ concurrent: true
+ node: '{slave_label}'
+ # Support usecases that reside in a different project repo, e.g.
+ # seba_on_arm usecase uses the 'iec' project git repo, even if this
+ # job targets a different project, 'rec'.
+ usecase_project: 'iec'
+ properties:
+ - throttle:
+ enabled: true
+ max-total: 4
+ max-per-node: 1
+ option: 'project'
+ - build-blocker:
+ use-build-blocker: true
+ blocking-jobs:
+ - '.*-{usecase}-.*'
+ block-level: 'NODE'
+
+ parameters:
+ - lf-infra-parameters:
+ project: '{usecase_project}'
+ stream: '{stream}'
+ branch: '{branch}'
+ - '{project}-defaults'
+ - '{usecase}-defaults'
+
+ scm:
+ - lf-infra-gerrit-scm:
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+ git-url: '{git-url}/{usecase_project}.git'
+ refspec: '$GERRIT_REFSPEC'
+ branch: '$GERRIT_BRANCH'
+ submodule-recursive: false
+ submodule-timeout: '{submodule-timeout}'
+ submodule-disable: true
+ choosing-strategy: default
+
+ builders:
+ - shell:
+ !include-raw-escape: ../shell/{usecase}.sh
+
+ publishers:
+ - '{usecase}-{phase}-publisher'
+
+- job-template:
+ <<: *akraino-usecase-phase-rec
+ id: akraino-usecase-phase-iec
+ name: 'iec-{iecType}-{phase}-{usecase}-{installer}-{deploy_type}-{os}-daily-{stream}'
+ parameters:
+ - lf-infra-parameters:
+ project: '{usecase_project}'
+ stream: '{stream}'
+ branch: '{branch}'
+ - '{project}-defaults'
+ - '{installer}-{os}-defaults'
+ - '{usecase}-defaults'
# -------------------------------
deploy_type:
- baremetal:
- slave-label: 'aarch64_baremetal_dev'
+ slave_label: 'aarch64_baremetal_dev'
scenario: 'k8-calico-iec-noha'
- virtual:
- slave-label: 'aarch64_dev'
+ slave_label: 'aarch64_dev'
scenario: 'k8-calico-iec-noha'
exclude:
- akraino-iec-install
- akraino-iec-deploy
- akraino-iec-destroy
- - akraino-iec-phase-usecase
+ - akraino-usecase-phase-iec
- gerrit-sonar:
sonar-project-file: ""
build-node: centos7-builder-2c-1g
disabled: false
# -------------------------------
- # POD DEFINITIONS
+ # USECASE DEFINITIONS
# -------------------------------
+ usecase:
+ - seba_on_arm
+
+ phase:
+ - install
+ - test
- slave-label:
+ # -------------------------------
+ # POD DEFINITIONS
+ # -------------------------------
+ slave_label:
- aarch64_baremetal
- job-frequency:
+ job_frequency:
- weekly
jobs:
- - akraino-rec-deploy
- - akraino-rec-install-rec
+ - akraino-rec-deploy
+ - akraino-rec-install-rec
+ - akraino-usecase-phase-rec
then
eval sshpass -p "${K8S_SSH_PASSWORD}" "${_c}" \
-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
- ${_o} "${K8S_SSH_USER}"@"${K8S_MASTER_IP}${_s}" "$@"
+ "${K8S_SSH_USER}@${K8S_MASTER_IP}${_s}" "$@"
elif [ -n "${K8S_SSH_KEY}" ]
then
- eval ${_c} -i "${K8S_SSH_KEY}" \
+ eval "${_c}" -i "${K8S_SSH_KEY}" \
-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
- ${_o} "${K8S_SSH_USER}"@"${K8S_MASTER_IP}${_s}" "$@"
+ "${K8S_SSH_USER}@${K8S_MASTER_IP}${_s}" "$@"
else
echo "Neither K8S_SSH_PASSWORD nor K8S_SSH_KEY are set"
exit 1
fi
}
-if [ -z "$K8S_SSH_USER" ]
-then
- echo "K8S_SSH_USER not set, cannot ssh to K8S master, aborting"
- exit 1
-fi
-
case "${JOB_NAME}" in
*fuel*)
K8S_MASTER_IP=$(docker exec fuel cat /etc/hosts | grep iec01 \
IEC_DIR="/${K8S_SSH_USER}/iec"
KUBE_DIR="~${K8S_SSH_USER}/.kube"
;;
+ *rec*)
+ # CLUSTER_{MASTER_IP,SSH_USER,SSH_PASSWORD} are already set by job params
+ K8S_MASTER_IP=${CLUSTER_MASTER_IP}
+ K8S_SSH_USER=${CLUSTER_SSH_USER}
+ K8S_SSH_PASSWORD=${CLUSTER_SSH_PASSWORD}
+ IEC_DIR="/var/lib/akraino/iec"
+ KUBE_DIR="~${K8S_SSH_USER}/.kube"
+ UPSTREAM_PROJECT='rec'
+ ;;
*)
echo "Cannot determine installer from ${JOB_NAME}"
exit 1
;;
esac
+if [ -z "$K8S_SSH_USER" ]
+then
+ echo "K8S_SSH_USER not set, cannot ssh to K8S master, aborting"
+ exit 1
+fi
+
+export K8S_MASTER_IP UPSTREAM_PROJECT="${UPSTREAM_PROJECT:-${PROJECT}}"
+
case "${JOB_NAME}" in
- iec-*-install-seba_on_arm*)
- INSTALL_CMD="'cd ${IEC_DIR}/src/use_cases/seba_on_arm/install; ./install.sh'"
+ *-install-seba_on_arm*)
+ INSTALL_CMD="'cd ${IEC_DIR}/src/use_cases/seba_on_arm/install; ./install.sh ${UPSTREAM_PROJECT}'"
run_on_k8s_master ssh "${INSTALL_CMD}"
;;
- iec-*-test-seba_on_arm*)
+ *-test-seba_on_arm*)
case "${PON_TYPE}" in
*ponsim*)
run_on_k8s_master scp "${KUBE_DIR}" "${WORKSPACE}"
SEBA_TEST_DIR="src/use_cases/seba_on_arm/test"
- TEST_CMD="${SEBA_TEST_DIR}/${PON_TYPE}/test.sh"
+ TEST_CMD="${SEBA_TEST_DIR}/${PON_TYPE}/test.sh ${UPSTREAM_PROJECT}"
echo "Issuing command"
echo "${TEST_CMD}"
- eval ${TEST_CMD}
+ eval "${TEST_CMD}"
;;
*)
echo "Cannot determine what to do for seba_on_arm from ${JOB_NAME}"