From: Anil Belur Date: Thu, 29 Aug 2019 14:49:46 +0000 (+0000) Subject: Merge "Remove detox in favor of tox --parallel" X-Git-Tag: v0.43.0~12 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=573fe2c6a78b283ec118c988454595ccf187e850;hp=1873622e1b5bf98150db6850901d190dd6c35422;p=releng%2Fglobal-jjb.git Merge "Remove detox in favor of tox --parallel" --- diff --git a/docs/jjb/lf-c-cpp-jobs.rst b/docs/jjb/lf-c-cpp-jobs.rst index 03372c0f..2a71cb2c 100644 --- a/docs/jjb/lf-c-cpp-jobs.rst +++ b/docs/jjb/lf-c-cpp-jobs.rst @@ -42,14 +42,6 @@ to support multi-branch. :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) :install-prefix: CMAKE_INSTALL_PREFIX to use for install. (default: $BUILD_DIR/output) - - .. code-block:: bash - :caption: Example - - install-prefix: | - #!/bin/bash - echo "Hello World." - :make-opts: Parameters to pass to make. (default: '') :pre-build: Shell script to run before performing build. Useful for setting up dependencies. (default: '') @@ -96,14 +88,6 @@ project into a tar.xz tarball to produce a release candidate. :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) :install-prefix: CMAKE_INSTALL_PREFIX to use for install. (default: $BUILD_DIR/output) - - .. code-block:: bash - :caption: Example - - install-prefix: | - #!/bin/bash - echo "Hello World." - :make-opts: Parameters to pass to make. (default: '') :pre-build: Shell script to run before performing build. Useful for setting up dependencies. (default: '') @@ -162,14 +146,6 @@ Verify job which runs cmake && make && make install to test a project build.. :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) :install-prefix: CMAKE_INSTALL_PREFIX to use for install. (default: $BUILD_DIR/output) - - .. code-block:: bash - :caption: Example - - install-prefix: | - #!/bin/bash - echo "Hello World." - :make-opts: Parameters to pass to make. (default: '') :pre-build: Shell script to run before performing build. Useful for setting up dependencies. (default: '') diff --git a/docs/jjb/lf-release-jobs.rst b/docs/jjb/lf-release-jobs.rst index a2cfd955..dddaac31 100644 --- a/docs/jjb/lf-release-jobs.rst +++ b/docs/jjb/lf-release-jobs.rst @@ -8,8 +8,12 @@ Self serve release jobs allow a project to create a releases/ or .releases/ dire Jenkins will pick this up and sign the ref extrapolated by log_dir and promote the artifact, whether maven or container. Maven release jobs can also trigger via "Build with parameters" negating the need for a release file. -The parameters will need to be filled out in the same was as a release file's would, excepting the speacial -USE_RELEASE_FILE parameter which will need to be set to False to inform the job that it should not expect a release file. +The parameters will need to be filled out in the same was as a release file's would, excepting the special +USE_RELEASE_FILE and DRY_RUN check boxes. The USE_RELEASE_FILE check box will need to be unchecked, if the job +is expected to run with a release file, while passing the required information as build parameters. +Similarly, the DRY_RUN check box will need to be unchecked, if the job needs to be tested while skipping +repository promotion to Nexus. + The Special Parameters are as follows: GERRIT_BRANCH = master @@ -17,6 +21,7 @@ VERSION = 1.0.0 LOG_DIR = example-project-maven-stage-master/17/ DISTRIBUTION_TYPE = maven USE_RELEASE_FILE = false +DRY_RUN = false .. note:: diff --git a/jjb/lf-release-jobs.yaml b/jjb/lf-release-jobs.yaml index 200b14b5..fbef3fae 100644 --- a/jjb/lf-release-jobs.yaml +++ b/jjb/lf-release-jobs.yaml @@ -25,14 +25,6 @@ - lf-infra-properties: build-days-to-keep: 7 - parameters: - - lf-infra-parameters: - project: "{project}" - branch: "$GERRIT_BRANCH" - stream: "$GERRIT_BRANCH" - - lf-build-with-parameters-maven-release: - use-release-file: "{use-release-file}" - publishers: - lf-infra-publish @@ -69,6 +61,14 @@ disabled: "{disable-job}" + parameters: + - lf-infra-parameters: + project: "{project}" + branch: "$GERRIT_BRANCH" + stream: "$GERRIT_BRANCH" + - lf-build-with-parameters-maven-release: + use-release-file: "{use-release-file}" + builders: - lf-infra-pre-build - conditional-step: @@ -165,6 +165,19 @@ disabled: "{disable-job}" + parameters: + - lf-infra-parameters: + project: "{project}" + branch: "$GERRIT_BRANCH" + stream: "$GERRIT_BRANCH" + - lf-build-with-parameters-maven-release: + use-release-file: "{use-release-file}" + - bool: + name: DRY_RUN + default: false + description: | + If DRY_RUN is enabled artifacts are not published. + builders: - lf-infra-pre-build - conditional-step: diff --git a/releasenotes/notes/fix-release-job-script-4309fdf6b2897370.yaml b/releasenotes/notes/fix-release-job-script-4309fdf6b2897370.yaml new file mode 100644 index 00000000..18aa5b37 --- /dev/null +++ b/releasenotes/notes/fix-release-job-script-4309fdf6b2897370.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Add DRY_RUN build param to do a test run the job with publishing artifacts. diff --git a/releasenotes/notes/lf-release-jobs-d54201d573596a3f.yaml b/releasenotes/notes/lf-release-jobs-d54201d573596a3f.yaml new file mode 100644 index 00000000..1c127fb9 --- /dev/null +++ b/releasenotes/notes/lf-release-jobs-d54201d573596a3f.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + Verify both repos before attempting release. + We have run into a case where the repo on ODL + nexus was good, and the repo on Sonatype nexus + was missing. Cover this case by running the verify + loop over each repo before attempting release. diff --git a/releasenotes/notes/lftools-version-0.26.2-afecd76f60a54e5c.yaml b/releasenotes/notes/lftools-version-0.26.2-afecd76f60a54e5c.yaml new file mode 100644 index 00000000..ef1f2f6c --- /dev/null +++ b/releasenotes/notes/lftools-version-0.26.2-afecd76f60a54e5c.yaml @@ -0,0 +1,4 @@ +--- +upgrade: + - | + Update lftools version to **v0.26.2**. diff --git a/shell/python-tools-install.sh b/shell/python-tools-install.sh index c7686535..603fece4 100644 --- a/shell/python-tools-install.sh +++ b/shell/python-tools-install.sh @@ -44,7 +44,7 @@ else echo "Generating Requirements File" cat << 'EOF' > "$requirements_file" -lftools[openstack]~=0.26.1 +lftools[openstack]~=0.26.2 python-heatclient~=1.16.1 python-openstackclient~=3.16.0 dogpile.cache~=0.6.8 # Version 0.7.[01] seems to break openstackclient diff --git a/shell/release-job.sh b/shell/release-job.sh index 6510ce5b..fd43d754 100644 --- a/shell/release-job.sh +++ b/shell/release-job.sh @@ -51,7 +51,7 @@ tag(){ echo "git tag -v $VERSION" git tag -v "$VERSION" ########## Merge Part ############## - if [[ "$JOB_NAME" =~ "merge" ]]; then + if [[ "$JOB_NAME" =~ "merge" ]] && [[ "$DRY_RUN" = false ]]; then echo "--> INFO: Running merge" gerrit_ssh=$(echo "$GERRIT_URL" | awk -F"/" '{print $3}') git remote set-url origin ssh://"$RELEASE_USERNAME"@"$gerrit_ssh":29418/"$PROJECT" @@ -75,11 +75,17 @@ nexus_release(){ lftools nexus release -v --server https://"$NEXUS_URL" "$STAGING_REPO" echo "Merge will run" echo "lftools nexus release --server https://$NEXUS_URL $STAGING_REPO" - if [[ "$JOB_NAME" =~ "merge" ]]; then + done + + #Run the loop twice, to catch errors on either nexus repo + if [[ "$JOB_NAME" =~ "merge" ]] && [[ "$DRY_RUN" = false ]]; then + for staging_url in $(zcat "$PATCH_DIR"/staging-repo.txt.gz | awk -e '{print $2}'); do + NEXUS_URL=$(echo "$staging_url" | sed -e 's|^[^/]*//||' -e 's|/.*$||') + STAGING_REPO=${staging_url#*repositories/} echo "Promoting $STAGING_REPO on $NEXUS_URL." lftools nexus release --server https://"$NEXUS_URL" "$STAGING_REPO" - fi - done + done + fi } @@ -112,8 +118,8 @@ container_release_file(){ echo "docker tag $container_image_id $DOCKER_REGISTRY:10002/$lfn_umbrella/$name:$VERSION" echo "docker push $DOCKER_REGISTRY:10002/$lfn_umbrella/$name:$VERSION" if [[ "$JOB_NAME" =~ "merge" ]]; then - docker tag "$container_image_id" "$DOCKER_REGISTRY":10002/"$lfn_umbrella"/"$name":"$VERSION" - docker push "$DOCKER_REGISTRY":10002/"$lfn_umbrella"/"$name":"$VERSION" + docker tag "$container_image_id" "$DOCKER_REGISTRY":10002/"$lfn_umbrella"/"$name":"$VERSION" + docker push "$DOCKER_REGISTRY":10002/"$lfn_umbrella"/"$name":"$VERSION" fi echo "#########################" fi