Skip to content

Commit

Permalink
chore(travis): add irc task, simplify tweet task
Browse files Browse the repository at this point in the history
  • Loading branch information
ajoslin committed Apr 30, 2014
1 parent 920dc59 commit d9680b9
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 13 deletions.
15 changes: 14 additions & 1 deletion config/build.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
var pkg = require('../package.json');

module.exports = {
dist: 'dist',
distJs: 'dist/js',
Expand Down Expand Up @@ -93,5 +95,16 @@ module.exports = {
'dist/js/angular/angular-sanitize.js',
'dist/js/angular-ui/angular-ui-router.js',
'dist/js/ionic-angular.js'
]
],

exclamations: [
"Aah","Ah","Aha","All right","Aw","Ay","Aye","Bah","Boy","By golly","Boom","Cheerio","Cheers","Come on","Crikey","Dear me","Egads","Fiddle-dee-dee","Gadzooks","Gangway","G'day","Gee whiz","Gesundheit","Get outta here","Gosh","Gracious","Great","Gulp","Ha","Ha-ha","Hah","Harrumph","Hey","Hooray","Hurray","Huzzah","I say","Look","Look here","Long time","Lordy","Most certainly","My my","My word","Oh","Oh-oh","Oh no","Okay","Okey-dokey","Ooh","Oye","Phew","Quite","Ready","Right on","Roger that","Rumble","Say","See ya","Snap","Sup","Ta-da","Take that","Tally ho","Thanks","Toodles","Touche","Tut-tut","Very nice","Very well","Voila","Vroom","Well done","Well, well","Whoa","Whoopee","Whew","Word up","Wow","Wuzzup","Ya","Yea","Yeah","Yippee","Yo","Yoo-hoo","You bet","You don't say","You know","Yow","Yum","Yummy","Zap","Zounds","Zowie"
],

releaseMessage: function() {
return this.exclamations[Math.floor(Math.random()*this.exclamations.length)] + '! ' +
'Just released @IonicFramework v' + pkg.version + ' "' + pkg.codename + '"! ' +
'https://github.com/driftyco/ionic/releases/tag/v' + pkg.version;
},

};
35 changes: 26 additions & 9 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ var connect = require('connect');
var dgeni = require('dgeni');
var es = require('event-stream');
var htmlparser = require('htmlparser2');
var irc = require('ircb');
var lunr = require('lunr');
var marked = require('marked');
var mkdirp = require('mkdirp');
var twitter = require('node-twitter-api');
var yaml = require('js-yaml');

var http = require('http');
Expand All @@ -31,7 +33,6 @@ var rename = require('gulp-rename');
var sass = require('gulp-sass');
var stripDebug = require('gulp-strip-debug');
var template = require('gulp-template');
var twitter = require('gulp-twitter');
var uglify = require('gulp-uglify');
var gutil = require('gulp-util');

Expand Down Expand Up @@ -200,20 +201,36 @@ gulp.task('version', function() {
.pipe(gulp.dest('dist'));
});

gulp.task('tweet', function() {
gulp.task('release-tweet', function(done) {
var oauth = {
consumerKey: process.env.TWITTER_CONSUMER_KEY,
consumerSecret: process.env.TWITTER_CONSUMER_SECRET,
accessToken: process.env.TWITTER_ACCESS_TOKEN,
accessTokenSecret: process.env.TWITTER_ACCESS_TOKEN_SECRET
};
var exclamations = ["Aah","Ah","Aha","All right","Aw","Ay","Aye","Bah","Boy","By golly","Boom","Cheerio","Cheers","Come on","Crikey","Dear me","Egads","Fiddle-dee-dee","Gadzooks","Gangway","G'day","Gee whiz","Gesundheit","Get outta here","Good golly","Good job","Gosh","Gracious","Great","Gulp","Ha","Ha-ha","Hah","Hallelujah","Harrumph","Hey","Hooray","Hot dog","Hurray","Huzza","I say","La-di-dah","Look","Look here","Long time","Lordy","Most certainly","My my","My word","Oh","Oho","Oh-oh","Oh no","Okay","Okey-dokey","Ooh","Oye","Phew","Quite","Ready","Right on","Roger that","Rumble","Say","See ya","Snap","Sup","Ta-da","Take that","Tally ho","Thanks","Toodles","Touche","Tut-tut","Very nice","Very well","Voila","Vroom","Well done","Well, well","Whoa","Whoopee","Whew","Word up","Wow","Wuzzup","Ya","Yea","Yeah","Yippee","Yo","Yoo-hoo","You bet","You don't say","You know","Yow","Yum","Yummy","Zap","Zounds","Zowie"];
if(IS_RELEASE_BUILD && argv.codeversion && argv.codename) {
var tweet = exclamations[Math.floor(Math.random()*exclamations.length)]+'! Just released @IonicFramework '+argv.codename+' v'+argv.codeversion+' https://github.com/driftyco/ionic/releases/tag/v'+argv.codeversion;
console.log(tweet);
return gulp.src('package.json')
.pipe(twitter(oauth, tweet));
}
var client = new twitter(oauth);
client.statuses(
'update',
{ status: buildConfig.releaseMessage() },
oauth.accessToken,
oauth.accessTokenSecret,
done
);
});

gulp.task('release-irc', function(done) {
var client = irc({
host: 'irc.freenode.net',
secure: true,
nick: 'ionitron',
username: 'ionitron',
realName: 'ionitron',
channels: ['#ionic']
}, function() {
client.say('#ionic', buildConfig.releaseMessage(), function() {
client.quit('', done);
});
});
});

gulp.task('docs-index', function() {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@
"event-stream": "3.1.0",
"gulp-strip-debug": "^0.3.0",
"gulp-footer": "^1.0.4",
"gulp-twitter": "0.0.3",
"marked": "^0.3.2"
"marked": "^0.3.2",
"ircb": "^0.3.1",
"node-twitter-api": "^1.2.2"
},
"licenses": [
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/travis/release-new-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function run {

echo "-- v$VERSION \"$CODENAME\" pushed to $RELEASE_REMOTE/master successfully!"

gulp tweet --release --codeversion "$VERSION" --codename "$CODENAME"
gulp release-tweet release-irc
}

source $(dirname $0)/../utils.inc

0 comments on commit d9680b9

Please sign in to comment.