{"_id":"56d1f33900a2a70b00b3659d","user":"5526ca4cf69851170038b496","category":{"_id":"56d1f33900a2a70b00b36594","pages":["56d1f33900a2a70b00b3659b","56d1f33900a2a70b00b3659c","56d1f33900a2a70b00b3659d","56d1f33900a2a70b00b3659e","56d1f33900a2a70b00b3659f","56d1f33900a2a70b00b365a0","56d1f33900a2a70b00b365a1","56d1f33900a2a70b00b365a2","56d1f33900a2a70b00b365a3","56d1f33900a2a70b00b365a4","56d1f33900a2a70b00b365a5","56d1f33900a2a70b00b365a6","56d1f33900a2a70b00b365a7","56d1f33900a2a70b00b365a8","56d1f33900a2a70b00b365a9"],"__v":1,"project":"5526c95cf69851170038b48f","version":"56d1f33700a2a70b00b3658e","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-04-10T15:43:37.809Z","from_sync":false,"order":4,"slug":"ionic-deploy","title":"Ionic Deploy"},"project":"5526c95cf69851170038b48f","version":{"_id":"56d1f33700a2a70b00b3658e","project":"5526c95cf69851170038b48f","__v":2,"createdAt":"2016-02-27T19:04:23.946Z","releaseDate":"2016-02-27T19:04:23.946Z","categories":["56d1f33900a2a70b00b3658f","56d1f33900a2a70b00b36590","56d1f33900a2a70b00b36591","56d1f33900a2a70b00b36592","56d1f33900a2a70b00b36593","56d1f33900a2a70b00b36594","56d1f33900a2a70b00b36595","56d1f33900a2a70b00b36596","56d1f33900a2a70b00b36597","56d1f33900a2a70b00b36598","56d1f33900a2a70b00b36599","56d1f33900a2a70b00b3659a","571f9497ada30c34003b7cee"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"beta","version_clean":"2.0.0-beta","version":"2.0.0-beta"},"__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-09-24T13:02:34.701Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Warning:\",\n  \"body\": \"If you're building your app with iOS9, deploys will fail to function correctly until you add an exclusion rule for AWS S3 servers. This is due to the introduction of the [App Transport Security](https://developer.apple.com/library/prerelease/ios/technotes/App-Transport-Security-Technote/). You can find instructions on how to add the appropriate exclusion rules [here](https://mobile.awsblog.com/post/Tx2QM69ZE6BGTYX/Preparing-Your-Apps-for-iOS-9)\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"This is a quick start guide, and therefore fairly brief. If something doesn't make sense, or you find yourself seeking more information about each step, head over to our [Setup](doc:deploy-install) guide.\",\n  \"title\": \"Note\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\"\n}\n[/block]\n## 1. Add the necessary components\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ ionic add ionic-platform-web-client\\n$ ionic plugin add ionic-plugin-deploy\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\"\n}\n[/block]\n## 2. Hook up with Ionic.io\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ ionic io init\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\"\n}\n[/block]\n## 3. Add some deploy code\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \".controller('DashCtrl', function($scope) {\\n\\n  var deploy = new Ionic.Deploy();\\n  \\n  // Update app code with new release from Ionic Deploy\\n  $scope.doUpdate = function() {\\n    deploy.update().then(function(res) {\\n      console.log('Ionic Deploy: Update Success! ', res);\\n    }, function(err) {\\n      console.log('Ionic Deploy: Update error! ', err);\\n    }, function(prog) {\\n      console.log('Ionic Deploy: Progress... ', prog);\\n    });\\n  };\\n\\n  // Check Ionic Deploy for new code\\n  $scope.checkForUpdates = function() {\\n    console.log('Ionic Deploy: Checking for updates');\\n    deploy.check().then(function(hasUpdate) {\\n      console.log('Ionic Deploy: Update available: ' + hasUpdate);\\n      $scope.hasUpdate = hasUpdate;\\n    }, function(err) {\\n      console.error('Ionic Deploy: Unable to check for updates', err);\\n    });\\n  }\\n\\n});\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\"\n}\n[/block]\n## 4. Add some elements to interact with\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<button class=\\\"button button-primary button-block \\\" ng-click=\\\"checkForUpdates()\\\">\\n  Check for updates\\n</button>\\n<button class=\\\"button button-stable button-block button-pulse\\\" ng-if=\\\"hasUpdate\\\" ng-click=\\\"doUpdate()\\\">\\n  download update\\n</button>\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\"\n}\n[/block]\n## 5. Upload & Deploy a new version of your app\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ ionic upload --note \\\"new version\\\" --deploy=production\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"--deploy\",\n  \"body\": \"During development, it's fine to deploy using the CLI `--deploy` flag, but for production deploys, you may want to omit the flag from your upload command so you can set binary versions and other options via the app dashboard. The [Deploying Updates](http://docs.ionic.io/docs/deploy-deploying-updates) section has more information on deploying your uploads.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Success\",\n  \"body\": \"Run your app, and you should have an update available.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\"\n}\n[/block]\n## Next Steps\n\nReady to learn more? Check out our [deploy usage](doc:deploy-usage) guide.","excerpt":"Quickly get up and running with Ionic Deploy","slug":"deploy-quick-start","type":"basic","title":"Quick Start"}

Quick Start

Quickly get up and running with Ionic Deploy

[block:callout] { "type": "danger", "title": "Warning:", "body": "If you're building your app with iOS9, deploys will fail to function correctly until you add an exclusion rule for AWS S3 servers. This is due to the introduction of the [App Transport Security](https://developer.apple.com/library/prerelease/ios/technotes/App-Transport-Security-Technote/). You can find instructions on how to add the appropriate exclusion rules [here](https://mobile.awsblog.com/post/Tx2QM69ZE6BGTYX/Preparing-Your-Apps-for-iOS-9)" } [/block] [block:callout] { "type": "info", "body": "This is a quick start guide, and therefore fairly brief. If something doesn't make sense, or you find yourself seeking more information about each step, head over to our [Setup](doc:deploy-install) guide.", "title": "Note" } [/block] [block:api-header] { "type": "basic" } [/block] ## 1. Add the necessary components [block:code] { "codes": [ { "code": "$ ionic add ionic-platform-web-client\n$ ionic plugin add ionic-plugin-deploy", "language": "shell" } ] } [/block] [block:api-header] { "type": "basic" } [/block] ## 2. Hook up with Ionic.io [block:code] { "codes": [ { "code": "$ ionic io init", "language": "shell" } ] } [/block] [block:api-header] { "type": "basic" } [/block] ## 3. Add some deploy code [block:code] { "codes": [ { "code": ".controller('DashCtrl', function($scope) {\n\n var deploy = new Ionic.Deploy();\n \n // Update app code with new release from Ionic Deploy\n $scope.doUpdate = function() {\n deploy.update().then(function(res) {\n console.log('Ionic Deploy: Update Success! ', res);\n }, function(err) {\n console.log('Ionic Deploy: Update error! ', err);\n }, function(prog) {\n console.log('Ionic Deploy: Progress... ', prog);\n });\n };\n\n // Check Ionic Deploy for new code\n $scope.checkForUpdates = function() {\n console.log('Ionic Deploy: Checking for updates');\n deploy.check().then(function(hasUpdate) {\n console.log('Ionic Deploy: Update available: ' + hasUpdate);\n $scope.hasUpdate = hasUpdate;\n }, function(err) {\n console.error('Ionic Deploy: Unable to check for updates', err);\n });\n }\n\n});", "language": "javascript" } ] } [/block] [block:api-header] { "type": "basic" } [/block] ## 4. Add some elements to interact with [block:code] { "codes": [ { "code": "<button class=\"button button-primary button-block \" ng-click=\"checkForUpdates()\">\n Check for updates\n</button>\n<button class=\"button button-stable button-block button-pulse\" ng-if=\"hasUpdate\" ng-click=\"doUpdate()\">\n download update\n</button>", "language": "html" } ] } [/block] [block:api-header] { "type": "basic" } [/block] ## 5. Upload & Deploy a new version of your app [block:code] { "codes": [ { "code": "$ ionic upload --note \"new version\" --deploy=production", "language": "shell" } ] } [/block] [block:callout] { "type": "info", "title": "--deploy", "body": "During development, it's fine to deploy using the CLI `--deploy` flag, but for production deploys, you may want to omit the flag from your upload command so you can set binary versions and other options via the app dashboard. The [Deploying Updates](http://docs.ionic.io/docs/deploy-deploying-updates) section has more information on deploying your uploads." } [/block] [block:api-header] { "type": "basic" } [/block] [block:callout] { "type": "success", "title": "Success", "body": "Run your app, and you should have an update available." } [/block] [block:api-header] { "type": "basic" } [/block] ## Next Steps Ready to learn more? Check out our [deploy usage](doc:deploy-usage) guide.