Skip to content

Instantly share code, notes, and snippets.

@mistercrunch
Created April 20, 2018 04:37
Show Gist options
  • Save mistercrunch/24ce10ac954e0b18816ce6ae71387b17 to your computer and use it in GitHub Desktop.
Save mistercrunch/24ce10ac954e0b18816ce6ae71387b17 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import os
from clint.arguments import Args
from clint.textui import puts, colored, indent
from collections import OrderedDict
sys.path.insert(0, os.path.abspath('..'))
deploy_branch = 'apollo'
# TODO: Change this into class (Code as configuration)
# TODO: Fix mergeConflicts on you local instance of superset and push it to lyft/incubator-superset
# TODO: keep track of versioning and tag internal to the branch name this can be written to a file or tag in general
recipe = {
'base': '0.25.0rc1', # can use any ref (tag, SHA, branch, ...)
'cherries': OrderedDict([
('89ba06d9a65250c1a3a6d28f4f69ba5742c9baa3', 'Simplify login form for oauth'),
('e2fbf9a120842d9f9e16bee66e804e40077d4f4a', 'lyft specific views'),
('92e3f1e2243708b281351b1a5becf0522ce4cfae', 'Beta Logo with stashe'),
]),
}
with indent(4, quote='>>>'):
args = Args()
os.system('git remote add lyft git@github.com:lyft/incubator-superset.git')
puts(colored.cyan('Checking out changes'))
os.system('git submodule update --checkout ')
os.chdir('upstream')
puts(colored.cyan('Fetching all branches...'))
os.system('git fetch --all')
puts(colored.cyan('Checking out base branch...'))
os.system('git checkout {}'.format(recipe.get('base')))
for SHA, cherry in recipe.get('cherries').items():
puts(colored.cyan('Placing 🍒 : {}'.format(cherry)))
os.system('git cherry-pick -x {}'.format(SHA))
# TODO:(hugh) randomly generate a scientist name just like docker
puts(colored.cyan('delete deploy branch if already exist'))
os.system('git branch -D {}'.format(deploy_branch))
puts(colored.cyan('checking out fresh branch...'))
os.system('git checkout -b {}'.format(deploy_branch))
puts(colored.cyan('Deleting old apollo branch'))
os.system('git push lyft :{}'.format(deploy_branch))
puts(colored.cyan('Push branch up to github 🚀'))
os.system('git push lyft {}'.format(deploy_branch))
@mistercrunch
Copy link
Author

Credit goes to @hughhh for this 🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment