2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2016 Ericsson AB and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
14 cd $WORKSPACE/prototypes/xci
16 # for daily jobs, we want to use working versions
17 # for periodic jobs, we will use whatever is set in the job, probably master
18 if [[ "$XCI_LOOP" == "daily" ]]; then
19 # source pinned-vars to get releng version
20 source ./config/pinned-versions
22 # checkout the version
23 git checkout -q $OPNFV_RELENG_VERSION
24 echo "Info: Using $OPNFV_RELENG_VERSION"
25 elif [[ "$XCI_LOOP" == "periodic" ]]; then
26 echo "Info: Using $OPNFV_RELENG_VERSION"
29 # this is just an example to give the idea about what we need to do
30 # so ignore this part for the timebeing as we need to adjust xci-deploy.sh
31 # to take this into account while deploying anyways
32 # clone openstack-ansible
33 # stable/ocata already use pinned versions so this is only valid for master
34 if [[ "$XCI_LOOP" == "periodic" && "$OPENSTACK_OSA_VERSION" == "master" ]]; then
36 # get the url to openstack-ansible git
37 source ./config/env-vars
38 echo "Info: Capture the ansible role requirement versions before doing anything"
39 git clone -q $OPENSTACK_OSA_GIT_URL
41 cat ansible-role-requirements.yml | while IFS= read -r line
43 if [[ $line =~ "src:" ]]; then
44 repo_url=$(echo $line | awk {'print $2'})
45 repo_sha1=$(git ls-remote $repo_url $OPENSTACK_OSA_VERSION | awk {'print $1'})
47 echo "$line" | sed -e "s|master|$repo_sha1|" >> opnfv-ansible-role-requirements.yml
49 echo "Info: SHA1s of ansible role requirements"
50 echo "-------------------------------------------------------------------------"
51 cat opnfv-ansible-role-requirements.yml
52 echo "-------------------------------------------------------------------------"
55 # proceed with the deployment
56 cd $WORKSPACE/prototypes/xci
57 sudo -E ./xci-deploy.sh
59 if [[ "$JOB_NAME" =~ "periodic" && "$OPENSTACK_OSA_VERSION" == "master" ]]; then
60 # if we arrived here without failing, it means we have something we can pin
61 # this is again here to show the intention
62 cd $WORKSPACE/openstack-ansible
63 OSA_GIT_SHA1=$(git rev-parse HEAD)
67 echo "***********************************************************************"
68 echo "* OSA SHA1 TO PIN *"
72 echo "***********************************************************************"