-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code updates for release, deployment scripts, etc
- Loading branch information
Showing
8 changed files
with
215 additions
and
15 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/** | ||
* NOTE: Alpaca uses Gulp for it's build process. Please take a look at the README.md file for instructions. | ||
* | ||
* This Grunt file provides official Alpaca version release and deployment assistance to the deploy.sh bash file. | ||
* It isn't needed for local Alpaca builds and should only be used by the Alpaca release manager. | ||
*/ | ||
module.exports = function(grunt) { | ||
|
||
var fs = require("fs"); | ||
var path = require("path"); | ||
|
||
grunt.loadNpmTasks('grunt-jsdoc'); | ||
grunt.loadNpmTasks('grunt-aws-s3'); | ||
grunt.loadNpmTasks('grunt-invalidate-cloudfront'); | ||
|
||
// register one or more task lists (you should ALWAYS have a "default" task list) | ||
grunt.registerTask('publish_cdn', ['aws_s3:clean', 'aws_s3:publish', 'invalidate_cloudfront:production']); | ||
|
||
var pkg = grunt.file.readJSON('package.json'); | ||
var awsConfig = grunt.file.readJSON("../settings/__aws.json"); | ||
|
||
var name = "alpaca"; | ||
|
||
// config | ||
grunt.initConfig({ | ||
|
||
"jsdoc": { | ||
"dist": { | ||
"src": [ | ||
"src/js/**/*.js", | ||
"README.md" | ||
], | ||
"options": { | ||
"destination": "./build/alpaca/jsdoc", | ||
"template": "node_modules/grunt-jsdoc/node_modules/ink-docstrap/template", | ||
"configure": "jsdoc.conf.json" | ||
} | ||
} | ||
}, | ||
|
||
"aws_s3": { | ||
"options": { | ||
"accessKeyId": awsConfig.key, | ||
"secretAccessKey": awsConfig.secret, | ||
"region": awsConfig.region, | ||
"uploadConcurrency": 5, | ||
"downloadConcurrency": 5 | ||
}, | ||
"clean": { | ||
"options": { | ||
"bucket": awsConfig.bucket | ||
}, | ||
"files": [{ | ||
"dest": path.join(name, pkg.version), | ||
"action": "delete" | ||
}] | ||
}, | ||
"publish": { | ||
"options": { | ||
"bucket": awsConfig.bucket | ||
}, | ||
"files": [{ | ||
"expand": true, | ||
"cwd": "dist/" + name, | ||
"src": ['**/*'], | ||
"dest": path.join(name, pkg.version) | ||
}] | ||
} | ||
}, | ||
|
||
"invalidate_cloudfront": { | ||
"options": { | ||
"key": awsConfig.key, | ||
"secret": awsConfig.secret, | ||
"distribution": awsConfig.cloudfrontDistributionIds[name] | ||
}, | ||
"production": { | ||
"files": [{ | ||
"expand": true, | ||
"cwd": "dist/" + name, | ||
"src": ["**/*"], | ||
"filter": "isFile", | ||
"dest": path.join(name, pkg.version) | ||
}] | ||
} | ||
} | ||
|
||
}); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,84 @@ | ||
#!/bin/bash | ||
VERSION="$(node server/version)" | ||
BRANCH="$VERSION-release" | ||
ZIP="alpaca-$VERSION.zip" | ||
|
||
cd deployment | ||
ant -f deploy.xml -lib jsch-0.1.50.jar | ||
cd .. | ||
echo Deploying version $VERSION | ||
|
||
|
||
# | ||
# SETUP | ||
# | ||
|
||
# switch to master branch | ||
# create a local branch <version>-release | ||
git checkout master | ||
git checkout -b $BRANCH | ||
|
||
|
||
|
||
|
||
# | ||
# STEP 1: BUILD ALPACA, WEB SITE JSDOCS AND DEPLOY TO CDN | ||
# | ||
|
||
# build alpaca | ||
# build web site | ||
# copy to dist (for bower) | ||
gulp default site dist | ||
|
||
# build jsdoc | ||
grunt jsdoc | ||
|
||
# add the ./dist directory to the commit | ||
git add ./dist | ||
|
||
# commit changes to local branch | ||
git commit -m "alpaca release build $VERSION" | ||
|
||
|
||
|
||
|
||
# | ||
# STEP 2: PUBLISH DISTRIBUTION FILES TO CDN | ||
# | ||
|
||
# publish alpaca to CDN | ||
grunt publish_dist | ||
|
||
|
||
|
||
# | ||
# STEP 3: PUBLISH WEB SITE | ||
# | ||
|
||
rm build/$ZIP | ||
cd build/site | ||
zip -r ../$ZIP * | ||
cd ../.. | ||
scp -i ~/keys/gitana.pem -r build/$ZIP ec2-user@alpacajs.org:/web/code/alpaca | ||
ssh -i ~/keys/gitana.pem ec2-user@alpacajs.org 'cd /web/code/alpaca; rm /web/code/alpaca/$VERSION; unzip /web/code/alpaca/$ZIP -d /web/code/alpaca/$VERSION' | ||
ssh -i ~/keys/gitana.pem ec2-user@alpacajs.org 'cd /web/code/alpaca; rm -r /web/code/alpaca/latest; unzip /web/code/alpaca/$ZIP -d /web/code/alpaca/latest' | ||
|
||
|
||
|
||
|
||
# | ||
# STEP 4: TAG REPO FOR BOWER | ||
# | ||
|
||
# create a tag | ||
#git tag $VERSION | ||
|
||
# push the tag | ||
#git push remote $BRANCH --tags | ||
|
||
|
||
|
||
|
||
# | ||
# TEARDOWN | ||
# | ||
|
||
# delete local branch | ||
git checkout master | ||
git branch -D $BRANCH |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"tags" : { | ||
"allowUnknownTags" : true | ||
}, | ||
"plugins" : ["plugins/markdown"], | ||
|
||
"templates" : { | ||
"cleverLinks" : false, | ||
"monospaceLinks" : false, | ||
"dateFormat" : "ddd MMM Do YYYY", | ||
"outputSourceFiles" : true, | ||
"outputSourcePath" : true, | ||
"systemName" : "Alpaca Forms", | ||
"footer" : "", | ||
"copyright" : "Copyright © 2014 Gitana Software, Inc.", | ||
"navType" : "vertical", | ||
"theme" : "cerulean", | ||
"linenums" : true, | ||
"collapseSymbols" : false, | ||
"inverseNav" : false, | ||
"highlightTutorialCode" : true, | ||
"protocol": "fred://" | ||
}, | ||
"markdown" : { | ||
"parser" : "gfm", | ||
"hardwrap" : true | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
var pkg = require("../package"); | ||
console.log(pkg.version); |
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
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