blob: 3f5071b5cce2af9b91117229db7d140c6e3375f2 [file] [log] [blame]
Aleksey Zvyagintsevc3d46bc2018-11-07 10:29:57 +00001#!/bin/bash
2
3set -ex
4
5export GERRIT_NAME=${GERRIT_NAME:-mcp-jenkins}
6# Would delete all .git folders.
7# Keep in mine, you would not able to get any other version or history!
8# Will ignore 'tempest' itself bz of:
9# ```
10# Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository.
11# It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo.
12# Project name tempest was given, but was not able to be found.
13# ```
14export RELEASE_BUILD=${RELEASE_BUILD:-true}
15#
16export TEMPEST_TAG="${TEMPEST_TAG:-mcp/queens}"
17export HORIZON_TAG="${HORIZON_TAG:-mcp/queens}"
18export BARBICAN_TAG="${BARBICAN_TAG:-mcp/queens}"
19export DESIGNATE_TAG="${DESIGNATE_TAG:-mcp/queens}"
20export HEAT_TAG="${HEAT_TAG:-mcp/queens}"
21export IRONIC_TAG="${IRONIC_TAG:-mcp/queens}"
22export MANILA_TAG="${MANILA_TAG:-mcp/queens}"
23export TELEMETRY_TAG="${TELEMETRY_TAG:-mcp/queens}"
24export OCTAVIA_TAG="${OCTAVIA_TAG:-mcp/queens}"
25export PATROLE_TAG="${PATROLE_TAG:-0.4.x}"
26export TUNGSTEN_TAG="${TUNGSTEN_TAG:-0.1.x}"
27# global openstack requirements repo
28# This is the commit where tempest version is 18.0.0 in u-c
29export UPPER_CONSTRAINTS_TAG="${UPPER_CONSTRAINTS_TAG:-6e64e622e8608ab817dbc809d99e02e4cfdd9f59}"
30
31function prepare(){
32 # TODO migrate to downstrem mirror?
33 mkdir -p data; pushd data
34 if [ ! -d openstack_requirements ] ; then
35 git clone https://github.com/openstack/requirements.git openstack_requirements
36 pushd openstack_requirements; git checkout $UPPER_CONSTRAINTS_TAG; popd
37 fi
38 sed -i -e "s|tempest=.*|git+file:///var/lib/tempest@${TEMPEST_TAG}#egg=tempest|g" \
39 openstack_requirements/upper-constraints.txt;
40 #
41 if [ ! -d tempest ] ; then
42 git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/tempest tempest
43 pushd tempest ; git checkout $TEMPEST_TAG; popd
44 fi
45 #
46 if [ ! -d tempest-horizon-plugin ] ; then
47 git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/tempest-horizon tempest-horizon-plugin
48 pushd tempest-horizon-plugin ; git checkout $HORIZON_TAG; popd
49 fi
50 #
51 if [ ! -d barbican-tempest-plugin ] ; then
52 git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/barbican-tempest-plugin
53 pushd barbican-tempest-plugin; git checkout $BARBICAN_TAG; popd
54 fi
55 #
56 if [ ! -d designate-tempest-plugin ] ; then
57 git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/designate-tempest-plugin
58 pushd designate-tempest-plugin; git checkout $DESIGNATE_TAG; popd;
59 fi
60 #
61 if [ ! -d heat-tempest-plugin ] ; then
62 git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/heat-tempest-plugin
63 pushd heat-tempest-plugin; git checkout $HEAT_TAG; popd
64 fi
65 #
66 if [ ! -d ironic-tempest-plugin ] ; then
67 git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/ironic-tempest-plugin
68 pushd ironic-tempest-plugin; git checkout $IRONIC_TAG; popd;
69 fi
70 #
71 if [ ! -d manila-tempest-plugin ] ; then
72 git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/manila-tempest-plugin
73 pushd manila-tempest-plugin; git checkout $MANILA_TAG; popd;
74 fi
75 #
76 if [ ! -d telemetry-tempest-plugin ] ; then
77 git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/telemetry-tempest-plugin
78 pushd telemetry-tempest-plugin; git checkout $TELEMETRY_TAG; popd;
79 fi
80 #
81 if [ ! -d octavia-tempest-plugin ] ; then
82 git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/octavia-tempest-plugin
83 pushd octavia-tempest-plugin; git checkout $OCTAVIA_TAG; popd;
84 fi
85 #
86 if [ ! -d patrole-tempest-plugin ] ; then
87 git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/patrole patrole-tempest-plugin
88 pushd patrole-tempest-plugin; git checkout $PATROLE_TAG; popd;
89 fi
90 #
91 if [ ! -d tungsten-tempest-plugin ] ; then
92 git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/contrail/tungsten-tempest tungsten-tempest-plugin
93 pushd tungsten-tempest-plugin; git checkout $TUNGSTEN_TAG; popd;
94 fi
95 #
96 if [ ! -d tungsten-tempest-plugin ] ; then
97 git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/tempest
98 pushd tempest; git checkout $TEMPEST_TAG; popd
99 fi
100 #
101 if [[ "$(echo ${RELEASE_BUILD} | tr [:upper:] [:lower:] )" == "true" ]]; then
102 find . -maxdepth 2 -type d -iname .git -not -path '*tempest/.git*' | xargs --no-run-if-empty rm -rf
103 find . -maxdepth 2 -type f -iname .gitignore -or -iname .gitreview | xargs --no-run-if-empty rm -v
104 fi
105 popd
106 }
107
108function buildme(){
109 echo "=== Installing plugi-reqs"
110 plugins="tempest-horizon-plugin barbican-tempest-plugin designate-tempest-plugin heat-tempest-plugin ironic-tempest-plugin"
111 plugins="${plugins} manila-tempest-plugin telemetry-tempest-plugin octavia-tempest-plugin patrole-tempest-plugin tungsten-tempest-plugin"
112 for plugin in ${plugins}; do
113 pushd /var/lib/${plugin}
114 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt
115 popd
116 done
117 echo "=== Installing tempest itself"
118 pushd /var/lib/tempest/
119 pip install .
120 popd
121 pip install junitxml
122 echo "BUILD_TIMESTAMP=$(date '+%Y-%m-%d-%H-%M-%S' -u)" > /etc/build_timestamp
123}
124
125############# body ############################################################
126
127case "$1" in
128
129buildme) echo "Attempt to buildme"
130 buildme
131 ;;
132*) echo "Attempt to prepare.."
133 prepare
134 ;;
135esac