blob: 681c9b4289c67bfc669d827a24f6c935414784c4 [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.
azvyagintsevcafdd672018-11-12 15:32:16 +02007# Keep in mind, you would not able to get any other version or history!
Aleksey Zvyagintsevc3d46bc2018-11-07 10:29:57 +00008# 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# ```
azvyagintsevcafdd672018-11-12 15:32:16 +020014# FIXME|TODO Disabled by default.
15# Currently, pip not able to install any package w\o .git directory.
16# Should it be re-writed to tgz install or whatever?
17#export RELEASE_BUILD=${RELEASE_BUILD:-true}
18RELEASE_BUILD=false
Aleksey Zvyagintsevc3d46bc2018-11-07 10:29:57 +000019#
20export TEMPEST_TAG="${TEMPEST_TAG:-mcp/queens}"
21export HORIZON_TAG="${HORIZON_TAG:-mcp/queens}"
22export BARBICAN_TAG="${BARBICAN_TAG:-mcp/queens}"
23export DESIGNATE_TAG="${DESIGNATE_TAG:-mcp/queens}"
24export HEAT_TAG="${HEAT_TAG:-mcp/queens}"
25export IRONIC_TAG="${IRONIC_TAG:-mcp/queens}"
26export MANILA_TAG="${MANILA_TAG:-mcp/queens}"
27export TELEMETRY_TAG="${TELEMETRY_TAG:-mcp/queens}"
28export OCTAVIA_TAG="${OCTAVIA_TAG:-mcp/queens}"
ibumarskov613df5a2019-06-26 14:45:55 +040029export PATROLE_TAG="${PATROLE_TAG:-mcp/queens}"
Aleksey Zvyagintsevc3d46bc2018-11-07 10:29:57 +000030export TUNGSTEN_TAG="${TUNGSTEN_TAG:-0.1.x}"
31# global openstack requirements repo
32# This is the commit where tempest version is 18.0.0 in u-c
33export UPPER_CONSTRAINTS_TAG="${UPPER_CONSTRAINTS_TAG:-6e64e622e8608ab817dbc809d99e02e4cfdd9f59}"
34
35function prepare(){
36 # TODO migrate to downstrem mirror?
37 mkdir -p data; pushd data
38 if [ ! -d openstack_requirements ] ; then
Oleksii Molchanov92e1df02021-06-30 12:34:22 +030039 mv ../openstack_requirements .
Aleksey Zvyagintsevc3d46bc2018-11-07 10:29:57 +000040 fi
41 sed -i -e "s|tempest=.*|git+file:///var/lib/tempest@${TEMPEST_TAG}#egg=tempest|g" \
42 openstack_requirements/upper-constraints.txt;
43 #
Aleksey Zvyagintsevc3d46bc2018-11-07 10:29:57 +000044 if [ ! -d tempest-horizon-plugin ] ; then
45 git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/tempest-horizon tempest-horizon-plugin
46 pushd tempest-horizon-plugin ; git checkout $HORIZON_TAG; popd
47 fi
48 #
49 if [ ! -d barbican-tempest-plugin ] ; then
50 git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/barbican-tempest-plugin
51 pushd barbican-tempest-plugin; git checkout $BARBICAN_TAG; popd
52 fi
53 #
54 if [ ! -d designate-tempest-plugin ] ; then
55 git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/designate-tempest-plugin
56 pushd designate-tempest-plugin; git checkout $DESIGNATE_TAG; popd;
57 fi
58 #
59 if [ ! -d heat-tempest-plugin ] ; then
60 git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/heat-tempest-plugin
61 pushd heat-tempest-plugin; git checkout $HEAT_TAG; popd
62 fi
63 #
64 if [ ! -d ironic-tempest-plugin ] ; then
65 git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/ironic-tempest-plugin
66 pushd ironic-tempest-plugin; git checkout $IRONIC_TAG; popd;
67 fi
68 #
69 if [ ! -d manila-tempest-plugin ] ; then
70 git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/manila-tempest-plugin
71 pushd manila-tempest-plugin; git checkout $MANILA_TAG; popd;
72 fi
73 #
74 if [ ! -d telemetry-tempest-plugin ] ; then
75 git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/telemetry-tempest-plugin
76 pushd telemetry-tempest-plugin; git checkout $TELEMETRY_TAG; popd;
77 fi
78 #
79 if [ ! -d octavia-tempest-plugin ] ; then
80 git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/octavia-tempest-plugin
81 pushd octavia-tempest-plugin; git checkout $OCTAVIA_TAG; popd;
82 fi
83 #
84 if [ ! -d patrole-tempest-plugin ] ; then
85 git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/patrole patrole-tempest-plugin
86 pushd patrole-tempest-plugin; git checkout $PATROLE_TAG; popd;
87 fi
88 #
89 if [ ! -d tungsten-tempest-plugin ] ; then
90 git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/contrail/tungsten-tempest tungsten-tempest-plugin
91 pushd tungsten-tempest-plugin; git checkout $TUNGSTEN_TAG; popd;
92 fi
93 #
azvyagintsevcafdd672018-11-12 15:32:16 +020094 if [ ! -d tempest ] ; then
95 git clone ssh://${GERRIT_NAME}@gerrit.mcp.mirantis.com:29418/packaging/sources/tempest tempest
96 pushd tempest ; git checkout $TEMPEST_TAG; popd
Aleksey Zvyagintsevc3d46bc2018-11-07 10:29:57 +000097 fi
98 #
99 if [[ "$(echo ${RELEASE_BUILD} | tr [:upper:] [:lower:] )" == "true" ]]; then
100 find . -maxdepth 2 -type d -iname .git -not -path '*tempest/.git*' | xargs --no-run-if-empty rm -rf
101 find . -maxdepth 2 -type f -iname .gitignore -or -iname .gitreview | xargs --no-run-if-empty rm -v
102 fi
103 popd
104 }
105
106function buildme(){
azvyagintsevcafdd672018-11-12 15:32:16 +0200107 echo "=== Installing plugins"
Aleksey Zvyagintsevc3d46bc2018-11-07 10:29:57 +0000108 plugins="tempest-horizon-plugin barbican-tempest-plugin designate-tempest-plugin heat-tempest-plugin ironic-tempest-plugin"
109 plugins="${plugins} manila-tempest-plugin telemetry-tempest-plugin octavia-tempest-plugin patrole-tempest-plugin tungsten-tempest-plugin"
110 for plugin in ${plugins}; do
azvyagintsevcafdd672018-11-12 15:32:16 +0200111 echo "=== Installing plugin: ${plugin}"
Aleksey Zvyagintsevc3d46bc2018-11-07 10:29:57 +0000112 pushd /var/lib/${plugin}
azvyagintsevcafdd672018-11-12 15:32:16 +0200113 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt .
Aleksey Zvyagintsevc3d46bc2018-11-07 10:29:57 +0000114 popd
115 done
116 echo "=== Installing tempest itself"
117 pushd /var/lib/tempest/
Pavlo Shchelokovskyy6b463672020-04-02 17:40:10 +0300118 pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt
Aleksey Zvyagintsevc3d46bc2018-11-07 10:29:57 +0000119 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