~james-page/ubuntu-openstack-ci/drop-tox-from-slave-config

« back to all changes in this revision

Viewing changes to job-parts/deprecated/Z_DEPRECATE_build_mojo_runner_baremetal.sh

[1chb1n, r=admcleod] Update cleanup; use mojo from a venv; add ocata mapping

 - Use port-cleanup tool to delete neutron ext-ports left over from mojo runs. [Bug 1656306]
 - Update and re-enable undercloud instance reaping when error conditions are known. [Bug 1668778]
 - Block forever when destroy fails and cleanup fails, where human intervention is required anyway. [Bug 1668778]
 - Use mojo from a python virtualenv. [Bug 1666746]
 - Use python virtualenv for juju_status_health_check to work around paramiki/crypto IV CTR issues upstream. [Bug 1665598]

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash -e
2
 
#  Mojo runner for OSCI
3
 
test="mojo-baremetal"
4
 
 
5
 
# Define defaults for manual runs outside of a Jenkins environment
6
 
#[[ -z "$" ]] && export =""
7
 
[[ -z "$JENKINS_HOME" ]] && export JENKINS_HOME="$HOME"
8
 
[[ -z "$WORKSPACE" ]] && export WORKSPACE="$(mktemp -d)"
9
 
[[ -z "$BUILD_NUMBER" ]] && export BUILD_NUMBER="manual"
10
 
 
11
 
[[ -z "$OSCI_REPO" ]] && export OSCI_REPO="lp:ubuntu-openstack-ci"
12
 
[[ -z "$OSCI_ROOT" ]] && export OSCI_ROOT="${HOME}/tools/ubuntu-openstack-ci"
13
 
 
14
 
[[ -z "$OPENSTACK_CHARM_TESTING_REPO" ]] && export OPENSTACK_CHARM_TESTING_REPO="lp:openstack-charm-testing"
15
 
[[ -z "$OPENSTACK_CHARM_TESTING_ROOT" ]] && export OPENSTACK_CHARM_TESTING_ROOT="${HOME}/tools/openstack-charm-testing"
16
 
 
17
 
[[ -z "$MOJO_OPENSTACK_SPECS_REPO" ]] && export MOJO_OPENSTACK_SPECS_REPO="lp:~ost-maintainers/openstack-mojo-specs/mojo-openstack-specs"
18
 
 
19
 
[[ -z "$MOJO_SERIES" ]] && export MOJO_SERIES="trusty"
20
 
[[ -z "$MOJO_SPEC" ]] && export MOJO_SPEC="specs/full_stack/next_deploy_baremetal/icehouse"
21
 
 
22
 
# Avoid environment teardown if run outside of a Jenkins environment
23
 
[[ -z "$BUILD_URL" ]] && export NO_POST_DESTROY="true"
24
 
 
25
 
# Source the common functions
26
 
. ${OSCI_ROOT}/job-parts/osci_job_common.sh
27
 
 
28
 
# Need to work in something like this
29
 
#export BAREMETAL=True
30
 
 
31
 
# Set common, constant mojo workspace and project names
32
 
export MOJO_WORKSPACE_NAME="osci-mojo"
33
 
export MOJO_PROJ="mojo-openstack-specs"
34
 
export UOSCI_JUJU_TAGS="arch=amd64 tags=uosci"
35
 
 
36
 
# Prep environment
37
 
f_fresh_clean_start
38
 
f_env_no_pass
39
 
f_mojo_install
40
 
 
41
 
# Mojo Go!
42
 
f_line "validating mojo runner env vars"
43
 
f_mojo_handle_env_vars
44
 
 
45
 
f_line "bootstrapping"
46
 
f_juju_get_pkg_info juju-pkg-info.txt
47
 
juju switch maas-${MOJO_SERIES}
48
 
juju bootstrap --upload-tools --constraints="${UOSCI_JUJU_TAGS}" 2>&1 | tee $WORKSPACE/juju-bootstrap.$BUILD_NUMBER
49
 
if [[ "${PIPESTATUS[0]}" != "0" ]]; then
50
 
  echo " ! Bootstrap failed."
51
 
  touch $WORKSPACE/fyi-${test:0:4}.${test}-bootstrap.failed
52
 
fi
53
 
 
54
 
f_line "defining new mojo project"
55
 
f_mojo_new_project
56
 
 
57
 
f_line "defining new mojo workspace"
58
 
f_mojo_perms_workaround
59
 
f_mojo_new_workspace
60
 
 
61
 
f_line "run mojo, run!"
62
 
f_mojo_run
63
 
f_line "end of mojo's run"
64
 
 
65
 
# Wrap up
66
 
f_collect_juju_logs
67
 
f_set_build_descr
68
 
f_nice_finish
69
 
f_check_fail