submodule-disable: true
submodule-recursive: false
submodule-timeout: 10
- choosing-strategy: default
+ choosing-strategy: gerrit
triggers:
- gerrit:
submodule-disable: true
submodule-recursive: false
submodule-timeout: 10
- choosing-strategy: default
+ choosing-strategy: gerrit
triggers:
- gerrit:
submodule-timeout: 10
submodule-disable: false
wss-unified-agent-opts: ""
- wss-unified-agent-version: 19.8.1
+ wss-unified-agent-version: 19.12.2
gerrit_trigger_file_paths:
- compare-type: ANT
--- /dev/null
+---
+fixes:
+ - |
+ Call "lftools jenkins" after credentials are set to fix failures due to the
+ call being made without credentials being set first. The previous method
+ did not require credentials, so the failure was introduced when we switched
+ to using lftools. The os_plugin_version variable is not needed before the
+ JENKINS_USER and JENKINS_PASSWORD are set, so no other changes
+ are necessary.
--- /dev/null
+---
+fixes:
+ - |
+ A recent change has made the "null" string a bad value for FLOATING_IP_POOL.
+ By making it an empty string, we recreate the old functionality of having
+ the default floating IP pool set to "No value".
--- /dev/null
+---
+fixes:
+ - |
+ Extend shell scripts that invoke pip freeze to show
+ python and pip versions also
--- /dev/null
+---
+fixes:
+ - |
+ Extend release-job.sh to detect if distribution_type is missing
+ from the release yaml file and show a meaningful error. The
+ shell option pipefile causes the script to halt silently if
+ niet fails to find that key, which utterly baffles users.
--- /dev/null
+---
+fixes:
+ - |
+ Use choosing strategy Gerrit Trigger in container/jar and
+ package cloud release merge jobs. This retains the current
+ behavior in the simple merge case, and ensures that a job
+ triggered by a "remerge" comment uses the release file at
+ that commit. The previous choosing strategy, default, uses
+ the tip of the target branch. That does not allow recovery
+ from merge job failure if the target branch has advanced past
+ the commit with the release file.
set -eu -o pipefail
-os_plugin_version="$(lftools jenkins plugins list \
- | grep -i 'OpenStack Cloud Plugin')"
-
testversion() {
local current_val="$1" operator="$2" test_value="$3"
awk -vv1="$current_val" -vv2="$test_value" 'BEGIN {
instance_cap=$(get_cfg "$cfg_file" INSTANCE_CAP "null")
fi
- floating_ip_pool=$(get_cfg "$cfg_file" FLOATING_IP_POOL "null")
+ floating_ip_pool=$(get_cfg "$cfg_file" FLOATING_IP_POOL "")
security_groups=$(get_cfg "$cfg_file" SECURITY_GROUPS "default")
availability_zone=$(get_cfg "$cfg_file" AVAILABILITY_ZONE "")
start_timeout=$(get_cfg "$cfg_file" START_TIMEOUT "600000")
export JENKINS_USER
export JENKINS_PASSWORD
+ # JENKINS_{URL,USER,PASSWORD} env vars are required for the "lftools jenkins
+ # plugins list" call
+ os_plugin_version="$(lftools jenkins plugins list \
+ | grep -i 'OpenStack Cloud Plugin')"
+
echo "-----> Groovy script $script_file"
for cloud in "${clouds[@]}"; do
cfg_dir="${cloud}"
source "$JJB_VENV/bin/activate"
python -m pip install --quiet --upgrade "jenkins-job-builder==$JJB_VERSION"
-echo "----> pip freeze"
+# installs are silent, show version details in log
+python --version
+pip --version
pip freeze
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
##############################################################################
-echo "---> build-cost.sh"
+echo "---> job-cost.sh"
set -euf -o pipefail
# shellcheck disable=SC1090
source ~/lf-env.sh
+# AWS job cost not supported, exit
+if grep -qi amazon /sys/devices/virtual/dmi/id/bios_vendor ; then
+ echo "INFO: Not able to calculate job cost on AWS"
+ exit 0
+fi
+
lf-activate-venv python-openstackclient
if [[ -z ${JOB_NAME:-} ]]; then
# Convert to integer by truncating fractional part' and round up by one
((uptime=${uptime%\.*}+1))
+# EC2 and OpenStack have simiar instace metadata APIs at this IP
+# AWS docs: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
+# Nova docs: https://docs.openstack.org/nova/latest/user/metadata.html
instance_type=$(curl -s http://169.254.169.254/latest/meta-data/instance-type)
echo "INFO: Retrieving Pricing Info for: $instance_type"
url="https://pricing.vexxhost.net/v1/pricing/$instance_type/cost?seconds=$uptime"
json_block=$(curl -s "$url")
-cost=$(jq .cost <<< "$json_block")
-resource=$(jq .resource <<< "$json_block" | tr -d '"')
+# check if JSON returned and can be parsed
+if jq <<< "$json_block"; then
+ cost=$(jq .cost <<< "$json_block")
+ resource=$(jq .resource <<< "$json_block" | tr -d '"')
+else
+ echo "ERROR: Pricing API returned invalid json"
+ cost=0
+ resource=0
+fi
# Archive the cost date
mkdir -p "$WORKSPACE/archives/cost"
cat << EOF > "$WORKSPACE/archives/cost.csv"
$JOB_NAME,$BUILD_NUMBER,$date,$resource,$uptime,$cost,$stack_cost
EOF
-
pip install --quiet --upgrade "pip==9.0.3" setuptools
pip install --quiet --upgrade nodeenv
-echo "----> pip freeze"
+# installs are silent, show version details in log
+python --version
+pip --version
pip freeze
python3 -m pip install --user --quiet --no-warn-script-location --upgrade setuptools
python3 -m pip install --user --quiet --no-warn-script-location --upgrade --upgrade-strategy eager -r "$requirements_file"
# installs are silent, show version details in log
+ python3 --version
+ python3 -m pip --version
python3 -m pip freeze
rm -rf "$requirements_file"
touch /tmp/pre-build-complete
pipup="python -m pip install -q --upgrade pip lftools jsonschema niet twine yq"
echo "INFO: $pipup"
$pipup
+# show installed versions
+python -m pip --version
+python -m pip freeze
#Functions.
fi
# Jenkins parameter drop-down defaults DISTRIBUTION_TYPE to None
+ # in the contain/maven release job; get value from release yaml.
+ # Packagecloud and PyPI jobs set the appropriate value.
DISTRIBUTION_TYPE="${DISTRIBUTION_TYPE:-None}"
if [[ $DISTRIBUTION_TYPE == "None" ]]; then
- DISTRIBUTION_TYPE=$(niet ".distribution_type" "$release_file")
+ if ! DISTRIBUTION_TYPE=$(niet ".distribution_type" "$release_file"); then
+ echo "ERROR: Failed to get distribution_type from $release_file"
+ exit 1
+ fi
fi
PATCH_DIR=$(mktemp -d)
# Tox version is pulled in through detox to mitigate version conflict
-
if [[ $PYTHON == "python2" ]]; then
$PYTHON -m pip install --user --quiet --upgrade tox tox-pyenv virtualenv more-itertools~=5.0.0
else
$PYTHON -m pip install --user --quiet --upgrade tox tox-pyenv virtualenv
fi
-
+# installs are silent, show version details in log
+$PYTHON --version
+$PYTHON -m pip --version
$PYTHON -m pip freeze