summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>2017-04-04 09:18:54 -0700
committerTrevor Bramwell <tbramwell@linuxfoundation.org>2017-08-11 12:56:12 -0700
commit13ab3bd3a0d1893e2cb3cb2e2cb5cffd1d49c2d3 (patch)
tree264231a74d55fae0542901580b11407d0b1c80ab
parente6a9731bf0994c2ca3ff9e81c2137bf8de9146bc (diff)
xci: Introduce XCI_LOOP variable to control what to do properly
XCI has different jobs/loops to run - patchset verification jobs (currently bifrost and osa in future) - periodic jobs (bifrost and osa) - daily jobs (for OPNFV platform deployment and testing) The same scripts/playbooks used by XCI will also be used by developers. We need to do different things depending on the context the scripts and playbooks are executed. - periodic jobs will use latest of everything to find working versions of the components. (periodic osa will use unpinned role requirements for example) - daily jobs will use pinned versions in order to bring up the platform and run OPNFV testing against it. (daily deployment will use pinned versions and role requirements for example) - developers might choose to use pinned versions or latest Depending on what loop we are running, we need to do things differently in scripts and playbooks. This variable will help us to do this in easy way. We can of course do pattern matching of the job name but it will not work if the scripts are used outside of Jenkins. The default loop for non-Jenkins execution is set to daily as we want developers to use working versions unless they change it to something else intentionally. Change-Id: Iff69c77ae3d9db2c14de1783ce098da9e9f0c83d Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
-rwxr-xr-xxci/config/env-vars1
-rw-r--r--xci/playbooks/configure-opnfvhost.yml2
-rw-r--r--xci/var/opnfv.yml1
3 files changed, 4 insertions, 0 deletions
diff --git a/xci/config/env-vars b/xci/config/env-vars
index 052be2ac..cefb412a 100755
--- a/xci/config/env-vars
+++ b/xci/config/env-vars
@@ -9,6 +9,7 @@ export OPENSTACK_OSA_ETC_PATH=/etc/openstack_deploy
export CLEAN_DIB_IMAGES=false
export OPNFV_HOST_IP=192.168.122.2
export XCI_FLAVOR_ANSIBLE_FILE_PATH=$OPNFV_RELENG_PATH/prototypes/xci/file/$XCI_FLAVOR
+export CI_LOOP=${CI_LOOP:-daily}
export JOB_NAME=${JOB_NAME:-false}
# TODO: this currently matches to bifrost ansible version
# there is perhaps better way to do this
diff --git a/xci/playbooks/configure-opnfvhost.yml b/xci/playbooks/configure-opnfvhost.yml
index 06e27e7f..8c794c42 100644
--- a/xci/playbooks/configure-opnfvhost.yml
+++ b/xci/playbooks/configure-opnfvhost.yml
@@ -54,8 +54,10 @@
replace: '\1haproxy_state: enabled'
- name: copy OPNFV OpenStack playbook
shell: "/bin/cp -rf {{OPNFV_RELENG_PATH}}/prototypes/xci/file/setup-openstack.yml {{OPENSTACK_OSA_PATH}}/playbooks"
+ # Copy pinned role requirements if we are running as part of daily CI loop
- name: copy OPNFV role requirements
shell: "/bin/cp -rf {{OPNFV_RELENG_PATH}}/prototypes/xci/file/ansible-role-requirements.yml {{OPENSTACK_OSA_PATH}}"
+ when: XCI_LOOP == "daily"
- hosts: localhost
remote_user: root
tasks:
diff --git a/xci/var/opnfv.yml b/xci/var/opnfv.yml
index dd3761bd..12cb5567 100644
--- a/xci/var/opnfv.yml
+++ b/xci/var/opnfv.yml
@@ -20,5 +20,6 @@ OPENSTACK_OSA_ETC_PATH: "{{ lookup('env','OPENSTACK_OSA_ETC_PATH') }}"
XCI_ANSIBLE_PIP_VERSION: "{{ lookup('env','XCI_ANSIBLE_PIP_VERSION') }}"
XCI_FLAVOR: "{{ lookup('env','XCI_FLAVOR') }}"
XCI_FLAVOR_ANSIBLE_FILE_PATH: "{{ lookup('env','XCI_FLAVOR_ANSIBLE_FILE_PATH') }}"
+XCI_LOOP: "{{ lookup('env','XCI_LOOP') }}"
LOG_PATH: "{{ lookup('env','LOG_PATH') }}"
OPNFV_HOST_IP: "{{ lookup('env','OPNFV_HOST_IP') }}"