diff options
Diffstat (limited to 'jjb/apex')
-rw-r--r-- | jjb/apex/apex.yml | 73 | ||||
-rw-r--r-- | jjb/apex/opnfv-apex.yml | 84 |
2 files changed, 60 insertions, 97 deletions
diff --git a/jjb/apex/apex.yml b/jjb/apex/apex.yml index be595d4a3..57825cecd 100644 --- a/jjb/apex/apex.yml +++ b/jjb/apex/apex.yml @@ -14,6 +14,9 @@ - master: branch: 'master' gs-pathname: '' + - brahmaputra: + branch: 'stable/brahmaputra' + gs-pathname: '/brahmaputra' project: 'apex' @@ -25,6 +28,7 @@ parameters: - apex-parameter: gs-pathname: '{gs-pathname}' + ARTIFACT_VERSION: 'dev' - project-parameter: project: '{project}' - gerrit-parameter: @@ -57,7 +61,7 @@ project-pattern: 'apex' branches: - branch-compare-type: 'ANT' - branch-pattern: '**/master' + branch-pattern: '**/{branch}' file-paths: - compare-type: ANT pattern: 'ci/**' @@ -243,7 +247,7 @@ - "apex-verify.*" - "apex-deploy.*" - "apex-build.*" - - "apex-daily.*" + builders: - 'apex-deploy-baremetal' @@ -282,15 +286,16 @@ - "apex-build.*" triggers: - - 'apex-{stream}' + - 'apex-master' builders: - trigger-builds: - project: 'apex-build-{stream}' git-revision: true + current-parameters: true block: true - trigger-builds: - - project: 'apex-deploy-virtual-{stream}' + - project: 'apex-deploy-baremetal-{stream}' git-revision: true block: true - trigger-builds: @@ -300,6 +305,13 @@ build-step-failure-threshold: 'never' failure-threshold: 'never' unstable-threshold: 'FAILURE' + - trigger-builds: + - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}' + block: true + block-thresholds: + build-step-failure-threshold: 'never' + failure-threshold: 'never' + unstable-threshold: 'FAILURE' ######################## # parameter macros @@ -312,12 +324,16 @@ default: 'latest' description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact" - string: + name: ARTIFACT_VERSION + default: 'daily' + description: "Artifact version type" + - string: name: BUILD_DIRECTORY default: $WORKSPACE/build_output description: "Directory where the build artifact will be located upon the completion of the build." - string: name: CACHE_DIRECTORY - default: $HOME/opnfv/cache/{gs-pathname} + default: $HOME/opnfv/cache{gs-pathname} description: "Directory where the cache to be used during the build is located." - string: name: GIT_BASE @@ -325,7 +341,7 @@ description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW." - string: name: GS_URL - default: artifacts.opnfv.org/$PROJECT/{gs-pathname} + default: artifacts.opnfv.org/$PROJECT{gs-pathname} description: "URL to Google Storage." ######################## @@ -346,7 +362,17 @@ # create the cache directory if it doesn't exist [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY # set OPNFV_ARTIFACT_VERSION - export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S") + if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then + export OPNFV_ARTIFACT_VERSION="bramaputra.1.rc0" + else + if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then + export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER} + elif [ "$ARTIFACT_VERSION" == "daily" ]; then + export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d") + else + export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION} + fi + fi # start the build cd $WORKSPACE/ci ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY @@ -447,14 +473,27 @@ source opnfv.properties RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL) + if [ ! -e "$RPM_INSTALL_PATH" ]; then + RPM_INSTALL_PATH=http://${OPNFV_RPM_URL} + fi + + RPM_LIST=$RPM_INSTALL_PATH + for pkg in common undercloud; do + RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}" + done # update / install the new rpm if rpm -q opnfv-apex > /dev/null; then - if sudo yum update -y $RPM_INSTALL_PATH | grep "does not update installed package"; then - sudo yum downgrade -y $RPM_INSTALL_PATH; + if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then + echo "RPM is already installed" + elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then + if ! sudo yum downgrade -y $RPM_LIST; then + yum remove -y opnfv-undercloud opnfv-common + sudo yum downgrade -y $RPM_INSTALL_PATH + fi fi else - sudo yum install -y $RPM_INSTALL_PATH; + sudo yum install -y $RPM_LIST; fi # cleanup virtual machines before we start @@ -510,15 +549,23 @@ RPM_INSTALL_PATH=http://${OPNFV_RPM_URL} fi + RPM_LIST=$RPM_INSTALL_PATH + for pkg in common undercloud; do + RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}" + done + # update / install the new rpm if rpm -q opnfv-apex > /dev/null; then if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then echo "RPM is already installed" - elif sudo yum update -y $RPM_INSTALL_PATH | grep "does not update installed package"; then - sudo yum downgrade -y $RPM_INSTALL_PATH; + elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then + if ! sudo yum downgrade -y $RPM_LIST; then + yum remove -y opnfv-undercloud opnfv-common + sudo yum downgrade -y $RPM_INSTALL_PATH + fi fi else - sudo yum install -y $RPM_INSTALL_PATH; + sudo yum install -y $RPM_LIST; fi # cleanup environment before we start diff --git a/jjb/apex/opnfv-apex.yml b/jjb/apex/opnfv-apex.yml deleted file mode 100644 index 5240bbabb..000000000 --- a/jjb/apex/opnfv-apex.yml +++ /dev/null @@ -1,84 +0,0 @@ -######################## -# Job configuration for apex -######################## -- project: - - name: 'opnfv-apex' - - installer: 'apex' - - controller: - - 'odl' - - 'onos' - - 'opencontrail' - - pod: 'intelpod2-jumphost' - - stream: - - master: - branch: 'master' - gs-pathname: '' - - jobs: - - 'opnfv-apex-{controller}-{pod}-daily-{stream}' - - 'opnfv-apex-deploy-{pod}-daily-{stream}' - -######################## -# job templates -######################## -- job-template: - name: 'opnfv-apex-{controller}-{pod}-daily-{stream}' - - disabled: true - - concurrent: false - - parameters: - - project-parameter: - project: '{installer}' - - '{pod}-defaults' - - '{installer}-defaults': - controller: '{controller}' - - scm: - - git-scm: - credentials-id: '{ssh-credentials}' - refspec: '' - branch: '{branch}' - - builders: - - trigger-builds: - - project: 'opnfv-apex-daily-deploy-{stream}' - git-revision: true - block: true - predefined-parameters: - CONTROLLER={controller} - -- job-template: - name: 'opnfv-apex-deploy-{pod}-daily-{stream}' - - disabled: true - - concurrent: false - - wrappers: - - build-name: - name: '$BUILD_NUMBER: {installer} $CONTROLLER' - - parameters: - - project-parameter: - project: '{installer}' - - '{pod}-defaults' - - '{installer}-defaults' - - scm: - - git-scm: - credentials-id: '{ssh-credentials}' - refspec: '' - branch: '{branch}' - - builders: - - shell: | - #!/bin/bash - echo "Hello World from OPNFV $INSTALLER_TYPE" - echo "Running $INSTALLER_TYPE with controller $CONTROLLER" |