Created
December 27, 2015 05:31
-
-
Save gullitmiranda/e34ad001c739e5880c4d to your computer and use it in GitHub Desktop.
azk deploy with multiple enviroments
This file contains hidden or 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
| /** | |
| * Documentation: http://docs.azk.io/Azkfile.js | |
| */ | |
| var name = "app"; | |
| var ENV = env.DEPLOY_ENV || "stage"; | |
| var PATH = name + "-" + ENV; | |
| var project = (ENV == "prod") ? name : name + "-" + ENV; | |
| var host = (function() { | |
| var prefix = (ENV == "prod") ? "app" : (name + "-" + ENV); | |
| return prefix + "." + domain; | |
| })(); | |
| var HOST_DOMAIN = env.HOST_DOMAIN || host; | |
| // Adds the systems that shape your system | |
| systems({ | |
| /* DEVELOPMENT */ | |
| 'app': { | |
| // ... | |
| http: { | |
| domains: [ | |
| "#{system.name}.#{azk.default_domain}", | |
| HOST_DOMAIN, | |
| "#{env.HOST_IP}", | |
| ] | |
| }, | |
| }, | |
| postgres: { | |
| // ... | |
| }, | |
| /* Deploy */ | |
| // to deploy in STAGE run: `azk deploy` | |
| // to deploy in PROD run: `DEPLOY_ENV=prod azk deploy` | |
| deploy: { | |
| image: {"docker": "azukiapp/deploy-digitalocean:0.0.2"}, | |
| mounts: { | |
| "/azk/deploy/src" : path("."), | |
| "/azk/deploy/.ssh" : path("#{env.HOME}/.ssh"), | |
| "/azk/deploy/.config": persistent("deploy-config"), | |
| }, | |
| scalable: {"default": 0, "limit": 0}, | |
| envs: { | |
| // BOX_NAME : BOX_NAME, | |
| BOX_BACKUP : true, | |
| REMOTE_PROJECT_PATH_ID : project, | |
| HOST_DOMAIN : host, | |
| AZK_ENV : ENV, | |
| }, | |
| }, | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment