Switch to ubuntu when deploying Airship
[releng.git] / jjb / airship / airship.yaml
index 5b39975..fcf40e4 100644 (file)
@@ -8,9 +8,10 @@
     repo: 'opnfv'
     port:
     tag:
-      - hunter:
-          branch: stable/hunter
+      - latest:
+          branch: master
           slave: intel-pod17
+          functest_tag: hunter
 
 - parameter:
     name: airship-slave
           name: slave
           default: '{slave}'
 
-- parameter:
-    name: airship-branch
-    parameters:
-      - string:
-          name: branch
-          default: '{branch}'
-
 - airship-containers: &airship-containers
     name: 'airship-containers'
     repo: '{repo}'
     port: '{port}'
     container: '{container}'
-    tag: '{tag}'
+    functest_tag: '{functest_tag}'
 
 - airship-run-containers: &airship-run-containers
     name: 'airship-run-containers'
       - shell: |
           set +x
           if [ "{repo}" = "_" ]; then
-            image={container}:{tag}
+            image={container}:{functest_tag}
           elif [ "{port}" = "None" ]; then
-            image={repo}/{container}:{tag}
+            image={repo}/{container}:{functest_tag}
           else
-            image={repo}:{port}/{container}:{tag}
+            image={repo}:{port}/{container}:{functest_tag}
           fi
-          docker pull $image
+          sudo docker pull $image
 
 - builder:
     name: airship-run-containers
     builders:
       - shell: |
-          set +e
-          set -x
-          [ ! -z "$WORKSPACE" ] && rm -rf $WORKSPACE/* || true
+          set +ex
+          [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/* || true
           if [ "{repo}" = "_" ]; then
-            image={container}:{tag}
+            image={container}:{functest_tag}
           elif [ "{port}" = "None" ]; then
-            image={repo}/{container}:{tag}
+            image={repo}/{container}:{functest_tag}
           else
-            image={repo}:{port}/{container}:{tag}
+            image={repo}:{port}/{container}:{functest_tag}
           fi
-          echo $WORKSPACE
-          docker run --rm \
+          sudo docker run --rm \
             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
             -e NODE_NAME=intel-pod17 \
             -e INSTALLER_TYPE=airship \
@@ -81,7 +73,7 @@
             $image run_tests -t {test} -r
           res=$?
           gsutil -m cp -r $WORKSPACE/ \
-            gs://artifacts.opnfv.org/airship/$JOB_NAME-$BUILD_ID
+            gs://artifacts.opnfv.org/airship/$JOB_NAME-$BUILD_ID > /dev/null 2>&1
           find $WORKSPACE -type f \
             -printf \
             "http://artifacts.opnfv.org/airship/$JOB_NAME-$BUILD_ID/%P\n"
       - shell: |
           set +x
           if [ "{repo}" = "_" ]; then
-            image={container}:{tag}
+            image={container}:{functest_tag}
           elif [ "{port}" = "None" ]; then
-            image={repo}/{container}:{tag}
+            image={repo}/{container}:{functest_tag}
           else
-            image={repo}:{port}/{container}:{tag}
+            image={repo}:{port}/{container}:{functest_tag}
           fi
-          docker rmi $image || true
+          sudo docker rmi $image || true
 
+- builder:
+    name: airship-deploy
+    builders:
+      - shell: |
+          set +x
+          sudo -u ubuntu tools/deploy.sh deploy_site
+
+- scm:
+    name: airship-scm
+    scm:
+      - git:
+          url: https://gerrit.opnfv.org/gerrit/airship
+          refspec: '+refs/changes/*:refs/changes/*'
+          branches:
+            - '{ref}'
+
+- parameter:
+    name: airship-branch
+    parameters:
+      - string:
+          name: branch
+          default: '{branch}'
+
+- job-template:
+    name: 'airship-deploy-{tag}'
+    parameters:
+      - airship-slave:
+          slave: '{slave}'
+      - airship-branch:
+          branch: '{branch}'
+    scm:
+      - airship-scm:
+          ref: $branch
+    builders:
+      - airship-deploy
+
+- project:
+    name: 'airship-deploy'
+    <<: *airship-params
+    jobs:
+      - 'airship-deploy-{tag}'
 
 - job-template:
     name: 'airship-{repo}-{container}-{tag}-pull'
     parameters:
       - airship-slave:
           slave: '{slave}'
+      - airship-branch:
+          branch: 'master'
     properties:
       - build-blocker:
           use-build-blocker: true
           blocking-jobs:
             - '^airship-{tag}-(daily|check|gate)$'
     builders:
+      - multijob:
+          name: deploy
+          projects:
+            - name: 'airship-deploy-latest'
+              <<: *airship-jobs
       - multijob:
           name: remove former images
           projects:
             - name: 'airship-opnfv-functest-features-{tag}-pull'
               <<: *airship-jobs
       - multijob:
-          name: opnfv/functest-healthcheck:{tag}
+          name: opnfv/functest-healthcheck:{functest_tag}
+          condition: ALWAYS
           projects:
             - name: 'airship-opnfv-functest-healthcheck-{tag}-connection_check-run'
               <<: *airship-jobs
             - name: 'airship-opnfv-functest-healthcheck-{tag}-tempest_smoke-run'
               <<: *airship-jobs
       - multijob:
-          name: opnfv/functest-smoke:{tag}
+          name: opnfv/functest-smoke:{functest_tag}
+          condition: ALWAYS
           projects:
             - name: 'airship-opnfv-functest-smoke-{tag}-neutron-tempest-plugin-api-run'
               <<: *airship-jobs
             - name: 'airship-opnfv-functest-smoke-{tag}-barbican-run'
               <<: *airship-jobs
       - multijob:
-          name: opnfv/functest-benchmarking:{tag}
+          name: opnfv/functest-benchmarking:{functest_tag}
+          condition: ALWAYS
           projects:
             - name: 'airship-opnfv-functest-benchmarking-{tag}-rally_full-run'
               <<: *airship-jobs
             - name: 'airship-opnfv-functest-benchmarking-{tag}-shaker-run'
               <<: *airship-jobs
       - multijob:
-          name: opnfv/functest-vnf:{tag}
+          name: opnfv/functest-vnf:{functest_tag}
+          condition: ALWAYS
           execution-type: SEQUENTIALLY
           projects:
             - name: 'airship-opnfv-functest-vnf-{tag}-cloudify-run'
             - name: 'airship-opnfv-functest-vnf-{tag}-juju_epc-run'
               <<: *airship-jobs
       - multijob:
-          name: opnfv/functest-features:{tag}
+          name: opnfv/functest-features:{functest_tag}
+          condition: ALWAYS
           projects:
             - name: 'airship-opnfv-functest-features-{tag}-doctor-notification-run'
               <<: *airship-jobs
             - name: 'airship-opnfv-functest-features-{tag}-stor4nfv_os-run'
               <<: *airship-jobs
 
-
 - project:
     name: 'airship'
     <<: *airship-params