last Thursday I sent this directly to Chad on accident and he was nice
enough to forward it back to me for re-posting to the list.
We have the same situation on my site. We're a rails back-end with
flash/flex front-ends. It seems like there might be 2 issues here. 1
is getting the build files of your app out of your rails project and 2
deploying the final generated swfs to the rails project.
Our approach is we have 2 completely separate repositories. 1 for our
flex stuff, 1 for our rails stuff (we actually have more than 2, but
for simplicity assume 2).
In development mode we setup directories like so:
flash/flash_project_and_all_build_files
rails/app
rails/public
...
When building our swfs we set the tools (FlexBuilder for us) to put
the swf in rails/public. We do not store our development swfs in
version control. If you're going to use git, you don't want to do
this. Assuming they change frequently and are committed frequently,
you're going to end up with a ginormous repository. It's a pain.
When deploying to production our process then is (we automated this
with cap):
1. Checkout the production branch in rails
2. Build the latest swf from flash
3. Copy it into rails/public
4. Commit it to that branch
5. Push the production branch (which has the swf in it)
Personally, I'm hoping to move away from even committing a production
swf to our rails source (you can always rebuild it if you need it) and
instead just have part of the deployment either copy the swf to the
production box, or push it to s3 and serve it from there (have to deal
with some cross-domain stuff then).
This process works pretty well for us and leaves us with a lean-mean
rails repo with a fast deployment.
Another option here is git submodules. Also, you can clone 1 git repo
into another if you want your flash files in your rails dev directory,
but are willing to do commits separately.
git clone ..rails.git rails/
cd rails/
git clone flash.git flash/
echo flash >> .gitignore
will set you up with
rails
rails/flash
Completely different option:
When deploying, in cap, if you use the remote_cache strategy you can
set :copy_exclude, to exclude particular files from your deployment.
If you can keep your flash development files all together in say
rails/
flash-dev all you'd have to do is:
set :copy_exclude, ['rails/flash-dev'] and they won't be in your
releases.