-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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.
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
Build merges on master to lastest branch #2722
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,9 +15,9 @@ env: | |
global: | ||
- COVERAGE_OPTION='./node_modules/.bin/istanbul cover' | ||
matrix: | ||
- PARSE_SERVER_TEST_DB=postgres | ||
- MONGODB_VERSION=3.0.8 | ||
- MONGODB_VERSION=3.2.6 | ||
- PARSE_SERVER_TEST_DB=postgres | ||
matrix: | ||
fast_finish: true | ||
branches: | ||
|
@@ -30,14 +30,25 @@ cache: | |
- "$HOME/.mongodb/versions" | ||
after_script: | ||
- bash <(curl -s https://codecov.io/bash) | ||
after_failure: | ||
- (cd resources; python travis_after_all.py) | ||
after_success: | ||
- (cd resources; python travis_after_all.py) | ||
|
||
deploy: | ||
provider: npm | ||
email: | ||
secure: T3LwSJFcu632SDfCoavcKL39NktWLEOOFzonAjeHAglmMyDp9hvU8xHwQ4JJy2CRA03c+ezAe2gH3Va+jfxvh1JtFUan+p88vaCHHKuNwPSp4WZBPt1ZTDmG+ACG6j+ZWHK+eP7hLvtlCi/M9/v4/bVojpm7v01LLiM+MRhnE9E7eLemQC4zb6RVtf2oGQ3mX51kMeya218kEm5bsQPpRJElI9jwletFa8qYK5AFga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LJHzKW2J2dWeRANkOaiSwO9VBC9/rht5ulK5qQ1pB2+sKDToAaiKy6RMlB/HgIoYqsU= | ||
on: | ||
tags: true | ||
all_branches: true | ||
condition: "$MONGODB_VERSION = '3.0.8'" | ||
repo: ParsePlatform/parse-server | ||
- provider: script | ||
skip_cleanup: true | ||
script: ./resources/npm-git.sh | ||
on: | ||
branch: master | ||
condition: "$BUILD_LEADER$BUILD_AGGREGATE_STATUS = YESothers_succeeded" | ||
- provider: npm | ||
email: | ||
secure: T3LwSJFcu632SDfCoavcKL39NktWLEOOFzonAjeHAglmMyDp9hvU8xHwQ4JJy2CRA03c+ezAe2gH3Va+jfxvh1JtFUan+p88vaCHHKuNwPSp4WZBPt1ZTDmG+ACG6j+ZWHK+eP7hLvtlCi/M9/v4/bVojpm7v01LLiM+MRhnE9E7eLemQC4zb6RVtf2oGQ3mX51kMeya218kEm5bsQPpRJElI9jwletFa8qYK5AFgaCHpll059RRHQTTE9MTNcN58P/Kf6Qb3KGpKNoaHTXoOD4U6LcXLWvdHONVB6AzGefxg2b/dvtaO4nd5lDooMBR3u9kWpopXkyAuf+fO/8je9JTxO6CDUtDjHRcR2mCEXWX6rculIAbNXOv1ccRYCTQ8aFtYnFlMSb1+QIAdyT6HHmeT5ktk3+XJRuEv0PJJvqHTo+j7tPngjiv5sPNutgGFlOFO90omTbzEkIT/D/LsgXbWm2QKYWejbLiuSINg+FiFiZN90doCf4aCpm2y1Q/9GzvK+eXcpqzPCGxOykE7EuPZK3+S/ZU2oaWL2uSpbKPtC0qxebrneR307aVEa7C85HCkTMMBzE4tjUr8h5HhLqtWvqmDcnBo3PfQhf9cEO6jQLd3qhEVJmcwKz/yOCfgPXlCbRqiKk7j94perpNCIalXtMI9ySYjJNjHsB4600= | ||
api_key: | ||
secure: WLjhHVAdUkDy6UdNWveTpZqphw9olN0alCpyPpU0cJjlN/hk7YxPP+YHOSVnMZaRZoHM0LL11jPKLf970nymBfvJHDWxKk71c/5xyTX8pBtSxmGmGy23a5g2VrHVMd2JxsI7NEAH500tlFz+01t4E3Steo0NpAkHR3Q51kj01gQy8IumsksfhRc9uvjZ7zjm99Yk4L+cxyei79v4esfpx7Bgm0HTfAAAG/19F+r0hvvFiV517SREDU/YtcX/rIjVepEy1uiLKEohnmYtVIRSA3Hjh6VlHVhdj2WDd/dYrxi/Ioysq2zOM9pZVLamO9asB1e6JrTEipWE9jSZXxsbnfFzuNLxcOjKv1wd3OzQKF/7pGKGiWRTv5Xm19D/FrXoE/ULs6bHcC/Ke8Gs2RxPlOCdvAFehCkyf5P4HOPCQdR7o8Yiuvt+5JWKBflElNbSd4nWgwUOo3Yv8vC4Vj53fwmM+Uqfu3IgYFWktYxCm4RWIKMfB/gtmjcF6QYFfjvEMwAvRfBV81kuynCsnubXWzQeBE/b3JOhBfpGciKCjKfy+tS6bZfFjCtQV98hMMiCPre8Y7PahHDYc65wU9Ake+ZE+dDaSbeV3DZ5JeifLJHzKW2J2dWeRANkOaiSwO9VBC9/rht5ulK5qQ1pB2+sKDToAaiKy6RMlB/HgIoYqsU= | ||
on: | ||
tags: true | ||
all_branches: true | ||
condition: "$MONGODB_VERSION = '3.0.8'" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could be updated to |
||
repo: ParsePlatform/parse-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/sh -e | ||
|
||
# This script maintains a git branch which mirrors master but in a form that | ||
# what will eventually be deployed to npm, allowing npm dependencies to use: | ||
# | ||
# "parse-server": "parseplatform/parse-server#latest" | ||
# | ||
|
||
# From: https://github.com/graphql/graphql-js/blob/master/resources/npm-git.sh | ||
|
||
BUILD_DIR=latest | ||
|
||
npm run build | ||
|
||
mkdir -p $BUILD_DIR | ||
|
||
cp package.json $BUILD_DIR/ | ||
cp README.md $BUILD_DIR/ | ||
cp LICENSE $BUILD_DIR/ | ||
cp PATENTS $BUILD_DIR/ | ||
cp CHANGELOG.md $BUILD_DIR/ | ||
cp -R lib $BUILD_DIR | ||
cp -R bin $BUILD_DIR | ||
cp -R public_html $BUILD_DIR | ||
cp -R views $BUILD_DIR | ||
|
||
cd $BUILD_DIR | ||
git init | ||
git config user.name "Travis CI" | ||
git config user.email "[email protected]" | ||
git add . | ||
git commit -m "Deploy master to LATEST branch" | ||
git push --force --quiet "https://${GH_TOKEN}@github.com/parseplatform/parse-server.git" master:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
""" | ||
https://github.com/dmakhno/travis_after_all/blob/master/travis_after_all.py | ||
https://github.com/graphql/graphql-js/blob/master/resources/travis_after_all.py | ||
""" | ||
|
||
import os | ||
import json | ||
import time | ||
import logging | ||
|
||
try: | ||
import urllib.request as urllib2 | ||
except ImportError: | ||
import urllib2 | ||
|
||
log = logging.getLogger("travis.leader") | ||
log.addHandler(logging.StreamHandler()) | ||
log.setLevel(logging.INFO) | ||
|
||
TRAVIS_JOB_NUMBER = 'TRAVIS_JOB_NUMBER' | ||
TRAVIS_BUILD_ID = 'TRAVIS_BUILD_ID' | ||
POLLING_INTERVAL = 'LEADER_POLLING_INTERVAL' | ||
|
||
build_id = os.getenv(TRAVIS_BUILD_ID) | ||
polling_interval = int(os.getenv(POLLING_INTERVAL, '5')) | ||
|
||
#assume, first job is the leader | ||
is_leader = lambda job_number: job_number.endswith('.1') | ||
|
||
if not os.getenv(TRAVIS_JOB_NUMBER): | ||
# seems even for builds with only one job, this won't get here | ||
log.fatal("Don't use defining leader for build without matrix") | ||
exit(1) | ||
elif is_leader(os.getenv(TRAVIS_JOB_NUMBER)): | ||
log.info("This is a leader") | ||
else: | ||
#since python is subprocess, env variables are exported back via file | ||
with open(".to_export_back", "w") as export_var: | ||
export_var.write("BUILD_MINION=YES") | ||
log.info("This is a minion") | ||
exit(0) | ||
|
||
|
||
class MatrixElement(object): | ||
def __init__(self, json_raw): | ||
self.is_finished = json_raw['finished_at'] is not None | ||
self.is_succeeded = json_raw['result'] == 0 | ||
self.number = json_raw['number'] | ||
self.is_leader = is_leader(self.number) | ||
|
||
|
||
def matrix_snapshot(): | ||
""" | ||
:return: Matrix List | ||
""" | ||
response = urllib2.build_opener().open("https://api.travis-ci.org/builds/{0}".format(build_id)).read() | ||
raw_json = json.loads(response) | ||
matrix_without_leader = [MatrixElement(element) for element in raw_json["matrix"]] | ||
return matrix_without_leader | ||
|
||
|
||
def wait_others_to_finish(): | ||
def others_finished(): | ||
""" | ||
Dumps others to finish | ||
Leader cannot finish, it is working now | ||
:return: tuple(True or False, List of not finished jobs) | ||
""" | ||
snapshot = matrix_snapshot() | ||
finished = [el.is_finished for el in snapshot if not el.is_leader] | ||
return reduce(lambda a, b: a and b, finished), [el.number for el in snapshot if | ||
not el.is_leader and not el.is_finished] | ||
|
||
while True: | ||
finished, waiting_list = others_finished() | ||
if finished: break | ||
log.info("Leader waits for minions {0}...".format(waiting_list)) # just in case do not get "silence timeout" | ||
time.sleep(polling_interval) | ||
|
||
|
||
try: | ||
wait_others_to_finish() | ||
|
||
final_snapshot = matrix_snapshot() | ||
log.info("Final Results: {0}".format([(e.number, e.is_succeeded) for e in final_snapshot])) | ||
|
||
BUILD_AGGREGATE_STATUS = 'BUILD_AGGREGATE_STATUS' | ||
others_snapshot = [el for el in final_snapshot if not el.is_leader] | ||
if reduce(lambda a, b: a and b, [e.is_succeeded for e in others_snapshot]): | ||
os.environ[BUILD_AGGREGATE_STATUS] = "others_succeeded" | ||
elif reduce(lambda a, b: a and b, [not e.is_succeeded for e in others_snapshot]): | ||
log.error("Others Failed") | ||
os.environ[BUILD_AGGREGATE_STATUS] = "others_failed" | ||
else: | ||
log.warn("Others Unknown") | ||
os.environ[BUILD_AGGREGATE_STATUS] = "unknown" | ||
#since python is subprocess, env variables are exported back via file | ||
with open(".to_export_back", "w") as export_var: | ||
export_var.write("BUILD_LEADER=YES {0}={1}".format(BUILD_AGGREGATE_STATUS, os.environ[BUILD_AGGREGATE_STATUS])) | ||
|
||
except Exception as e: | ||
log.fatal(e) |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
swapped so the leader is MONGODB_VERSION=3.0.8