From: Andrew Grimberg Date: Sat, 23 Jun 2018 15:02:18 +0000 (+0000) Subject: Merge "Add license check job using new lhc" X-Git-Tag: v0.22.0~18 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=772a724ae006e21b3ecdc722b04fc4e77794f788;hp=bbaf6b55269a0cb6fb129af73d82c2efd6d83bcf;p=releng%2Fglobal-jjb.git Merge "Add license check job using new lhc" --- diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index ce053483..00000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v1.3.0 - hooks: - - id: trailing-whitespace diff --git a/docs/jjb/lf-ci-jobs.rst b/docs/jjb/lf-ci-jobs.rst index d752039d..35bd2485 100644 --- a/docs/jjb/lf-ci-jobs.rst +++ b/docs/jjb/lf-ci-jobs.rst @@ -212,6 +212,7 @@ OpenStack Cloud plugin version supported: * 2.32 * 2.33 * 2.34 +* 2.35 Cloud configuration are managed via a directory structure in ci-management as follows: diff --git a/info-schema b/info-schema index c98a4708..bb596c22 100644 --- a/info-schema +++ b/info-schema @@ -13,7 +13,6 @@ $id: 'https://github.com/lfit/releng-global-jjb/blob/master/info-schema' required: - 'project' - - 'version' - 'project_creation_date' - 'project_category' - 'lifecycle_state' diff --git a/jenkins-init-scripts/README b/jenkins-init-scripts/README index 85487864..2d85978c 100644 --- a/jenkins-init-scripts/README +++ b/jenkins-init-scripts/README @@ -11,5 +11,5 @@ it to Jenkins for job use. To use this create a managed file in Jenkins with the contents: #!/bin/bash - git clone https://gerrit.example.org/r/ci-management.git /opt/ciman + git clone --recurse-submodules https://gerrit.example.org/r/ci-management.git /opt/ciman /opt/ciman/jjb/global-jjb/jenkins-init-scripts/init.sh diff --git a/jjb/lf-ci-jobs.yaml b/jjb/lf-ci-jobs.yaml index 86459411..ed6a5c5b 100644 --- a/jjb/lf-ci-jobs.yaml +++ b/jjb/lf-ci-jobs.yaml @@ -143,6 +143,10 @@ pattern: '.*\.groovy' - compare-type: REG_EXP pattern: '.*\.sh' + - compare-type: REG_EXP + pattern: '.*\.bat' + - compare-type: REG_EXP + pattern: '.*\.ps1' - compare-type: REG_EXP pattern: '.*\.(yaml|yml)' - compare-type: REG_EXP @@ -152,6 +156,8 @@ github_included_regions: - '.*\.groovy' - '.*\.sh' + - '.*\.bat' + - '.*\.ps1' - '.*\.(yaml|yml)' - '.*\/global-jjb' @@ -997,6 +1003,10 @@ file-paths: - compare-type: REG_EXP pattern: 'packer\/provision\/.*\.sh' + - compare-type: REG_EXP + pattern: 'packer\/provision\/.*\.bat' + - compare-type: REG_EXP + pattern: 'packer\/provision\/.*\.ps1' - compare-type: REG_EXP pattern: 'packer\/provision\/{templates}\.yaml' - compare-type: REG_EXP @@ -1049,6 +1059,8 @@ # included-regions MUST match Gerrit Trigger file-paths included-regions: - 'packer\/provision\/.*\.sh' + - 'packer\/provision\/.*\.bat' + - 'packer\/provision\/.*\.ps1' - 'packer\/provision\/{templates}\.yaml' - 'packer\/provision\/local-{templates}\.yaml' - 'packer\/templates\/{templates}\.json' diff --git a/jjb/lf-macros.yaml b/jjb/lf-macros.yaml index 2fbb8256..12671972 100644 --- a/jjb/lf-macros.yaml +++ b/jjb/lf-macros.yaml @@ -110,12 +110,12 @@ builders: - inject: properties-content: | - PROJECT='{project}' - GERRIT_COMMIT_MESSAGE='{gerrit-commit-message}' - GERRIT_HOST='{gerrit-host}' - GERRIT_TOPIC='{gerrit-topic}' - GERRIT_USER='{gerrit-user}' - REVIEWERS_EMAIL='{reviewers-email}' + PROJECT={project} + GERRIT_COMMIT_MESSAGE={gerrit-commit-message} + GERRIT_HOST={gerrit-host} + GERRIT_TOPIC={gerrit-topic} + GERRIT_USER={gerrit-user} + REVIEWERS_EMAIL={reviewers-email} - shell: !include-raw-escape: ../shell/gerrit-push-patch.sh - builder: diff --git a/jjb/lf-python-jobs.yaml b/jjb/lf-python-jobs.yaml index a647d9e4..e55f11c0 100644 --- a/jjb/lf-python-jobs.yaml +++ b/jjb/lf-python-jobs.yaml @@ -436,6 +436,10 @@ - lf-infra-tox-parameters: tox-dir: '{tox-dir}' tox-envs: '{tox-envs}' + - bool: + name: PARALLEL + default: '{parallel}' + description: Tox test type used to configure serial or parallel testing. wrappers: - lf-infra-wrappers: @@ -487,13 +491,6 @@ submodule-recursive: '{submodule-recursive}' choosing-strategy: gerrit - parameters: - - bool: - name: PARALLEL - default: '{parallel}' - description: Tox test type used to configure serial or parallel testing. - - triggers: - gerrit: server-name: '{gerrit-server-name}' diff --git a/shell/jenkins-configure-clouds.sh b/shell/jenkins-configure-clouds.sh index 3f7dd6a5..da0b7325 100644 --- a/shell/jenkins-configure-clouds.sh +++ b/shell/jenkins-configure-clouds.sh @@ -46,8 +46,21 @@ mkdir -p "$SCRIPT_DIR" silos="${jenkins_silos:-jenkins}" +set +x # Disable `set -x` to prevent printing passwords +echo "Configuring $silo" +JENKINS_URL=$(crudini --get "$HOME"/.config/jenkins_jobs/jenkins_jobs.ini "$silo" url) +JENKINS_USER=$(crudini --get "$HOME"/.config/jenkins_jobs/jenkins_jobs.ini "$silo" user) +JENKINS_PASSWORD=$(crudini --get "$HOME"/.config/jenkins_jobs/jenkins_jobs.ini "$silo" password) +export JENKINS_URL +export JENKINS_USER +export JENKINS_PASSWORD +OS_PLUGIN_VER="$(lftools jenkins plugins list \ + | grep 'Openstack Cloud Plugin' | awk -F':' '{print $2}')" + set -eu -o pipefail +version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; } + get_cfg() { if [ -z ${3+x} ]; then >&2 echo "Usage: get_cfg CFG_FILE SETTING DEFAULT" @@ -63,7 +76,7 @@ get_cfg() { exit 1 fi - cfg=$(grep "${setting^^}" "$cfg_file" | tail -1 | awk -F'=' '{print $2}') + cfg=$(grep "^${setting^^}=" "$cfg_file" | tail -1 | awk -F'=' '{print $2}') cfg=${cfg:-"$default"} echo "$cfg" } @@ -153,6 +166,7 @@ get_minion_options() { if [ "$silo" == "sandbox" ]; then instance_cap=$(get_cfg "$cfg_file" SANDBOX_CAP "null") fi + min_instance_cap=$(get_cfg "$cfg_file" MIN_INSTANCE_CAP "null") floating_ip_pool=$(get_cfg "$cfg_file" FLOATING_IP_POOL "") security_groups=$(get_cfg "$cfg_file" SECURITY_GROUPS "default") @@ -164,25 +178,49 @@ get_minion_options() { fs_root=$(get_cfg "$cfg_file" FS_ROOT "/w") retention_time=$(get_cfg "$cfg_file" RETENTION_TIME "0") - if [ ! -z "$volume_size" ]; then - echo " new BootSource.VolumeFromImage(\"$image_name\", $volume_size)," - else - echo " new BootSource.Image(\"$image_name\")," + if version_ge "$OS_PLUGIN_VER" "2.35"; then + if [ ! -z "$volume_size" ]; then + echo " new BootSource.VolumeFromImage(\"$image_name\", $volume_size)," + else + echo " new BootSource.Image(\"$image_name\")," + fi + echo " \"${flavors[${hardware_id}]}\"," + echo " \"$network_id\"," + echo " \"$user_data_id\"," + echo " $instance_cap," + echo " $min_instance_cap," + echo " \"$floating_ip_pool\"," + echo " \"$security_groups\"," + echo " \"$availability_zone\"," + echo " $start_timeout," + echo " \"$key_pair_name\"," + echo " $num_executors," + echo " \"$jvm_options\"," + echo " \"$fs_root\"," + echo " new LauncherFactory.SSH(\"$key_pair_name\", \"\")," + echo " $retention_time" + + else # SlaveOptions() structure for versions <= 2.34 + if [ ! -z "$volume_size" ]; then + echo " new BootSource.VolumeFromImage(\"$image_name\", $volume_size)," + else + echo " new BootSource.Image(\"$image_name\")," + fi + echo " \"${flavors[${hardware_id}]}\"," + echo " \"$network_id\"," + echo " \"$user_data_id\"," + echo " $instance_cap," + echo " \"$floating_ip_pool\"," + echo " \"$security_groups\"," + echo " \"$availability_zone\"," + echo " $start_timeout," + echo " \"$key_pair_name\"," + echo " $num_executors," + echo " \"$jvm_options\"," + echo " \"$fs_root\"," + echo " new LauncherFactory.SSH(\"$key_pair_name\", \"\")," + echo " $retention_time" fi - echo " \"${flavors[${hardware_id}]}\"," - echo " \"$network_id\"," - echo " \"$user_data_id\"," - echo " $instance_cap," - echo " \"$floating_ip_pool\"," - echo " \"$security_groups\"," - echo " \"$availability_zone\"," - echo " $start_timeout," - echo " \"$key_pair_name\"," - echo " $num_executors," - echo " \"$jvm_options\"," - echo " \"$fs_root\"," - echo " new LauncherFactory.SSH(\"$key_pair_name\", \"\")," - echo " $retention_time" } get_template_cfg() { @@ -253,13 +291,5 @@ for silo in $silos; do cat "$insert_file" >> "$script_file" done - set +x # Disable `set -x` to prevent printing passwords - echo "Configuring $silo" - JENKINS_URL=$(crudini --get "$HOME"/.config/jenkins_jobs/jenkins_jobs.ini "$silo" url) - JENKINS_USER=$(crudini --get "$HOME"/.config/jenkins_jobs/jenkins_jobs.ini "$silo" user) - JENKINS_PASSWORD=$(crudini --get "$HOME"/.config/jenkins_jobs/jenkins_jobs.ini "$silo" password) - export JENKINS_URL - export JENKINS_USER - export JENKINS_PASSWORD lftools jenkins groovy "$script_file" done diff --git a/tox.ini b/tox.ini index c5578f70..2d4d91e6 100644 --- a/tox.ini +++ b/tox.ini @@ -1,14 +1,8 @@ [tox] minversion = 1.6 -envlist = check-hooks,coala,jjb,jjb-compare-xml,license +envlist = coala,jjb,jjb-compare-xml,license skipsdist = true -[testenv:check-hooks] -deps = pre-commit -commands = - pre-commit install - pre-commit run --all-files - [testenv:coala] basepython = python3 deps =