|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Copyright 2014 Google Inc. All rights reserved. |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | + |
| 17 | +set -ev |
| 18 | + |
| 19 | +######################################### |
| 20 | +# Settings for specific wheels project. # |
| 21 | +######################################### |
| 22 | +WHEELS_PROJECT_NAME="gcloud-python-wheels" |
| 23 | +# "gcloud-python-wheels" is already used by .travis.yml |
| 24 | +FRESH_REPO_DIR="gcloud-python-wheels-fresh" |
| 25 | + |
| 26 | +################################### |
| 27 | +# Checkout the wheels repository. # |
| 28 | +################################### |
| 29 | +git config --global user.email "travis@travis-ci.org" |
| 30 | +git config --global user.name "travis-ci" |
| 31 | +git clone --quiet --branch=master \ |
| 32 | + "https://${GH_OAUTH_TOKEN}@github.com//${GH_OWNER}/${WHEELS_PROJECT_NAME}" \ |
| 33 | + ${FRESH_REPO_DIR} |
| 34 | +# NOTE: Assumes ${GH_OAUTH_TOKEN} and ${GH_OWNER} are set in Travis build |
| 35 | +# settings for project. This also assumes the wheels project is owned by |
| 36 | +# ${GH_OWNER} and that the token can be used to make commits. |
| 37 | + |
| 38 | +################################################# |
| 39 | +# Add the current commit hash to a static file. # |
| 40 | +################################################# |
| 41 | +echo "${TRAVIS_COMMIT}" > ${FRESH_REPO_DIR}/LATEST_COMMIT |
| 42 | + |
| 43 | +############################################## |
| 44 | +# Display git status and push LATEST_COMMIT. # |
| 45 | +############################################## |
| 46 | +cd ${FRESH_REPO_DIR} |
| 47 | +git add ${FRESH_REPO_DIR}/LATEST_COMMIT |
| 48 | + |
| 49 | +git status |
| 50 | +# H/T: http://stackoverflow.com/a/13730477/1068170 |
| 51 | +git commit -m "Latest wheels build by travis-ci. [ci skip]" |
| 52 | +git status |
| 53 | +git push origin master |
0 commit comments