aptible / aptible-cli

Command line interface to Aptible
MIT License
28 stars 35 forks source link

Introduce aptible deploy (Direct Docker Deploy) #230

Closed krallin closed 7 years ago

krallin commented 7 years ago

This command can be used in a few ways by customers:

First, it can be used to update an app to deploy from a Docker image (or update its current Docker image), as well as set environment variables.

aptible deploy --app foobar --docker-image httpd:alpine FOO=BAR

When this is done, the app's Dockerfile will be ignored going forward. However, other repo files might still influence the deploy.

Specifically, there are two possible cases:

It's also possible to completely remove the link to the git repo. When that's done, the files found in the git repo will be ignored going forward.

aptible deploy --app foobar --git-detach

But that's not all! It's also possible to go back to having a git repo without a git push.

This is useful since a git push may not trigger a deploy if there are no changes)

aptible deploy --app foobar --git-commitish master

Finally, it's possible to remove the app's Docker image to go back to a Dockerfile build, albeit with a non-ideal syntax for now:

aptible deploy --app foobar APTIBLE_DOCKER_IMAGE=

cc @fancyremarker @UserNotFound

codecov-io commented 7 years ago

Codecov Report

Merging #230 into master will increase coverage by 0.74%. The diff coverage is 99.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #230      +/-   ##
==========================================
+ Coverage   92.84%   93.58%   +0.74%     
==========================================
  Files          46       48       +2     
  Lines        1719     1856     +137     
==========================================
+ Hits         1596     1737     +141     
+ Misses        123      119       -4
Impacted Files Coverage Δ
lib/aptible/cli/subcommands/deploy.rb 100% <100%> (ø)
spec/aptible/cli/subcommands/apps_spec.rb 100% <100%> (ø) :arrow_up:
lib/aptible/cli/agent.rb 97.14% <100%> (+0.05%) :arrow_up:
lib/aptible/cli/helpers/app.rb 100% <100%> (ø) :arrow_up:
spec/aptible/cli/subcommands/deploy_spec.rb 100% <100%> (ø)
lib/aptible/cli/subcommands/config.rb 69.56% <75%> (+10.47%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d8eb2d5...b170493. Read the comment docs.

UserNotFound commented 7 years ago

I think this excellent, and will add a lot of flexibility without needlessly increasing complexity.

fancyremarker commented 7 years ago

This was really intuitive. One minor comment:

Finally, it's possible to remove the app's Docker image to go back to a Dockerfile build, albeit with a non-ideal syntax for now:

aptible deploy --app foobar APTIBLE_DOCKER_IMAGE=

I initially expected to run aptible deploy --app foobar --docker-image "" to achieve this, but that may just be me. Take with a grain of salt.

krallin commented 7 years ago

@fancyremarker

This was really intuitive. One minor comment:

Finally, it's possible to remove the app's Docker image to go back to a Dockerfile build, albeit with a non-ideal syntax for now: aptible deploy --app foobar APTIBLE_DOCKER_IMAGE= I initially expected to run aptible deploy --app foobar --docker-image "" to achieve this, but that may just be me. Take with a grain of salt.

That actually works too, but I'm inclined to call it a non-ideal syntax too... :)

krallin commented 7 years ago

Planning to release this tomorrow morning UTC (once the server-side bits are live, which they aren't just now).