Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Add --path argument to container:push #75

Closed
wants to merge 7 commits into from

Conversation

eduardocardoso
Copy link

Fixes #74

@eduardocardoso eduardocardoso requested a review from a team June 15, 2018 18:57
@codecov-io
Copy link

codecov-io commented Jun 15, 2018

Codecov Report

Merging #75 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #75   +/-   ##
=======================================
  Coverage   87.45%   87.45%           
=======================================
  Files          12       12           
  Lines         287      287           
=======================================
  Hits          251      251           
  Misses         36       36
Impacted Files Coverage Δ
commands/push.js 100% <100%> (ø) ⬆️
lib/sanbashi.js 63.63% <100%> (ø) ⬆️

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 27c880c...eb9e698. Read the comment docs.

Copy link

@dmathieu dmathieu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very good idea, thank you.

lib/sanbashi.js Outdated
let cwd = Path.dirname(dockerfile)
if (path) {
cwd = Path.join(process.cwd(), path)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sanbashi shouldn't use process.cwd(). If we need an absolute path here, it should be passed upstream.
Also, what if I do pass an absolute path to the command?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think an absolute path is needed here. I'll just pass whatever comes on --path as an arg to docker build

commands/push.js Outdated
@@ -15,7 +15,8 @@ module.exports = function (topic) {
`${cli.color.cmd('heroku container:push worker')} # Pushes Dockerfile to worker process type`,
`${cli.color.cmd('heroku container:push web worker --recursive')} # Pushes Dockerfile.web and Dockerfile.worker`,
`${cli.color.cmd('heroku container:push --recursive')} # Pushes Dockerfile.*`,
`${cli.color.cmd('heroku container:push web --arg ENV=live,HTTPS=on')} # Build-time variables`
`${cli.color.cmd('heroku container:push web --arg ENV=live,HTTPS=on')} # Build-time variables`,
`${cli.color.cmd('heroku container:push --recursive --path .')} # Pushes Dockerfile.* using current dir as build context`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure we should give an example for every option. @heroku/cli wdyt?

commands/push.js Outdated
@@ -33,6 +34,12 @@ module.exports = function (topic) {
name: 'arg',
hasValue: true,
description: 'set build-time variables'
},
{
name: 'path',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--path is a bit obscure IMHO. I'd name this --context, or maybe even --context-path.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, will change to --context-path

@dmathieu
Copy link

Could you add a test for the command as well?
https://github.com/heroku/heroku-container-registry/blob/master/test/commands/push.js#L55

@dmathieu dmathieu requested a review from a team June 18, 2018 14:29
jdx added a commit to heroku/cli that referenced this pull request Jun 19, 2018
@jdx jdx closed this Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants