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
ARCHIVE_DIR=archive | |
ARCHIVE_NAME=archive.tgz | |
all: clean | |
tar -czvf ${ARCHIVE_NAME} --exclude ${ARCHIVE_NAME} -C ../ $${PWD##*/} | |
mkdir -p ${ARCHIVE_DIR} | |
mv ${ARCHIVE_NAME} ${ARCHIVE_DIR} | |
clean: | |
rm -rf ${ARCHIVE_DIR} | |
find . -name "*~" -delete |
If you put this in the root of your application and run "make", an archive of the entire application will be stored in archive/archive.tgz. Now you probably want to password protect this resource so add the following in your app.yaml file:
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
- url: /archive | |
static_dir: archive | |
login: admin |
Now if you go to http://yourapp.appspot.com/archive/archive.tgz you'll be prompted to login to download the source archive.
Don't ask me how long it took me to figure out I needed to use two dollar signs on the fancy parameter substitution $${PWD##*/} because it is a shell variable and not a make variable -- really, don't ask.
Excellent idea! Used it as soon as I found it. Because I don't like Makefiles however, and I'm also on a Mac (which means that tar includes ._ files when creating the archive), I created a shell script that does the same job, using pretty much all of the code you posted here and a bit more :)
ReplyDeleteThanks!
Make!? Really?
ReplyDeleteDo you have any mercy on windows (DOS) users ?
ReplyDelete@Common Man - no, I greatly disdain them and have no mercy on their souls.
ReplyDeleteJust kidding.
You could probably write a batch file for this if you are good with dos batch files - not my thing.