Skip to content

Instantly share code, notes, and snippets.

@cheapsteak
Last active August 29, 2015 14:25
Show Gist options
  • Save cheapsteak/89385db1c5804d3724e1 to your computer and use it in GitHub Desktop.
Save cheapsteak/89385db1c5804d3724e1 to your computer and use it in GitHub Desktop.
Workflow with Dploy.io (now DeployBot)

DeployBot:

  • Allows anyone to deploy without giving them server credentials
  • Ease of rollbacks
    image

Method 1: Check in compiled code

  1. Make sure working directory is clean (all changes committed or stashed)
  2. Checkout deploy/(dev|qa|staging|production)
  3. Pull origin
  4. Merge from previous branch
  5. Run build:(dev|qa|staging|production)
  6. Add, commit, push
  7. Checkout original branch

Problem:
Too many steps
Solution:
Automate with script
Problem:
Occasional merge conflicts

Method 1-b:

  1. Make sure working directory is clean
  2. Delete local branch deploy/(dev|qa|staging|production)
  3. Create local branch deploy/(dev|qa|staging|production)
  4. Merge from previous branch
  5. Run build:(dev|qa|staging|production)
  6. Add, commit, force push
  7. Checkout original branch

No more merge conflicts

Method 2: Post-deploy commands

Don't commit compiled files, use "cached build commands" to compile code upon deployment. image

Cons:

Compilation happens post-deployment -
If updated gulpfile or package.json breaks compilation (would require someone to negligently deploy without running their code), you won't know about it breaking.

Method 3: Atomic SFTP (Beta)

Compile code in separate Docker instance hosted on DeployBot If compilation fails it won't deploy.

Cons:

npm install and build commands currently run very very slowly, due to

  1. the vm being much less powerful than our servers
  2. running a fresh instance each time so no node_modules are cached
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment