Show error if distribution_type is missing
[releng/global-jjb.git] / shell / release-job.sh
1 #!/bin/bash -l
2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2019 The Linux Foundation and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11 echo "---> release-job.sh"
12 set -eu -o pipefail
13
14 echo "INFO: creating virtual environment"
15 virtualenv -p python3 /tmp/venv
16 PATH=/tmp/venv/bin:$PATH
17 pipup="python -m pip install -q --upgrade pip lftools jsonschema niet twine yq"
18 echo "INFO: $pipup"
19 $pipup
20 # show installed versions
21 python -m pip --version
22 python -m pip freeze
23
24 #Functions.
25
26 set_variables_common(){
27     echo "INFO: Setting common variables"
28     if [[ -z ${LOGS_SERVER:-} ]]; then
29         echo "ERROR: LOGS_SERVER not defined"
30         exit 1
31     fi
32     NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/"
33     # Verify if using release file or parameters
34     if $USE_RELEASE_FILE ; then
35         release_files=$(git diff-tree -m --no-commit-id -r "$GIT_COMMIT" --name-only -- "releases/" ".releases/")
36         if (( $(grep -c . <<<"$release_files") > 1 )); then
37           echo "INFO: RELEASE FILES ARE AS FOLLOWS: $release_files"
38           echo "ERROR: Committing multiple release files in the same commit OR rename/amend of existing files is not supported."
39           exit 1
40         else
41           release_file="$release_files"
42           echo "INFO: RELEASE FILE: $release_files"
43         fi
44     else
45         echo "INFO: This job is built with parameters, no release file needed."
46         release_file="None"
47     fi
48
49     # Jenkins parameter drop-down defaults DISTRIBUTION_TYPE to None
50     # in the contain/maven release job; get value from release yaml.
51     # Packagecloud and PyPI jobs set the appropriate value.
52     DISTRIBUTION_TYPE="${DISTRIBUTION_TYPE:-None}"
53     if [[ $DISTRIBUTION_TYPE == "None" ]]; then
54         if ! DISTRIBUTION_TYPE=$(niet ".distribution_type" "$release_file"); then
55             echo "ERROR: Failed to get distribution_type from $release_file"
56             exit 1
57         fi
58     fi
59
60     PATCH_DIR=$(mktemp -d)
61
62     # Displaying Release Information (Common variables)
63     printf "\t%-30s\n" RELEASE_ENVIRONMENT_INFO:
64     printf "\t%-30s %s\n" RELEASE_FILE: "$release_file"
65     printf "\t%-30s %s\n" LOGS_SERVER: "$LOGS_SERVER"
66     printf "\t%-30s %s\n" NEXUS_PATH: "$NEXUS_PATH"
67     printf "\t%-30s %s\n" JENKINS_HOSTNAME: "$JENKINS_HOSTNAME"
68     printf "\t%-30s %s\n" SILO: "$SILO"
69     printf "\t%-30s %s\n" PROJECT: "$PROJECT"
70     printf "\t%-30s %s\n" PROJECT-DASHED: "${PROJECT//\//-}"
71     printf "\t%-30s %s\n" DISTRIBUTION_TYPE: "$DISTRIBUTION_TYPE"
72 }
73
74 set_variables_maven(){
75     echo "INFO: Setting maven variables"
76     if [[ -z ${VERSION:-} ]]; then
77         VERSION=$(niet ".version" "$release_file")
78     fi
79     if [[ -z ${GIT_TAG:-} ]]; then
80         if grep -q "git_tag" "$release_file" ; then
81             GIT_TAG=$(niet ".git_tag" "$release_file")
82         else
83             GIT_TAG="$VERSION"
84         fi
85     fi
86     if [[ -z ${LOG_DIR:-} ]]; then
87         LOG_DIR=$(niet ".log_dir" "$release_file")
88     fi
89     LOGS_URL="${LOGS_SERVER}/${NEXUS_PATH}${LOG_DIR}"
90     LOGS_URL=${LOGS_URL%/}  # strip any trailing '/'
91
92     # Continuing displaying Release Information (Maven)
93     printf "\t%-30s\n" RELEASE_MAVEN_INFO:
94     printf "\t%-30s %s\n" VERSION: "$VERSION"
95     printf "\t%-30s %s\n" GIT_TAG: "$GIT_TAG"
96     printf "\t%-30s %s\n" LOG_DIR: "$LOG_DIR"
97     printf "\t%-30s %s\n" LOGS_URL: "$LOGS_URL"
98 }
99
100 set_variables_container(){
101     echo "INFO: Setting container variables"
102     if [[ -z ${VERSION:-} ]]; then
103         VERSION=$(niet ".container_release_tag" "$release_file")
104     fi
105     if [[ -z ${GIT_TAG:-} ]]; then
106         if grep -q "git_tag" "$release_file" ; then
107             GIT_TAG=$(niet ".git_tag" "$release_file")
108         else
109             GIT_TAG="$VERSION"
110         fi
111    fi
112     if grep -q "container_pull_registry" "$release_file" ; then
113         CONTAINER_PULL_REGISTRY=$(niet ".container_pull_registry" "$release_file")
114     fi
115     if grep -q "container_push_registry" "$release_file" ; then
116         CONTAINER_PUSH_REGISTRY=$(niet ".container_push_registry" "$release_file")
117     fi
118     # Make sure both pull and push registries are defined
119     if [ -z ${CONTAINER_PULL_REGISTRY+x} ] || [ -z ${CONTAINER_PUSH_REGISTRY+x} ]; then
120         echo "ERROR: CONTAINER_PULL_REGISTRY and CONTAINER_PUSH_REGISTRY need to be defined"
121         exit 1
122     fi
123     ref=$(niet ".ref" "$release_file")
124
125     # Continuing displaying Release Information (Container)
126     printf "\t%-30s\n" RELEASE_CONTAINER_INFO:
127     printf "\t%-30s %s\n" CONTAINER_RELEASE_TAG: "$VERSION"
128     printf "\t%-30s %s\n" CONTAINER_PULL_REGISTRY: "$CONTAINER_PULL_REGISTRY"
129     printf "\t%-30s %s\n" CONTAINER_PUSH_REGISTRY: "$CONTAINER_PUSH_REGISTRY"
130     printf "\t%-30s %s\n" GERRIT_REF_TO_TAG: "$ref"
131     printf "\t%-30s %s\n" GIT_TAG: "$GIT_TAG"
132 }
133
134 set_variables_pypi(){
135     echo "INFO: Setting pypi variables"
136     if [[ -z ${LOG_DIR:-} ]]; then
137         LOG_DIR=$(niet ".log_dir" "$release_file")
138     fi
139     LOGS_URL="${LOGS_SERVER}/${NEXUS_PATH}${LOG_DIR}"
140     LOGS_URL=${LOGS_URL%/}  # strip any trailing '/'
141     if [[ -z ${PYPI_PROJECT:-} ]]; then
142         PYPI_PROJECT=$(niet ".pypi_project" "$release_file")
143     fi
144     if [[ -z ${PYTHON_VERSION:-} ]]; then
145         PYTHON_VERSION=$(niet ".python_version" "$release_file")
146     fi
147     if [[ -z ${VERSION:-} ]]; then
148         VERSION=$(niet ".version" "$release_file")
149     fi
150     if [[ -z ${GIT_TAG:-} ]]; then
151         if grep -q "git_tag" "$release_file" ; then
152             GIT_TAG=$(niet ".git_tag" "$release_file")
153         else
154             GIT_TAG="$VERSION"
155         fi
156    fi
157
158     # Continuing displaying Release Information (pypi)
159     printf "\t%-30s\n" RELEASE_PYPI_INFO:
160     printf "\t%-30s %s\n" LOG_DIR: "$LOG_DIR"
161     printf "\t%-30s %s\n" LOGS_URL: "$LOGS_URL"
162     printf "\t%-30s %s\n" PYPI_INDEX: "$PYPI_INDEX" # from job configuration
163     printf "\t%-30s %s\n" PYPI_PROJECT: "$PYPI_PROJECT"
164     printf "\t%-30s %s\n" PYTHON_VERSION: "$PYTHON_VERSION"
165     printf "\t%-30s %s\n" VERSION: "$VERSION"
166     printf "\t%-30s %s\n" GIT_TAG: "$GIT_TAG"
167 }
168
169 set_variables_packagecloud(){
170      echo "INFO: Setting packagecloud variables"
171      if [[ -z ${VERSION:-} ]]; then
172          VERSION=$(niet ".version" "$release_file")
173      fi
174      if [[ -z ${GIT_TAG:-} ]]; then
175          if grep -q "git_tag" $release_file ; then
176              GIT_TAG=$(niet ".git_tag" "$release_file")
177          else
178              GIT_TAG="$VERSION"
179          fi
180      fi
181      if [[ -z ${LOG_DIR:-} ]]; then
182          LOG_DIR=$(niet ".log_dir" "$release_file")
183      fi
184      if [[ -z ${REF:-} ]]; then
185          REF=$(niet ".ref" "$release_file")
186      fi
187      if [[ -z ${PACKAGE_NAME:-} ]]; then
188          PACKAGE_NAME=$(niet ".package_name" "$release_file")
189      fi
190      logs_url="${LOGS_SERVER}/${NEXUS_PATH}${LOG_DIR}"
191      logs_url=${logs_url%/}  # strip any trailing '/'
192
193      printf "\t%-30s %s\n" PACKAGE_NAME: "$PACKAGE_NAME"
194      printf "\t%-30s %s\n" LOG_DIR: "$LOG_DIR"
195      printf "\t%-30s %s\n" LOGS_URL: "$logs_url"
196      printf "\t%-30s %s\n" GERRIT_REF_TO_TAG: "$REF"
197      printf "\t%-30s %s\n" VERSION: "$VERSION"
198      printf "\t%-30s %s\n" GIT_TAG: "$GIT_TAG"
199 }
200
201 verify_schema(){
202     echo "INFO: Verifying $release_file against schema $release_schema"
203     lftools schema verify "$release_file" "$release_schema"
204 }
205
206 verify_version(){
207     # Verify allowed patterns "#.#.#" (SemVer) or "v#.#.#"
208     echo "INFO: Verifying version $VERSION"
209     allowed_version_regex="^((v?)([0-9]+)\.([0-9]+)\.([0-9]+))$"
210     if [[ $VERSION =~ $allowed_version_regex ]]; then
211         echo "INFO: The version $VERSION is valid"
212     else
213         echo "ERROR: The version $VERSION is not valid"
214         echo "ERROR: Valid versions are \"#.#.#\" (SemVer) or \"v#.#.#\""
215         echo "ERROR: See https://semver.org/ for more details on SemVer"
216         exit 1
217     fi
218 }
219
220 verify_version_match_release(){
221     echo "INFO: Fetching console log from $LOGS_URL"
222     wget -P /tmp "${LOGS_URL}/"console.log.gz
223     echo "INFO: Searching for uploaded step and version $VERSION in job log"
224     if zgrep "Successfully uploaded" /tmp/console.log.gz | grep "$VERSION"; then
225         echo "INFO: found expected strings in job log"
226     else
227         echo "ERROR: Defined version in release file does not match staging repo artifacts version to be released"
228         echo "ERROR: Please make sure maven stage job log dir and release version are both correct"
229         exit 1
230     fi
231 }
232
233 # check prerequisites to detect mistakes in the release YAML file
234 verify_pypi_match_release(){
235     echo "INFO: Fetching console log from $LOGS_URL"
236     wget -q -P /tmp "${LOGS_URL}/"console.log.gz
237     echo "INFO: Searching for uploaded step, project $PYPI_PROJECT and version $VERSION in job log"
238     # pypi-upload.sh generates success message with file list
239     if zgrep -i "uploaded" /tmp/console.log.gz | grep "$PYPI_PROJECT" | grep "$VERSION" ; then
240         echo "INFO: found expected strings in job log"
241     else
242         echo "ERROR: failed to find expected strings in job log"
243         exit 1
244     fi
245 }
246
247 verify_packagecloud_match_release(){
248     echo "INFO: Fetching console log from $logs_url"
249     wget -q -P /tmp "${logs_url}/"console.log.gz
250     echo "INFO: Searching for uploaded step, package name $PACKAGE_NAME and version $VERSION in job log"
251     if  zgrep -E "Pushing.*$PACKAGE_NAME.*$VERSION.*success\!" /tmp/console.log.gz; then
252         echo "INFO: found expected strings in job log"
253     else
254         echo "ERROR: failed to find expected strings in job log"
255         exit 1
256     fi
257 }
258
259 # sigul is only available on Centos
260 # TODO: write tag-github-repo function
261 tag-gerrit-repo(){
262     echo "INFO: tag gerrit with $GIT_TAG"
263     # Import public signing key
264     gpg --import "$SIGNING_PUBKEY"
265     if type=$(git cat-file -t "$GIT_TAG"); then
266         if [[ $type == "tag" ]]; then
267             echo "INFO: Repo already has signed tag $GIT_TAG, nothing to do"
268         else
269             echo "ERROR: Repo has lightweight tag $GIT_TAG, blocks push of signed tag"
270             exit 1
271         fi
272     else
273         echo "INFO: Repo has not yet been tagged $GIT_TAG"
274         git tag -am "${PROJECT//\//-} $GIT_TAG" "$GIT_TAG"
275         sigul --batch -c "$SIGUL_CONFIG" sign-git-tag "$SIGUL_KEY" "$GIT_TAG" < "$SIGUL_PASSWORD"
276         echo "INFO: Showing latest signature for $PROJECT:"
277         echo "INFO: git tag -v $GIT_TAG"
278         git tag -v "$GIT_TAG"
279
280         ########## Merge Part ##############
281         if [[ "$JOB_NAME" =~ "merge" ]] && [[ "$DRY_RUN" = false ]]; then
282             echo "INFO: Running merge, pushing tag"
283             gerrit_ssh=$(echo "$GERRIT_URL" | awk -F"/" '{print $3}')
284             git remote set-url origin ssh://"$RELEASE_USERNAME"@"$gerrit_ssh":29418/"$PROJECT"
285             git config user.name "$RELEASE_USERNAME"
286             git config user.email "$RELEASE_EMAIL"
287             echo -e "Host $gerrit_ssh\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
288             chmod 600 ~/.ssh/config
289             git push origin "$GIT_TAG"
290         fi
291     fi
292 }
293
294 nexus_release(){
295     echo "INFO: Processing nexus release"
296     for staging_url in $(zcat "$PATCH_DIR"/staging-repo.txt.gz | awk -e '{print $2}'); do
297         # extract the domain name from URL
298         NEXUS_URL=$(echo "$staging_url" | sed -e 's|^[^/]*//||' -e 's|/.*$||')
299         echo "INFO: NEXUS_URL: $NEXUS_URL"
300         # extract the staging repo from URL
301         STAGING_REPO=${staging_url#*repositories/}
302         echo "INFO: Running Nexus Verify"
303         lftools nexus release -v --server https://"$NEXUS_URL" "$STAGING_REPO"
304         echo "INFO: Merge will run:"
305         echo "lftools nexus release --server https://$NEXUS_URL $STAGING_REPO"
306     done
307
308     #Run the loop twice, to catch errors on either nexus repo
309     if [[ "$JOB_NAME" =~ "merge" ]] && [[ "$DRY_RUN" = false ]]; then
310         for staging_url in $(zcat "$PATCH_DIR"/staging-repo.txt.gz | awk -e '{print $2}'); do
311           NEXUS_URL=$(echo "$staging_url" | sed -e 's|^[^/]*//||' -e 's|/.*$||')
312           STAGING_REPO=${staging_url#*repositories/}
313           echo "INFO: Promoting $STAGING_REPO on $NEXUS_URL."
314           lftools nexus release --server https://"$NEXUS_URL" "$STAGING_REPO"
315         done
316     fi
317 }
318
319 container_release_file(){
320     echo "INFO: Processing container release"
321     local lfn_umbrella
322     lfn_umbrella="$(echo "$GERRIT_URL" | awk -F"." '{print $2}')"
323
324     for namequoted in $(yq '.containers[].name' $release_file); do
325         versionquoted=$(yq ".containers[] |select(.name==$namequoted) |.version" $release_file)
326
327         #Remove extra yaml quotes
328         name="${namequoted#\"}"
329         name="${name%\"}"
330         version="${versionquoted#\"}"
331         version="${version%\"}"
332
333         echo "$name"
334         echo "$version"
335         echo "INFO: Merge will release $name $version as $VERSION"
336         # Attempt to pull from releases registry to see if the image has been released.
337         if docker pull "$CONTAINER_PUSH_REGISTRY"/"$lfn_umbrella"/"$name":"$VERSION"; then
338             echo "INFO: $VERSION is already released for image $name, Continuing..."
339         else
340             echo "INFO: $VERSION not found in releases, release will be prepared. Continuing..."
341             docker pull "$CONTAINER_PULL_REGISTRY"/"$lfn_umbrella"/"$name":"$version"
342             container_image_id=$(docker images | grep "$name" | grep "$version" | awk '{print $3}')
343             echo "INFO: Merge will run the following commands:"
344             echo "docker tag $container_image_id $CONTAINER_PUSH_REGISTRY/$lfn_umbrella/$name:$VERSION"
345             echo "docker push $CONTAINER_PUSH_REGISTRY/$lfn_umbrella/$name:$VERSION"
346             if [[ "$JOB_NAME" =~ "merge" ]]; then
347                 docker tag "$container_image_id" "$CONTAINER_PUSH_REGISTRY"/"$lfn_umbrella"/"$name":"$VERSION"
348                 docker push "$CONTAINER_PUSH_REGISTRY"/"$lfn_umbrella"/"$name":"$VERSION"
349             fi
350             echo "#########################"
351         fi
352     done
353
354     echo "INFO: Merge will tag ref: $ref"
355     git checkout "$ref"
356     tag-gerrit-repo
357 }
358
359 maven_release_file(){
360     echo "INFO: Processing maven release"
361     echo "INFO: wget -P $PATCH_DIR ${LOGS_URL}/staging-repo.txt.gz"
362     wget -P "$PATCH_DIR" "${LOGS_URL}/"staging-repo.txt.gz
363     pushd "$PATCH_DIR"
364         echo "INFO: wget ${LOGS_URL}/patches/{${PROJECT//\//-}.bundle,taglist.log.gz}"
365         wget "${LOGS_URL}"/patches/{"${PROJECT//\//-}".bundle,taglist.log.gz}
366         gunzip taglist.log.gz
367         cat "$PATCH_DIR"/taglist.log
368     popd
369     git checkout "$(awk '{print $NF}' "$PATCH_DIR/taglist.log")"
370     git fetch "$PATCH_DIR/${PROJECT//\//-}.bundle"
371     git merge --ff-only FETCH_HEAD
372     nexus_release
373     tag-gerrit-repo
374 }
375
376 # calls pip to download binary and source distributions from the specified index,
377 # which requires a recent-in-2019 version.  Uploads the files it received.
378 pypi_release_file(){
379     echo "INFO: Processing pypi release"
380     tgtdir=dist
381     mkdir $tgtdir
382     pip_pfx="pip download -d $tgtdir --no-deps --python-version $PYTHON_VERSION -i $PYPI_INDEX"
383     module="$PYPI_PROJECT==$VERSION"
384     pip_bin="$pip_pfx $module"
385     echo "INFO: downloading binary: $pip_bin"
386     if ! $pip_bin ; then
387         echo "WARN: failed to download binary distribution"
388     fi
389     pip_src="$pip_pfx --no-binary=:all: $module"
390     echo "INFO: downloading source: $pip_src"
391     if ! $pip_src ; then
392         echo "WARN: failed to download source distribution"
393     fi
394     echo "INFO: Checking files in $tgtdir"
395     # shellcheck disable=SC2012
396     filecount=$(ls $tgtdir | wc -l)
397     if [[ $filecount = 0 ]] ; then
398         echo "ERROR: no files downloaded"
399         exit 1
400     else
401         # shellcheck disable=SC2046
402         echo "INFO: downloaded $filecount distributions: " $(ls $tgtdir)
403     fi
404
405     if [[ ! "$JOB_NAME" =~ "merge" ]] ; then
406         echo "INFO: not a merge job, not uploading files"
407         return
408     fi
409
410     cmd="twine upload -r $REPOSITORY $tgtdir/*"
411     if $DRY_RUN; then
412         echo "INFO: dry-run is set, echoing command only"
413         echo "$cmd"
414     else
415         echo "INFO: uploading $filecount distributions to repo $REPOSITORY"
416         $cmd
417     fi
418     tag-gerrit-repo
419 }
420
421 packagecloud_verify(){
422     echo "INFO: Verifying $1 exists in staging..."
423     if [[ $1 == $(curl --netrc-file ~/packagecloud_api --silent \
424         https://packagecloud.io/api/v1/repos/"$2"/staging/search?q="$1" \
425         | yq -r .[].filename) ]]; then
426         echo "INFO: $1 exists in staging!"
427         echo "INFO: Existing package location: https://packagecloud.io$(curl \
428             --netrc-file ~/packagecloud_api --silent \
429             https://packagecloud.io/api/v1/repos/"$2"/staging/search?q="$1" \
430             | yq -r .[].package_html_url)"
431     else
432         echo "ERROR: $1 does not exist in staging"
433         exit 1
434     fi
435 }
436
437 packagecloud_promote(){
438     echo "INFO: Preparing to promote $1..."
439     promote_url="https://packagecloud.io$(curl --netrc-file ~/packagecloud_api \
440         --silent https://packagecloud.io/api/v1/repos/"$2"/staging/search?q="$1" \
441         | yq -r .[].promote_url)"
442     echo "INFO: Promoting $1 from staging to release"
443     curl --netrc-file ~/packagecloud_api -X POST -F \
444         destination="$2/release" "$promote_url" \
445         | echo "INFO: Promoted package location: \
446         https://packagecloud.io$(yq -r .package_html_url)"
447     git checkout "$REF"
448     tag-gerrit-repo
449 }
450
451 ##############################  End Function Declarations  ################################
452
453 # Set common environment variables
454 set_variables_common
455
456 # Determine the type of release:
457 #   - container, release-container-schema.yaml
458 #   - maven, release-schema.yaml
459 #   - pypi,  release-pypi-schema.yaml
460
461 case $DISTRIBUTION_TYPE in
462
463     maven)
464         if $USE_RELEASE_FILE ; then
465             release_schema="release-schema.yaml"
466             echo "INFO: Fetching schema $release_schema"
467             wget -q https://raw.githubusercontent.com/lfit/releng-global-jjb/master/schema/$release_schema
468             verify_schema
469         fi
470         set_variables_maven
471         verify_version
472         verify_version_match_release
473         maven_release_file
474         ;;
475
476     container)
477         if $USE_RELEASE_FILE ; then
478             release_schema="release-container-schema.yaml"
479             echo "INFO: Fetching schema $release_schema"
480             wget -q https://raw.githubusercontent.com/lfit/releng-global-jjb/master/schema/${release_schema}
481             verify_schema
482         fi
483         set_variables_container
484         verify_version
485         container_release_file
486         ;;
487
488     pypi)
489         if $USE_RELEASE_FILE ; then
490             release_schema="release-pypi-schema.yaml"
491             echo "INFO: Fetching schema $release_schema"
492             wget -q https://raw.githubusercontent.com/lfit/releng-global-jjb/master/schema/${release_schema}
493             verify_schema
494         fi
495         set_variables_pypi
496         verify_version
497         verify_pypi_match_release
498         pypi_release_file
499         ;;
500
501     packagecloud)
502         if $USE_RELEASE_FILE ; then
503             release_schema="release-packagecloud-schema.yaml"
504             packagecloud_account=$(cat "$ACCOUNT_NAME_FILE")
505             echo "INFO: Fetching schema $release_schema"
506             wget -q https://raw.githubusercontent.com/lfit/releng-global-jjb/master/schema/${release_schema}
507             verify_schema
508         fi
509         set_variables_packagecloud
510         verify_packagecloud_match_release
511         for name in $(yq -r '.packages[].name' $release_file); do
512             package=$name
513             packagecloud_verify "$package" "$packagecloud_account"
514             if [[ "$JOB_NAME" =~ "merge" ]] && ! $DRY_RUN; then
515                 packagecloud_promote "$package" "$packagecloud_account"
516             fi
517         done
518         ;;
519
520     *)
521         echo "ERROR: distribution_type: $DISTRIBUTION_TYPE not supported"
522         exit 1
523         ;;
524 esac
525
526 echo "---> release-job.sh ends"