+++ /dev/null
-Project: Release Engineering (Releng)
-Project Creation Date: July 14, 2015
-Project Category: Integration & Testing
-Lifecycle State: Incubation
-Primary Contact: Fatih Degirmenci
-Project Lead: Fatih Degirmenci
-Jira Project Name: Release Engineering
-Jira Project Prefix: RELENG
-Mailing list tag: [releng]
-IRC: Server:freenode.net Channel:#opnfv-octopus
-Repository: releng
-Other Repositories: releng-xci, releng-testresults
-
-Committers:
-Fatih Degirmenci (Ericsson, fatih.degirmenci@ericsson.com)
-Aric Gardner (Linux Foundation, agardner@linuxfoundation.org)
-Tim Rozet (Red Hat, trozet@redhat.com)
-Morgan Richomme (Orange, morgan.richomme@orange.com)
-Jose Lausuch (Ericsson, jose.lausuch@ericsson.com)
-Ryota Mibu (NEC, r-mibu@cq.jp.nec.com)
-Mei Mei (Huawei, meimei@huawei.com)
-Trevor Bramwell (Linux Foundation, tbramwell@linuxfoundation.org)
-Serena Feng (ZTE, feng.xiaowei@zte.com.cn)
-Yolanda Robla Mota (Red Hat, yroblamo@redhat.com)
-Markos Chandras (SUSE, mchandras@suse.de)
-Luke Hinds (Red Hat, lhinds@redhat.com)
-
-Link to TSC approval of the project: http://ircbot.wl.linuxfoundation.org/meetings/opnfv-meeting/2015/opnfv-meeting.2015-07-14-14.00.html
-Link to TSC voting for removal of Victor Laza as committer: http://meetbot.opnfv.org/meetings/opnfv-meeting/2016/opnfv-meeting.2016-02-16-14.59.html
-Link to nomination and acceptance of Mei Mei as committer: http://lists.opnfv.org/pipermail/opnfv-tsc/2016-March/002228.html
-Links to nomination and accceptance of Trevor Bramwell as committer: http://lists.opnfv.org/pipermail/opnfv-tech-discuss/2016-July/011659.html and http://lists.opnfv.org/pipermail/opnfv-tech-discuss/2016-July/011714.html
TBD
.. toctree::
- :numbered:
:maxdepth: 2
user-guide
JIRA
.. toctree::
- :maxdepth:
+ :maxdepth: 1
jira/user-guide
1. Create a user named **jenkins** on the machine you want to connect to OPNFV Jenkins and give the user sudo rights.
2. Install needed software on the machine you want to connect to OPNFV Jenkins as slave.
+
- openjdk 8
- monit
+
3. If the slave will be used for running virtual deployments, Functest, and Yardstick, install below software and make jenkins user the member of the groups.
+
- docker
- libvirt
+
4. Create slave root in Jenkins user home directory.
+
``mkdir -p /home/jenkins/opnfv/slave_root``
+
5. Clone OPNFV Releng Git repository.
+
``mkdir -p /home/jenkins/opnfv/repos``
``cd /home/jenkins/opnfv/repos``
``git clone https://gerrit.opnfv.org/gerrit/p/releng.git``
+
6. Contact LF by sending mail to `OPNFV LF Helpdesk <opnfv-helpdesk@rt.linuxfoundation.org>`_ and request creation of a slave on OPNFV Jenkins. Include below information in your mail.
+
- Slave root (/home/jenkins/opnfv/slave_root)
- Public IP of the slave (You can get the IP by executing ``curl http://icanhazip.com/``)
- PGP Key (attached to the mail or exported to a key server)
+
7. Once you get confirmation from LF stating that your slave is created on OPNFV Jenkins, check if the firewall on LF is open for the server you are trying to connect to Jenkins.
+
``cp /home/jenkins/opnfv/repos/releng/utils/jenkins-jnlp-connect.sh /home/jenkins/``
``cd /home/jenkins/``
``sudo ./jenkins-jnlp-connect.sh -j /home/jenkins -u jenkins -n <slave name on OPNFV Jenkins> -s <the token you received from LF> -f``
- If you receive an error, follow the steps listed on the command output.
+
8. Run the same script with test(-t) on foreground in order to make sure no problem on connection. You should see **INFO: Connected** in the console log.
+
``sudo ./jenkins-jnlp-connect.sh -j /home/jenkins -u jenkins -n <slave name on OPNFV Jenkins> -s <the token you received from LF> -t``
- If you receive an error similar to the one shown `on this link <http://hastebin.com/ozadagirax.avrasm>`_, you need to check your firewall and allow outgoing connections for the port.
+
9. Kill the Java slave.jar process.
10. Run the same script normally without test(-t) in order to get monit script created.
+
``sudo ./jenkins-jnlp-connect.sh -j /home/jenkins -u jenkins -n <slave name on OPNFV Jenkins> -s <the token you received from LF>``
+
11. Edit monit configuration and enable http interface. The file to edit is /etc/monit/monitrc on Ubuntu systems. Uncomment below lines.
+
set httpd port 2812 and
use address localhost # only accept connection from localhost
allow localhost # allow localhost to connect to the server and
+
12. Restart monit service.
+
- Without systemd:
``sudo service monit restart``
+
- With systemd: you have to enable monit service first and then restart it.
``sudo systemctl enable monit``
``sudo systemctl restart monit``
+
13. Check to see if jenkins comes up as managed service in monit.
+
``sudo monit status``
+
14. Connect slave to OPNFV Jenkins using monit.
+
``sudo monit start jenkins``
+
15. Check slave on OPNFV Jenkins to verify the slave is reported as connected.
+
- The slave on OPNFV Jenkins should have some executors in “Idle” state if the connection is successful.
Notes
===============
.. toctree::
- :numbered:
:maxdepth: 2
release-process
if echo $ARTIFACT_VERSION | grep "dev" 1> /dev/null; then
GERRIT_PATCHSET_NUMBER=$(echo $GERRIT_REFSPEC | grep -Eo '[0-9]+$')
export OPNFV_ARTIFACT_VERSION="dev${GERRIT_CHANGE_NUMBER}_${GERRIT_PATCHSET_NUMBER}"
- export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c $CACHE_DIRECTORY"
+ if [ "$BRANCH" == 'master' ]; then
+ # build rpm
+ export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c $CACHE_DIRECTORY --rpms"
+ else
+ export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c $CACHE_DIRECTORY"
+ fi
elif echo $BUILD_TAG | grep "csit" 1> /dev/null; then
export OPNFV_ARTIFACT_VERSION=csit${BUILD_NUMBER}
export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c $CACHE_DIRECTORY"
elif [ "$ARTIFACT_VERSION" == "daily" ]; then
export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
if [ "$BRANCH" == 'master' ]; then
- export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c $CACHE_DIRECTORY"
+ export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c $CACHE_DIRECTORY --rpms"
else
export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c $CACHE_DIRECTORY --iso"
fi
else
export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
if [ "$BRANCH" == 'master' ]; then
- export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c $CACHE_DIRECTORY"
+ export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c $CACHE_DIRECTORY --rpms"
else
export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c $CACHE_DIRECTORY --iso"
fi
if [[ "${DEPLOY_SCENARIO}" =~ fdio|ovs ]]; then
DEPLOY_CMD="${DEPLOY_CMD} --virtual-default-ram 12 --virtual-compute-ram 7"
fi
- if [[ "$JOB_NAME" == *csit* ]]; then
- DEPLOY_CMD="${DEPLOY_CMD} -e csit-environment.yaml"
- fi
if [[ "$PROMOTE" == "True" ]]; then
- DEPLOY_CMD="${DEPLOY_CMD} --virtual-computes 1"
+ DEPLOY_CMD="${DEPLOY_CMD} --virtual-computes 2 -e csit-environment.yaml"
fi
else
# settings for bare metal deployment
if [ "$IPV6_FLAG" == "True" ]; then
NETWORK_FILE="${NETWORK_SETTINGS_DIR}/network_settings_v6.yaml"
+elif [[ "$PROMOTE" == "True" ]]; then
+ NETWORK_FILE="${NETWORK_SETTINGS_DIR}/network_settings_csit.yaml"
else
NETWORK_FILE="${NETWORK_SETTINGS_DIR}/network_settings.yaml"
fi
# start deployment
sudo ${DEPLOY_CMD} -d ${DEPLOY_FILE} -n ${NETWORK_FILE} --debug
-if [[ "$JOB_NAME" == *csit* ]]; then
+if [[ "$PROMOTE" == 'True' ]]; then
echo "CSIT job: setting host route for floating ip routing"
# csit route to allow docker container to reach floating ips
UNDERCLOUD=$(sudo virsh domifaddr undercloud | grep -Eo "[0-9\.]+{3}[0-9]+")
RPM_INSTALL_PATH=$(echo "http://"$OPNFV_RPM_URL | sed 's/\/'"$(basename $OPNFV_RPM_URL)"'//')
RPM_LIST=$(basename $OPNFV_RPM_URL)
-
+ # find version of RPM
+ VERSION_EXTENSION=$(echo $(basename $RPM_LIST) | grep -Eo '[0-9]+\.[0-9]+-([0-9]{8}|[a-z]+-[0-9]\.[0-9]+)')
if [ "$BRANCH" != 'master' ]; then
- # find version of RPM
- VERSION_EXTENSION=$(echo $(basename $RPM_LIST) | grep -Eo '[0-9]+\.[0-9]+-([0-9]{8}|[a-z]+-[0-9]\.[0-9]+)')
# build RPM List which already includes base Apex RPM
RPM_LIST+=" opnfv-apex-undercloud-${VERSION_EXTENSION}.noarch.rpm"
RPM_LIST+=" python34-opnfv-apex-${VERSION_EXTENSION}.noarch.rpm"
done
# copy virsh net definitions
-for net in admin api external storage tenant; do
- sudo virsh net-dumpxml ${net} > ${net}.xml
-done
+sudo virsh net-dumpxml admin > admin.xml
sudo chown jenkins-ci:jenkins-ci *
- master: &master
branch: '{stream}'
gs-pathname: ''
- verify-scenario: 'os-odl-nofeature-ha'
+ verify-scenario: 'os-nosdn-nofeature-ha'
disabled: false
- fraser: &fraser
branch: 'stable/{stream}'
gs-pathname: '/{stream}'
- verify-scenario: 'os-odl-nofeature-ha'
+ verify-scenario: 'os-nosdn-nofeature-ha'
disabled: false
- danube: &danube
branch: 'stable/{stream}'
GERRIT_REFSPEC=$GERRIT_REFSPEC
GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
+ FUNCTEST_SUITE_NAME=tempest_smoke_serial
+ FUNCTEST_MODE=testcase
node-parameters: false
kill-phase-on: FAILURE
abort-all-job: true
blocking-jobs:
- 'apex-verify.*'
- 'apex-virtual.*'
+ - 'apex-.*-promote.*'
- throttle:
max-per-node: 1
max-total: 10
current-parameters: false
predefined-parameters: |
DEPLOY_SCENARIO=$DEPLOY_SCENARIO
- FUNCTEST_MODE=tier
- FUNCTEST_TIER=healthcheck
+ FUNCTEST_SUITE_NAME=tempest_smoke_serial
+ FUNCTEST_MODE=testcase
GERRIT_BRANCH=$GERRIT_BRANCH
GERRIT_REFSPEC=$GERRIT_REFSPEC
GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
- 'apex-virtual-{stream}'
- 'apex-deploy-{platform}-{stream}'
- 'apex-daily-{stream}'
- - 'apex-csit-promote-daily-{stream}'
+ - 'apex-csit-promote-daily-{stream}-{os_version}'
- 'apex-fdio-promote-daily-{stream}'
- 'apex-{scenario}-baremetal-{scenario_stream}'
- 'apex-testsuite-{scenario}-baremetal-{scenario_stream}'
build-slave: 'apex-build-master'
virtual-slave: 'apex-virtual-master'
baremetal-slave: 'apex-baremetal-master'
- verify-scenario: 'os-odl-nofeature-ha'
+ verify-scenario: 'os-nosdn-nofeature-ha'
scenario_stream: 'master'
disable_daily: false
disable_promote: false
build-slave: 'apex-build-master'
virtual-slave: 'apex-virtual-master'
baremetal-slave: 'apex-baremetal-master'
- verify-scenario: 'os-odl-nofeature-ha'
+ verify-scenario: 'os-nosdn-nofeature-ha'
scenario_stream: 'fraser'
disable_daily: false
disable_promote: true
<<: *danube
- 'os-ovn-nofeature-noha':
<<: *danube
- - 'os-odl-master_upstream-noha':
+ - 'os-odl-nofeature-noha':
<<: *master
- - 'os-odl-queens_upstream-noha':
+ - 'os-odl-nofeature-ha':
+ <<: *master
+ - 'os-odl-queens-noha':
+ <<: *master
+ - 'os-odl-queens-ha':
<<: *master
- 'os-nosdn-nofeature-noha':
<<: *euphrates
- 'virtual'
os_version:
- - 'pike'
- - 'queens'
- - 'master'
+ - 'pike':
+ os_scenario: 'pike'
+ - 'queens':
+ os_scenario: 'queens'
+ - 'master':
+ os_scenario: 'nofeature'
# Fetch Logs Job
parameters:
- '{project}-defaults'
- '{project}-virtual-{stream}-defaults'
+ - 'functest-suite-parameter'
- project-parameter:
project: '{project}'
branch: '{branch}'
block-level: 'NODE'
blocking-jobs:
- 'apex-runner.*'
- - 'apex-.*-promote.*'
- 'apex-run.*'
- 'apex-virtual-.*'
- 'apex-verify-gate-.*'
GERRIT_REFSPEC=$GERRIT_REFSPEC
GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
+ PROMOTE=$PROMOTE
node-parameters: true
kill-phase-on: FAILURE
abort-all-job: true
current-parameters: false
predefined-parameters: |
DEPLOY_SCENARIO=$DEPLOY_SCENARIO
- FUNCTEST_SUITE_NAME=healthcheck
+ FUNCTEST_MODE=$FUNCTEST_MODE
+ FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
GERRIT_BRANCH=$GERRIT_BRANCH
GERRIT_REFSPEC=$GERRIT_REFSPEC
GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
blocking-jobs:
- 'apex-verify.*'
- 'apex-runner.*'
- - 'apex-.*-promote.*'
- 'apex-run.*'
- 'apex-testsuite-.+-baremetal-.+'
- throttle:
# CSIT promote
- job-template:
- name: 'apex-csit-promote-daily-{stream}'
+ name: 'apex-csit-promote-daily-{stream}-{os_version}'
# Job template for promoting CSIT Snapshots
#
branch: '{branch}'
- apex-parameter:
gs-pathname: '{gs-pathname}'
+ - string:
+ name: ARTIFACT_VERSION
+ default: dev
+ description: "Used for overriding the ARTIFACT_VERSION"
+ - string:
+ name: PROMOTE
+ default: 'True'
+ description: "Used for overriding the PROMOTE"
properties:
- build-blocker:
block-level: 'NODE'
blocking-jobs:
- 'apex-verify.*'
- - 'apex-deploy.*'
- 'apex-runner.*'
- 'apex-daily.*'
builders:
- multijob:
- name: deploy-virtual
+ name: apex-virtual-deploy-test
condition: SUCCESSFUL
projects:
- - name: 'apex-deploy-virtual-{stream}'
- current-parameters: false
+ - name: 'apex-virtual-{stream}'
+ current-parameters: true
predefined-parameters: |
- DEPLOY_SCENARIO=os-odl-{os_version}_upstream-noha
+ DEPLOY_SCENARIO=os-odl-{os_scenario}-noha
OPNFV_CLEAN=yes
GERRIT_BRANCH=$GERRIT_BRANCH
GERRIT_REFSPEC=$GERRIT_REFSPEC
GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
- PROMOTE=True
- node-parameters: true
- kill-phase-on: FAILURE
- abort-all-job: true
- git-revision: false
- - multijob:
- name: functest-smoke
- condition: SUCCESSFUL
- projects:
- - name: 'functest-apex-virtual-suite-{stream}'
- current-parameters: false
- predefined-parameters: |
- DEPLOY_SCENARIO=os-odl-{os_version}_upstream-noha
FUNCTEST_SUITE_NAME=tempest_smoke_serial
- GERRIT_BRANCH=$GERRIT_BRANCH
- GERRIT_REFSPEC=$GERRIT_REFSPEC
- GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
- GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
+ FUNCTEST_MODE=testcase
node-parameters: true
kill-phase-on: FAILURE
abort-all-job: true
- git-revision: false
+ git-revision: true
- multijob:
name: create snapshot
condition: SUCCESSFUL
name: Baremetal Deploy and Test Phase
condition: SUCCESSFUL
projects:
- - name: 'apex-os-odl-master_upstream-noha-baremetal-master'
+ - name: 'apex-os-odl-nofeature-noha-baremetal-master'
+ node-parameters: false
+ current-parameters: false
+ predefined-parameters: |
+ OPNFV_CLEAN=yes
+ kill-phase-on: NEVER
+ abort-all-job: true
+ git-revision: false
+ - name: 'apex-os-odl-nofeature-ha-baremetal-master'
+ node-parameters: false
+ current-parameters: false
+ predefined-parameters: |
+ OPNFV_CLEAN=yes
+ kill-phase-on: NEVER
+ abort-all-job: true
+ git-revision: false
+ - name: 'apex-os-odl-queens-noha-baremetal-master'
node-parameters: false
current-parameters: false
predefined-parameters: |
kill-phase-on: NEVER
abort-all-job: true
git-revision: false
- - name: 'apex-os-odl-queens_upstream-noha-baremetal-master'
+ - name: 'apex-os-odl-queens-ha-baremetal-master'
node-parameters: false
current-parameters: false
predefined-parameters: |
- 'apex-virtual-{stream}'
- 'apex-deploy-{platform}-{stream}'
- 'apex-daily-{stream}'
- - 'apex-csit-promote-daily-{stream}'
+ - 'apex-csit-promote-daily-{stream}-{os_version}'
- 'apex-fdio-promote-daily-{stream}'
- 'apex-{scenario}-baremetal-{scenario_stream}'
- 'apex-testsuite-{scenario}-baremetal-{scenario_stream}'
build-slave: 'apex-build-master'
virtual-slave: 'apex-virtual-master'
baremetal-slave: 'apex-baremetal-master'
- verify-scenario: 'os-odl-nofeature-ha'
+ verify-scenario: 'os-nosdn-nofeature-ha'
scenario_stream: 'master'
disable_daily: false
disable_promote: false
build-slave: 'apex-build-master'
virtual-slave: 'apex-virtual-master'
baremetal-slave: 'apex-baremetal-master'
- verify-scenario: 'os-odl-nofeature-ha'
+ verify-scenario: 'os-nosdn-nofeature-ha'
scenario_stream: 'fraser'
disable_daily: false
disable_promote: true
- 'virtual'
os_version:
- - 'pike'
- - 'queens'
- - 'master'
+ - 'pike':
+ os_scenario: 'pike'
+ - 'queens':
+ os_scenario: 'queens'
+ - 'master':
+ os_scenario: 'nofeature'
# Fetch Logs Job
parameters:
- '{project}-defaults'
- '{project}-virtual-{stream}-defaults'
+ - 'functest-suite-parameter'
- project-parameter:
project: '{project}'
branch: '{branch}'
block-level: 'NODE'
blocking-jobs:
- 'apex-runner.*'
- - 'apex-.*-promote.*'
- 'apex-run.*'
- 'apex-virtual-.*'
- 'apex-verify-gate-.*'
GERRIT_REFSPEC=$GERRIT_REFSPEC
GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
+ PROMOTE=$PROMOTE
node-parameters: true
kill-phase-on: FAILURE
abort-all-job: true
current-parameters: false
predefined-parameters: |
DEPLOY_SCENARIO=$DEPLOY_SCENARIO
- FUNCTEST_SUITE_NAME=healthcheck
+ FUNCTEST_MODE=$FUNCTEST_MODE
+ FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
GERRIT_BRANCH=$GERRIT_BRANCH
GERRIT_REFSPEC=$GERRIT_REFSPEC
GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
blocking-jobs:
- 'apex-verify.*'
- 'apex-runner.*'
- - 'apex-.*-promote.*'
- 'apex-run.*'
- 'apex-testsuite-.+-baremetal-.+'
- throttle:
# CSIT promote
- job-template:
- name: 'apex-csit-promote-daily-{stream}'
+ name: 'apex-csit-promote-daily-{stream}-{os_version}'
# Job template for promoting CSIT Snapshots
#
branch: '{branch}'
- apex-parameter:
gs-pathname: '{gs-pathname}'
+ - string:
+ name: ARTIFACT_VERSION
+ default: dev
+ description: "Used for overriding the ARTIFACT_VERSION"
+ - string:
+ name: PROMOTE
+ default: 'True'
+ description: "Used for overriding the PROMOTE"
properties:
- build-blocker:
block-level: 'NODE'
blocking-jobs:
- 'apex-verify.*'
- - 'apex-deploy.*'
- 'apex-runner.*'
- 'apex-daily.*'
builders:
- multijob:
- name: deploy-virtual
+ name: apex-virtual-deploy-test
condition: SUCCESSFUL
projects:
- - name: 'apex-deploy-virtual-{stream}'
- current-parameters: false
+ - name: 'apex-virtual-{stream}'
+ current-parameters: true
predefined-parameters: |
- DEPLOY_SCENARIO=os-odl-{os_version}_upstream-noha
+ DEPLOY_SCENARIO=os-odl-{os_scenario}-noha
OPNFV_CLEAN=yes
GERRIT_BRANCH=$GERRIT_BRANCH
GERRIT_REFSPEC=$GERRIT_REFSPEC
GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
- PROMOTE=True
- node-parameters: true
- kill-phase-on: FAILURE
- abort-all-job: true
- git-revision: false
- - multijob:
- name: functest-smoke
- condition: SUCCESSFUL
- projects:
- - name: 'functest-apex-virtual-suite-{stream}'
- current-parameters: false
- predefined-parameters: |
- DEPLOY_SCENARIO=os-odl-{os_version}_upstream-noha
FUNCTEST_SUITE_NAME=tempest_smoke_serial
- GERRIT_BRANCH=$GERRIT_BRANCH
- GERRIT_REFSPEC=$GERRIT_REFSPEC
- GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
- GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
+ FUNCTEST_MODE=testcase
node-parameters: true
kill-phase-on: FAILURE
abort-all-job: true
- git-revision: false
+ git-revision: true
- multijob:
name: create snapshot
condition: SUCCESSFUL
master:
- 'os-odl-nofeature-noha'
+ - 'os-odl-nofeature-ha'
- 'os-odl-queens-noha'
+ - 'os-odl-queens-ha'
fraser:
- 'os-nosdn-nofeature-noha'
- 'os-nosdn-nofeature-ha'
same-node: true
block: true
- trigger-builds:
- - project: 'functest-{installer}-{pod}-arm-daily-{stream}'
+ - project: 'functest-{installer}-{pod}-daily-{stream}'
current-parameters: false
predefined-parameters:
DEPLOY_SCENARIO={scenario}
- 'doctor-parameter':
docker-tag: '{docker-tag}'
scenario: '{scenario}'
- - 'doctor-functest-parameter'
+ - 'doctor-functest-parameter':
+ gs-pathname: '{gs-pathname}'
+ inspector: '{inspector}'
scm:
- git-scm-gerrit
builders:
auto-trigger-name: 'fuel-{scenario}-{pod}-daily-{stream}-trigger'
- 'os-ovn-nofeature-noha':
auto-trigger-name: 'fuel-{scenario}-{pod}-daily-{stream}-trigger'
+ - 'os-odl-ovs-noha':
+ auto-trigger-name: 'fuel-{scenario}-{pod}-daily-{stream}-trigger'
- 'os-nosdn-kvm-noha':
auto-trigger-name: 'fuel-{scenario}-{pod}-daily-{stream}-trigger'
- 'os-nosdn-ovs-noha':
stream: danube
- scenario: os-ovn-nofeature-ha
stream: danube
+ - scenario: os-odl-ovs-noha
+ stream: fraser
jobs:
- 'fuel-{scenario}-{pod}-daily-{stream}'
name: 'fuel-os-ovn-nofeature-noha-baremetal-daily-master-trigger'
triggers:
- timed: ''
+- trigger:
+ name: 'fuel-os-odl-ovs-noha-baremetal-daily-master-trigger'
+ triggers:
+ - timed: ''
- trigger:
name: 'fuel-os-nosdn-kvm-noha-baremetal-daily-master-trigger'
triggers:
name: 'fuel-os-ovn-nofeature-noha-virtual-daily-master-trigger'
triggers:
- timed: '5 23 * * *'
+- trigger:
+ name: 'fuel-os-odl-ovs-noha-virtual-daily-master-trigger'
+ triggers:
+ - timed: '5 2 * * *'
- trigger:
name: 'fuel-os-nosdn-kvm-noha-virtual-daily-master-trigger'
triggers:
name: 'fuel-os-ovn-nofeature-noha-zte-pod1-daily-master-trigger'
triggers:
- timed: ''
+- trigger:
+ name: 'fuel-os-odl-ovs-noha-zte-pod1-daily-master-trigger'
+ triggers:
+ - timed: ''
- trigger:
name: 'fuel-os-nosdn-kvm-noha-zte-pod1-daily-master-trigger'
triggers:
- 'suite':
job-timeout: 60
- 'daily':
- job-timeout: 360
- - 'arm-daily':
job-timeout: 480
jobs:
default: 'daily'
description: "Daily suite name to run"
-- parameter:
- name: functest-arm-daily-parameter
- parameters:
- - string:
- name: FUNCTEST_MODE
- default: 'arm-daily'
- description: "Daily suite name (Aarch64) to run"
-
- parameter:
name: functest-suite-parameter
parameters:
- 'functest-store-results'
- 'functest-exit'
-- builder:
- name: functest-arm-daily-builder
- builders:
- - 'functest-cleanup'
- - 'functest-arm-daily'
- - 'functest-store-results'
- - 'functest-exit'
-
- builder:
name: functest-suite-builder
builders:
- ../../utils/fetch_k8_conf.sh
- ./functest-k8.sh
-# yamllint enable rule:indentation
-- builder:
- name: functest-arm-daily
- builders:
- # yamllint disable rule:indentation
- - shell:
- !include-raw:
- - ./functest-env-presetup.sh
- - ../../utils/fetch_os_creds.sh
- - ./functest-alpine.sh
-
# yamllint enable rule:indentation
- builder:
name: functest-store-results
arch_tag:
- 'amd64':
slave_label: 'opnfv-build-ubuntu'
+ docker_file: 'Dockerfile'
+ - 'arm64':
+ slave_label: 'opnfv-build-ubuntu-arm'
+ docker_file: 'Dockerfile-arm64'
# yamllint disable rule:key-duplicates
image:
kill-phase-on: FAILURE
abort-all-jobs: false
+ manifest-job-settings: &manifest-job-settings
+ current-parameters: false
+ git-revision: true
+ node-parameters: false
+ predefined-parameters:
+ GERRIT_REFNAME=$GERRIT_REFNAME
+ kill-phase-on: FAILURE
+ abort-all-jobs: false
+
# yamllint enable rule:key-duplicates
jobs:
- "compass-docker-{stream}"
- "compass-{image}-build-{arch_tag}-{stream}"
+ - "compass-{image}-manifest-{stream}"
########################
# job templates
project: '{project}'
branch: '{branch}'
slave_label: 'opnfv-build-ubuntu'
+ docker_file: 'Dockerfile'
arch_tag: 'amd64'
properties:
projects:
- name: 'compass-tasks-base-build-amd64-{stream}'
<<: *build-job-settings
+ - name: 'compass-tasks-base-build-arm64-{stream}'
+ <<: *build-job-settings
+ - multijob:
+ name: 'publish compass-tasks-base manifests'
+ execution-type: PARALLEL
+ projects:
+ - name: 'compass-tasks-base-manifest-{stream}'
+ <<: *manifest-job-settings
- multijob:
name: 'build all compass images'
condition: SUCCESSFUL
<<: *build-job-settings
- name: 'compass-tasks-osa-build-amd64-{stream}'
<<: *build-job-settings
+ - name: 'compass-cobbler-build-arm64-{stream}'
+ <<: *build-job-settings
+ - name: 'compass-db-build-arm64-{stream}'
+ <<: *build-job-settings
+ - name: 'compass-deck-build-arm64-{stream}'
+ <<: *build-job-settings
+ - name: 'compass-tasks-build-arm64-{stream}'
+ <<: *build-job-settings
+ - name: 'compass-tasks-k8s-build-arm64-{stream}'
+ <<: *build-job-settings
+ - name: 'compass-tasks-osa-build-arm64-{stream}'
+ <<: *build-job-settings
+ - multijob:
+ name: 'publish all manifests'
+ execution-type: PARALLEL
+ projects:
+ - name: 'compass-cobbler-manifest-{stream}'
+ <<: *manifest-job-settings
+ - name: 'compass-db-manifest-{stream}'
+ <<: *manifest-job-settings
+ - name: 'compass-deck-manifest-{stream}'
+ <<: *manifest-job-settings
+ - name: 'compass-tasks-manifest-{stream}'
+ <<: *manifest-job-settings
+ - name: 'compass-tasks-k8s-manifest-{stream}'
+ <<: *manifest-job-settings
+ - name: 'compass-tasks-osa-manifest-{stream}'
+ <<: *manifest-job-settings
publishers:
- 'compass-amd64-recipients'
+ - 'compass-arm64-recipients'
- job-template:
name: 'compass-{image}-build-{arch_tag}-{stream}'
project: '{project}'
branch: '{branch}'
slave_label: '{slave_label}'
+ docker_file: '{docker_file}'
arch_tag: '{arch_tag}'
- string:
name: DOCKER_REPO_NAME
- shell:
!include-raw-escape: ./opnfv-docker.sh
+- job-template:
+ name: 'compass-{image}-manifest-{stream}'
+ disabled: '{obj:disabled}'
+ parameters:
+ - compass-job-parameters:
+ project: '{project}'
+ branch: '{branch}'
+ slave_label: 'opnfv-build-ubuntu'
+ docker_file: 'Dockerfile'
+ arch_tag: 'amd64'
+ builders:
+ - shell: |
+ #!/bin/bash -ex
+ case "{stream}" in
+ "master")
+ tag="latest" ;;
+ *)
+ tag="{stream}" ;;
+ esac
+ sudo manifest-tool push from-args \
+ --platforms linux/amd64,linux/arm64 \
+ --template opnfv/compass-{image}:ARCH-$tag \
+ --target opnfv/compass-{image}:$tag
+ exit $?
+
# parameter macro
- parameter:
name: compass-job-parameters
description: "Docker tag to be built, e.g. refs/tags/5.0.0, refs/tags/opnfv-5.0.0, refs/tags/5.0.RC1"
- string:
name: DOCKERFILE
- default: "Dockerfile"
+ default: '{docker_file}'
description: "Dockerfile to use for creating the image."
- string:
name: ARCH_TAG
- default: ""
+ default: "{arch_tag}"
description: "If set, this value will be added to the docker image tag as a prefix"
- string:
name: PROJECT
huangxiangyui5@huawei.com
xueyifei@huawei.com
wutianwei1@huawei.com
+
+- publisher:
+ name: 'compass-arm64-recipients'
+ publishers:
+ - email:
+ recipients: >
+ yibo.cai@arm.com
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-set -xe
+set -e -o pipefail
+echo "---> Create virtualenv"
-# Activate virtualenv, supressing shellcheck warning
-# shellcheck source=/dev/null
-. $WORKSPACE/venv/bin/activate
+sudo pip install virtualenv
+virtualenv $WORKSPACE/venv
+# shellcheck source=$WORKSPACE/venv/bin/activate disable=SC1091
+source $WORKSPACE/venv/bin/activate
+pip install --upgrade pip
pip install -r releases/scripts/requirements.txt
-
-STREAM=${STREAM:-'nostream'}
-RELEASE_FILES=$(git diff HEAD^1 --name-only -- "releases/$STREAM")
-
-# TODO: The create_branch.py should be refactored so it can be used here
-# to verify the commit exists that is being added, along with
-# jjb/<project>
-for release_file in $RELEASE_FILES; do
- python releases/scripts/verify_schema.py \
- -s releases/schema.yaml \
- -y $release_file
-done
- project:
name: releng-release-jobs
+ build-node: 'opnfv-build'
+
stream:
- fraser
name: 'releng-release-{stream}-verify'
parameters:
+ - '{build-node}-defaults'
- stream-parameter:
stream: '{stream}'
- project-parameter:
pattern: 'releases/scripts/verify_schema.py'
builders:
- - create-virtualenv
- - shell:
- !include-raw-escape: releng-release-verify.sh
+ - shell: !include-raw-escape:
+ - releng-release-create-venv.sh
+ - releng-release-tagging.sh
publishers:
- email-jenkins-admins-on-failure
- project-parameter:
project: '{project}'
branch: 'master'
+ # Override GIT_BASE so we can send patches back to Gerrit and
+ # modify repos
+ - string:
+ name: GIT_BASE
+ default: ssh://$USER@gerrit.opnfv.org:29418/$PROJECT
+ description: 'Git URL to use on this Jenkins Slave'
scm:
- git-scm-gerrit
files: 'releases/{stream}/*'
builders:
- - create-virtualenv
- - shell:
- !include-raw-escape: releng-release-create-branch.sh
+ - shell: !include-raw-escape:
+ - releng-release-create-venv.sh
+ - releng-release-tagging.sh
+ # - releng-release-create-branch.sh
publishers:
- email-jenkins-admins-on-failure
name: STREAM
default: '{stream}'
description: "OPNFV Stable Stream"
-
-- builder:
- name: create-virtualenv
- builders:
- - shell: |
- #!/bin/bash
- sudo pip install virtualenv
- virtualenv $WORKSPACE/venv
- . $WORKSPACE/venv/bin/activate
- pip install --upgrade pip
--- /dev/null
+#!/bin/bash
+# SPDX-License-Identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2018 The Linux Foundation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+set -e -o pipefail
+
+GIT_URL=${GIT_URL:-https://gerrit.opnfv.org/gerrit}
+STREAM=${STREAM:-'nostream'}
+RELEASE_FILES=$(git diff HEAD^1 --name-only -- "releases/$STREAM")
+
+echo "--> Verifying $RELEASE_FILES."
+for release_file in $RELEASE_FILES; do
+ # Verify the release file schema
+ python releases/scripts/verify_schema.py \
+ -s releases/schema.yaml \
+ -y $release_file
+
+ # Verify tag for each repo exist and are attached to commits on stable-branch
+ while read -r repo tag ref
+ do
+ echo "--> Cloning $repo"
+ if [ ! -d $repo ]; then
+ git clone $GIT_URL/$repo.git $repo
+ fi
+ pushd $repo &> /dev/null
+
+ echo "--> Checking for tag: $tag"
+ if ! (git tag -l | grep $tag &> /dev/null); then
+ echo "$tag does not exist"
+ TAG_EXISTS=false
+ else
+ git cat-file tag $tag
+ TAG_EXISTS=true
+ fi
+
+ echo "--> Checking if $ref is on stable/$STREAM"
+ if ! (git branch -a --contains $ref | grep "stable/$STREAM"); then
+ echo "--> ERROR: $ref for $repo is not on stable/$STREAM!"
+ # If the tag exists but is on the wrong ref, there's nothing
+ # we can do. But if the tag neither exists nor is on the
+ # correct branch we need to fail the verification.
+ if [ $TAG_EXISTS = false ]; then
+ exit 1
+ fi
+ else
+ if [[ $TAG_EXISTS = false && "$JOB_NAME" =~ "merge" ]]; then
+ # If the tag doesn't exist and we're in a merge job,
+ # everything has been verified up to this point and we
+ # are ready to create the tag.
+ git config --global user.name "jenkins-ci"
+ git config --global user.email "jenkins-opnfv-ci@opnfv.org"
+ echo "--> Creating $tag tag for $repo at $ref"
+ git tag -am "$tag" $tag $ref
+ echo "--> Pushing tag"
+ echo "[noop] git push origin $tag"
+ else
+ # For non-merge jobs just output the ref info.
+ git show -s --format="%h %s %d" $ref
+ fi
+ fi
+
+ popd &> /dev/null
+ echo "--> Done verifing $repo"
+ done < <(python releases/scripts/repos.py -f $release_file)
+done
- version: opnfv-6.0.0
location:
apex-os-net-config: e09d110d7b58d26424c28a128cdfd8c766636461
+ - version: opnfv-6.1.0
+ location:
+ apex: a1f2e922d18430e064c9c8311f01ac2a0df19414
+ - version: opnfv-6.1.0
+ location:
+ apex-tripleo-heat-templates: 7f1cc97bcd6f267b11a251de3204edf0e8ec79c0
+ - version: opnfv-6.1.0
+ location:
+ apex-puppet-tripleo: bebd15efe40498c272577c563bc113ec3849dcc6
+ - version: opnfv-6.1.0
+ location:
+ apex-os-net-config: e09d110d7b58d26424c28a128cdfd8c766636461
branches:
- name: stable/fraser
- version: opnfv-6.0.0
location:
armband: 2b0ac4026a3acf3b10ab2f4c416636d80ab559f0
+ - version: opnfv-6.1.0
+ location:
+ armband: 0de669e26d14794ab117e915abaa6bf6b1dd878d
branches:
- name: stable/fraser
location:
auto: 3a957a75f99686767d13f45d74b5ca8463559b7b
+ - version: opnfv-6.1.0
+ location:
+ auto: b718a43380376d2b19222c4203c97a95ca849ae8
+
+ - version: opnfv-6.1.1
+ location:
+ auto: 0f43563624832c5908e6fc00eb0a4bbc6cc82c33
+
branches:
- name: stable/fraser
location:
location:
availability: c1ee3631b59009ff61450808e2bd33fe1d4b17f2
+ - version: opnfv-6.1.0
+ location:
+ availability: c1ee3631b59009ff61450808e2bd33fe1d4b17f2
+
branches:
- name: stable/fraser
location:
location:
barometer: 70a568ed8eed6f1a336f1fbe9bbc6900422e0c11
+ - version: opnfv-6.1.0
+ location:
+ barometer: 70a568ed8eed6f1a336f1fbe9bbc6900422e0c11
+
branches:
- name: stable/fraser
location:
- version: opnfv-6.0.0
location:
bottlenecks: d76736440f852baed2e10a9b92c0557aabc041a6
+ - version: opnfv-6.1.0
+ location:
+ bottlenecks: d76736440f852baed2e10a9b92c0557aabc041a6
branches:
- name: stable/fraser
project-type: tools
release-model: stable
+releases:
+ - version: opnfv-6.1.0
+ location:
+ calipso: 5c821a4d1462f3b0131f37995f40fc77a53468e6
+
branches:
- name: stable/fraser
location:
- version: opnfv-6.0.1
location:
clover: be5f20bbe91f1ae3138a1e338eea5b45e89bda82
+ - version: opnfv-6.1.0
+ location:
+ clover: 596a3573b2622a5d314349592088b6b737f5e126
branches:
- name: stable/fraser
release-model: stable
releases:
+ - version: opnfv-6.1.0
+ location:
+ compass4nfv: 499d95cdea092ea9eb76a939b6ea832601d41b7f
+ - version: opnfv-6.1.0
+ location:
+ compass-containers: 15a7cbc925bed896c3c09a5635454c33dbffbadc
+
- version: opnfv-6.0.0
location:
compass4nfv: ab73374e424a679cc42b9812e6bd39a49fcea07d
- version: opnfv-6.0.0
location:
container4nfv: 38d0ffe507a137167ffdbac860de5c1a738e81a8
+ - version: opnfv-6.1.0
+ location:
+ container4nfv: 38d0ffe507a137167ffdbac860de5c1a738e81a8
branches:
- name: stable/fraser
location:
doctor: cd500723c3b2de3655b2dc56ea9647f358183264
+ - version: opnfv-6.1.0
+ location:
+ doctor: c91aa72e7df34ec3416be3c9f73f7484a91312fb
+
branches:
- name: stable/fraser
location:
project-type: feature
release-model: stable
+releases:
+ - version: opnfv-6.1.0
+ location:
+ fds: 6eb4ed8ce9be7135ec65318b7b833f3c487498be
+
branches:
- name: stable/fraser
location:
- version: opnfv-6.0.0
location:
fuel: d45841926790df8313912697d31753c120e2c4aa
+ - version: opnfv-6.1.0
+ location:
+ fuel: e29220a401a5ad0607453d6a82de9b61d1c02aca
branches:
- name: stable/fraser
- version: opnfv-6.0.0
location:
functest-kubernetes: 770bd295031af2e12da3472b9ed2763bfdc4deaf
+ - version: opnfv-6.1.0
+ location:
+ functest: 7be15936ba4fd0f624200ae6b587081ab292077c
+ - version: opnfv-6.1.0
+ location:
+ functest-kubernetes: c3e48ccef64acc6ba31823e1c8d6138eebbffb8c
branches:
- name: stable/fraser
- version: opnfv-6.0.0
location:
ipv6: 5b914695088b39aee3886bd60be4707b7a11a1e8
+ - version: opnfv-6.1.0
+ location:
+ ipv6: 5c8ce8ff16e9dee430357cb60d1eba5a8d1961b7
branches:
- name: stable/fraser
location:
ipv6: 809dba7f52ff1571a760a01376530de23c5d97c9
+
+release-notes: http://docs.opnfv.org/en/stable-fraser/submodules/ipv6/docs/release/release-notes/release-notes.html
location:
joid: 266a4fd08bef19fca930cbbb1d45f5639b87d3c0
+ - version: opnfv-6.1.0
+ location:
+ joid: ff656d6b0fa60241c76709a41c023b76ba4def8f
+
branches:
- name: stable/fraser
location:
- version: opnfv-6.0.0
location:
nfvbench: c8402089ad8686a16ad08ce6c6e16a14c3144d64
+ - version: opnfv-6.1.0
+ location:
+ nfvbench: c8402089ad8686a16ad08ce6c6e16a14c3144d64
branches:
- name: stable/fraser
- version: opnfv-6.0.0
location:
opnfvdocs: 49538d56771c45d8d437ab00abaa1b52f97ac931
+ - version: opnfv-6.1.0
+ location:
+ opnfvdocs: 98570eb59bb4abda67cea7a22feec45eebc4bec2
branches:
- name: stable/fraser
- version: opnfv-6.0.0
location:
ovn4nfv: 651acb603c2f4523905e4fe5134fd8a7940e1f3d
+ - version: opnfv-6.1.0
+ location:
+ ovn4nfv: 651acb603c2f4523905e4fe5134fd8a7940e1f3d
branches:
- name: stable/fraser
- version: opnfv-6.0.0
location:
samplevnf: 4685c59ec97927af559b4bf10001d0e07de34702
+ - version: opnfv-6.1.0
+ location:
+ samplevnf: 95e9ab89f6d8f9911a9fdb625e8721f3d2e20b1a
branches:
- name: stable/fraser
- version: opnfv-6.0.0
location:
sdnvpn: be6cce375c0363f93fa6b1a099eb34fee75a6161
+ - version: opnfv-6.1.0
+ location:
+ sdnvpn: be6cce375c0363f93fa6b1a099eb34fee75a6161
branches:
- name: stable/fraser
- version: opnfv-6.0.0
location:
sfc: 084446656bf2794a11de56b782f589af1f703487
+ - version: opnfv-6.1.0
+ location:
+ sfc: 7f8a775dec72e03d6cae2400b7a49d7a097c8957
+
branches:
- name: stable/fraser
- version: opnfv-6.0.0
location:
snaps: 4edc3d87392cf78c3f046217543fb76380413306
+ - version: opnfv-6.1.0
+ location:
+ snaps: 4edc3d87392cf78c3f046217543fb76380413306
branches:
- name: stable/fraser
- version: opnfv-6.0.0
location:
stor4nfv: fcedde93eb366867ed428d362e2cb8a6b7f28b3c
+ - version: opnfv-6.1.0
+ location:
+ stor4nfv: 3f654aa9b1e19eb9d84b0632a5bc1e7bde96c281
branches:
- name: stable/fraser
- version: opnfv-6.0.0
location:
storperf: 2f8c1546ee5d79f9b4c46e960a74930cfe0fe50e
+ - version: opnfv-6.1.0
+ location:
+ storperf: 8962423227e13f45ef9f7dfbf48ed4847d3f3865
branches:
- name: stable/fraser
- version: opnfv-6.0.0
location:
vswitchperf: 998842df061caf3f90adf756c78667262525a6e0
+ - version: opnfv-6.1.0
+ location:
+ vswitchperf: 998842df061caf3f90adf756c78667262525a6e0
branches:
- name: stable/fraser
- version: opnfv-6.0.0
location:
yardstick: a4c8f2a99f56dd4c9fbac4021706aa9186d23ed8
+ - version: opnfv-6.1.0
+ location:
+ yardstick: 7dc30d54a77249d95d2a89770393cee98ff63c8c
branches:
- name: stable/fraser
--- /dev/null
+#!/bin/bash
+# SPDX-License-Identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2018 The Linux Foundation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+set -o pipefail
+
+TAG="${TAG:-opnfv-6.0.0}"
+RELEASE="${RELEASE:-fraser}"
+
+for project in releases/$RELEASE/*; do
+ python releases/scripts/repos.py -n -f $project >> repos.txt
+done
+
+while read -r repo
+do
+ tag="$(git ls-remote "https://gerrit.opnfv.org/gerrit/$repo.git" "refs/tags/$TAG")"
+ echo "$repo $tag"
+done < repos.txt
+
+# rm repos.txt
--- /dev/null
+#!/usr/bin/env python2
+# SPDX-License-Identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2018 The Linux Foundation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+"""
+List Release Repos
+"""
+
+import argparse
+import yaml
+
+
+def main():
+ """Given a release yamlfile list the repos it contains"""
+
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--file', '-f',
+ type=argparse.FileType('r'),
+ required=True)
+ parser.add_argument('--names', '-n',
+ action='store_true',
+ default=False,
+ help="Only print the names of repos, "
+ "not their SHAs")
+ parser.add_argument('--release', '-r',
+ type=str,
+ help="Only print"
+ "SHAs for the specified release")
+ args = parser.parse_args()
+
+ project = yaml.safe_load(args.file)
+
+ list_repos(project, args)
+
+
+def list_repos(project, args):
+ """List repositories in the project file"""
+
+ lookup = project.get('releases', [])
+ if 'releases' not in project:
+ exit(0)
+
+ for item in lookup:
+ repo, ref = next(iter(item['location'].items()))
+ if args.names:
+ print(repo)
+ elif args.release and item['version'] == args.release:
+ print("%s %s" % (repo, ref))
+ elif not args.release:
+ # Print all releases
+ print("%s %s %s" % (repo, item['version'], ref))
+
+
+if __name__ == "__main__":
+ main()