Skip to content

Instantly share code, notes, and snippets.

@christianplazas-wf
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christianplazas-wf/40a5570bea22a00ba10c to your computer and use it in GitHub Desktop.
Save christianplazas-wf/40a5570bea22a00ba10c to your computer and use it in GitHub Desktop.
Christian's multiple bigsky environment recipe

Multiple BigSky Env Setup

Background

Following these instructions will allow you to create multiple totally isolated bigsky environments. Each environment will have its own: local git repo, local maven repo, python virtual environment and Intellij project. After initial setup no special commands will have to be run to switch configurations. The only thing you need to remember is to type workon <virtual env name> to activate the isolated enviroment.

A few of drawbacks to this approach are:

  • Extra disk space use for each environment - additional space used for separate python virtualenv and maven local repo
  • You have to remember to do pip install ... in each environment
  • Initial environment creation can take a bit of extra time since the local maven repo and virtual env have to be initialized

Steps

  1. Modify ~/.m2/settings.xml to parametize the maven local repo location.
  • <localRepository>${env.MAVEN_LOCAL_REPO}</localRepository>
  1. Modify ~/.bash_profile to set default MAVEN_LOCAL_REPO
  • export MAVEN_LOCAL_REPO=$HOME/.m2/repository
  1. Add virtualenv hooks for postactivate and predeactivate. This will make maven use a different local repository for each virtual environment whose project directory contains a pom.xml
  • edit $WORKON_HOME/postactivate:
    if [ -e $PWD/pom.xml ]; then
        export MAVEN_LOCAL_REPO=$PWD.project/maven-local-repo
    fi
  • edit $WORKON_HOME/predeactivate:
  export MAVEN_LOCAL_REPO=$HOME/.m2/repository
  1. Clone any number of bigsky repos and create a separate virtual environment for each clone using a command similar to this:
  cd <BIGSKY-CLONE-DIR> && mkvirtualenv <ENV-NAME> -a $PWD
  1. Do the following in each bigsky clone to ensure everything is working
  • mkdir datastore
  • cp settingslocal.py.dev settingslocal.py
  • cp build-user.propertes.mac build-user.properties
  • edit build-user.properties to update the path to the support directory
  • git submodule update --init
  • pip install -U setuptools
  • export CFLAGS=-Qunused-arguments
  • export CPPFLAGS=-Qunused-arguments
  • pip install -r requirements_dev.txt
  • tools/build/mvn/flex.sh
  1. Add your new bigsky clones to SourceTree and update their configuration to add any necessary remotes (ex. upstream, codebuilders)

  2. Create an IntelliJ project for each clone using maven integration

    • update maven settings in the project to override the maven home directory and local repository
    • add any desired run configurations (ex. flex debug, python debug)
  3. Repeat steps 4 - 7 for any future bigsky clones you would like to use

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