Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
Since playdoh has different branches on project and vendor repos... w…
Browse files Browse the repository at this point in the history
…e should have two branches per env
  • Loading branch information
ozten committed Jan 27, 2011
1 parent de1f1e8 commit 0f91632
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions bin/update_site.py
Expand Up @@ -17,10 +17,15 @@
from textwrap import dedent
from optparse import OptionParser

# Constants
PROJECT = 0
VENDOR = 1

ENV_BRANCH = {
'dev': 'master', # make this base if you are working on base
'stage': 'master',
'prod': 'prod',
# 'environment': [PROJECT_BRANCH, VENDOR_BRANCH],
'dev': ['base', 'master'],
'stage': ['master', 'master'],
'prod': ['prod', 'master'],
}

GIT_PULL = "git pull -q origin %(branch)s"
Expand All @@ -35,11 +40,12 @@ def update_site(env, debug):
"""Run through commands to update this site."""
error_updating = False
here = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
branch = {'branch': ENV_BRANCH[env]}
project_branch = {'branch': ENV_BRANCH[env][PROJECT]}
vendor_branch = {'branch': ENV_BRANCH[env][VENDOR]}

commands = [
(CHDIR, here),
(EXEC, GIT_PULL % branch),
(EXEC, GIT_PULL % project_branch),
(EXEC, GIT_SUBMODULE),
]

Expand All @@ -59,7 +65,7 @@ def update_site(env, debug):

commands += [
(CHDIR, os.path.join(here, 'vendor')),
(EXEC, GIT_PULL % branch),
(EXEC, GIT_PULL % vendor_branch),
(EXEC, GIT_SUBMODULE),
(CHDIR, os.path.join(here)),
(EXEC, 'python vendor/src/schematic/schematic migrations/'),
Expand Down

0 comments on commit 0f91632

Please sign in to comment.