Skip to content

Instantly share code, notes, and snippets.

@DaveHudson
Created July 11, 2014 06:32
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save DaveHudson/d75c13a611ecc729c0c1 to your computer and use it in GitHub Desktop.
Save DaveHudson/d75c13a611ecc729c0c1 to your computer and use it in GitHub Desktop.
Grunt.js + Installr API
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
installr_settings: {
releaseNotes: grunt.file.read("./CHANGELOG.txt")
},
titanium: {
build_ios: { // build for ios first
options: {
command: 'build',
projectDir: './', // set project dir to root of grunt.js file
platform: 'ios',
buildOnly: true, // ensure buildOnly otherwise iOS simulator starts
target: 'dist-adhoc', // ensure building for adhoc profile
distributionName: 'YOUR DIST NAME (ID)', // add your iOS dist cert details
ppUuid: 'YOUR PROVISIONING PROFILE', // add your iOS Provisioning Profile
outputDir: './dist' // optionally set a output dir (we use this to find file when uploading to installr)
}
},
build_android: { // then build for Android
options: {
command: 'build',
projectDir: './', // set project dir to root of grunt.js file
platform: 'android',
buildOnly: true // ensure buildOnly otherwise Android emulator starts
}
}
},
shell: {
installr_ios: { // upload iOS App to installr
options: {
stdout: true
},
command: [
"curl -H 'X-InstallrAppToken: YOUR_INSTARLLR_API_TOKEN' https://www.installrapp.com/apps.json " + // Insert your Installr API Token
"-F 'qqfile=@./dist/YOURAPPNAME.ipa' " + // Insert your IPA file name
"-F 'releaseNotes=<%= installr_settings.releaseNotes %>' " + // release notes pulled from installr_settings above
"-F 'notify=true'"
].join("&&")
},
installr_android: { // upload Android App to installr
options: {
stdout: true
},
command: [
"curl -H 'X-InstallrAppToken: YOUR_INSTALLR_API_TOKEN' https://www.installrapp.com/apps.json " + // Insert your Installr API Token
"-F 'qqfile=@./build/android/bin/YOURAPPNAME.apk' " + // Insert your IPA file name
"-F 'releaseNotes=<%= installr_settings.releaseNotes %>' " + // release notes pulled from installr_settings above
"-F 'notify=true'"
].join("&&")
}
},
});
// Load plugins
grunt.loadNpmTasks('grunt-titanium');
grunt.loadNpmTasks('grunt-shell');
grunt.registerTask('default', ['titanium', 'shell']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment