GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix jenkins script. by jerjou · Pull Request #540 · GoogleCloudPlatform/java-docs-samples

Fix jenkins script. #540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
jerjou merged 1 commit into master from jenkins
Mar 3, 2017

Uh oh!

There was an error while loading. Please reload this page.

Merged

Fix jenkins script. #540

Changes from all commits
Commits
Show all changes
1 commit
Select commit
1182ca5
Fix jenkins script.
Mar 3, 2017
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

26 changes: 19 additions & 7 deletions 26 jenkins.sh
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,24 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -x
set -xe
shopt -s globstar

app_version=""

delete_app_version() {
yes | gcloud --project="$GOOGLE_PROJECT_ID" \
app versions delete "$GOOGLE_VERSION_ID"
if [ -n "${app_version}" ] || [ $# -gt 0 ]; then
yes | gcloud --project="${GOOGLE_PROJECT_ID}" \
app versions delete "${1-${app_version}}"
fi
}
handle_error() {
errcode=$? # Remember the error code so we can exit with it after cleanup

# Clean up
delete_app_version

exit $errcode
exit ${errcode}
}
trap handle_error ERR

Expand All @@ -36,10 +40,18 @@ shellcheck ./**/*.sh

# Find all jenkins.sh's and run them.
find . -mindepth 2 -maxdepth 5 -name jenkins.sh -type f | while read path; do
dir="${path%/jenkins.sh}"
app_version="jenkins-${dir//[^a-z]/}"
(
pushd "${path%jenkins.sh}"
/bin/bash ./jenkins.sh
pushd "${dir}"
# Need different app versions because flex can't deploy over an existing
# version
GOOGLE_VERSION_ID="${app_version}" /bin/bash ./jenkins.sh
echo "Return code: $?"

# Clean up the app version in the background
nohup delete_app_version "${app_version}" &
)
done

delete_app_version
wait
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.