summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
6e6882f)
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>
- string:
name: ANSIBLE_VERBOSITY
default: ''
- string:
name: ANSIBLE_VERBOSITY
default: ''
+ - string:
+ name: XCI_LOOP
+ default: 'periodic'
wrappers:
- fix-workspace-permissions
wrappers:
- fix-workspace-permissions
- string:
name: ANSIBLE_VERBOSITY
default: '-vvvv'
- string:
name: ANSIBLE_VERBOSITY
default: '-vvvv'
+ - string:
+ name: XCI_LOOP
+ default: 'verify'
- string:
name: ANSIBLE_VERBOSITY
default: ''
- string:
name: ANSIBLE_VERBOSITY
default: ''
+ - string:
+ name: XCI_LOOP
+ default: 'periodic'
wrappers:
- fix-workspace-permissions
wrappers:
- fix-workspace-permissions
- label:
name: SLAVE_LABEL
default: '{slave-label}'
- label:
name: SLAVE_LABEL
default: '{slave-label}'
+ - string:
+ name: XCI_LOOP
+ default: 'daily'
triggers:
- '{auto-trigger-name}'
triggers:
- '{auto-trigger-name}'
predefined-parameters: |
DEPLOY_SCENARIO=$DEPLOY_SCENARIO
XCI_FLAVOR=$XCI_FLAVOR
predefined-parameters: |
DEPLOY_SCENARIO=$DEPLOY_SCENARIO
XCI_FLAVOR=$XCI_FLAVOR
same-node: true
block: true
- trigger-builds:
same-node: true
block: true
- trigger-builds:
predefined-parameters: |
DEPLOY_SCENARIO=$DEPLOY_SCENARIO
XCI_FLAVOR=$XCI_FLAVOR
predefined-parameters: |
DEPLOY_SCENARIO=$DEPLOY_SCENARIO
XCI_FLAVOR=$XCI_FLAVOR
same-node: true
block: true
block-thresholds:
same-node: true
block: true
block-thresholds:
- string:
name: ANSIBLE_VERBOSITY
default: ''
- string:
name: ANSIBLE_VERBOSITY
default: ''
+ - string:
+ name: XCI_LOOP
+ default: 'daily'
builders:
- description-setter:
builders:
- description-setter:
# for daily jobs, we want to use working versions
# for periodic jobs, we will use whatever is set in the job, probably master
# for daily jobs, we want to use working versions
# for periodic jobs, we will use whatever is set in the job, probably master
-if [[ "$JOB_NAME" =~ "daily" ]]; then
+if [[ "$XCI_LOOP" == "daily" ]]; then
# source pinned-vars to get releng version
source ./config/pinned-versions
# checkout the version
git checkout -q $OPNFV_RELENG_VERSION
echo "Info: Using $OPNFV_RELENG_VERSION"
# source pinned-vars to get releng version
source ./config/pinned-versions
# checkout the version
git checkout -q $OPNFV_RELENG_VERSION
echo "Info: Using $OPNFV_RELENG_VERSION"
-elif [[ "$JOB_NAME" =~ "periodic" ]]; then
+elif [[ "$XCI_LOOP" == "periodic" ]]; then
echo "Info: Using $OPNFV_RELENG_VERSION"
fi
echo "Info: Using $OPNFV_RELENG_VERSION"
fi
# to take this into account while deploying anyways
# clone openstack-ansible
# stable/ocata already use pinned versions so this is only valid for master
# to take this into account while deploying anyways
# clone openstack-ansible
# stable/ocata already use pinned versions so this is only valid for master
-if [[ "$JOB_NAME" =~ "periodic" && "$OPENSTACK_OSA_VERSION" == "master" ]]; then
+if [[ "$XCI_LOOP" == "periodic" && "$OPENSTACK_OSA_VERSION" == "master" ]]; then
cd $WORKSPACE
# get the url to openstack-ansible git
source ./config/env-vars
cd $WORKSPACE
# get the url to openstack-ansible git
source ./config/env-vars
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 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
export JOB_NAME=${JOB_NAME:-false}
# TODO: this currently matches to bifrost ansible version
# there is perhaps better way to do this
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"
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}}"
- 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:
- hosts: localhost
remote_user: root
tasks:
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_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') }}"
LOG_PATH: "{{ lookup('env','LOG_PATH') }}"
OPNFV_HOST_IP: "{{ lookup('env','OPNFV_HOST_IP') }}"