| # Copyright 2017 Google Inc. |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| help: |
| @echo "Usage:" |
| @echo " make test - run all the tests." |
| @echo " make release - upload a release of Franky to CIPD." |
| @echo " make clean - clean up the temporary generated files." |
| |
| test: |
| ./test.py run |
| |
| release: check_git_clean clean |
| vpython setup.py bdist_wheel --universal |
| cipd create -in dist \ |
| -name "infra/python/wheels/franky-py2" \ |
| -compression-level 0 -install-mode symlink \ |
| -tag "git_revision:`git log -1 --format='%H'`" \ |
| -ref latest |
| |
| clean: |
| rm -rf dist build |
| |
| # Verify that the current git checkout is in a clean committed state. |
| # Do not release anything that's not committed to the remote repo. |
| check_git_clean: |
| # Check that the current git hash is in the history of the origin/master. |
| @if ! git log `git show-ref --hash refs/remotes/origin/master` \ |
| --format='%H' | grep -q `git log -1 --format='%H'`; then \ |
| echo "Your branch has local commits."; \ |
| echo "You should only release committed revisions."; \ |
| false; \ |
| fi |
| # Check that the repo has no local modifications. |
| @if [[ -n `git status --short` ]]; then \ |
| echo "Your checkout is locally modified or has untracked files."; \ |
| false; \ |
| fi |