Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify folder to use #26

Closed
spences10 opened this issue Jan 8, 2018 · 9 comments
Closed

Specify folder to use #26

spences10 opened this issue Jan 8, 2018 · 9 comments

Comments

@spences10
Copy link

spences10 commented Jan 8, 2018

Hi, I'm using the - DEBUG=now-pipeline now-pipeline script trying to get to grips with this tool

From the output here:

Mon, 08 Jan 2018 09:19:36 GMT now-pipeline [ 'package.json',
  '.npmignore',
  'README.md',
  'LICENSE',
  'gatsby-config.js',
  'gatsby-browser.js',
  'gatsby-node.js',
  'gatsby-ssr.js',
  '.travis.yml',
  'src/layouts/index.js',
  'src/layouts/components/Button.js',
  ....

I'm still not completely clear on what the command now-pipeline does, because the output appears to be reading from the root of the project and I want to only deploy the public folder in my Gatsby project I'm cd'ing to that folder then running the now-pipeline command and getting errors because there's no package.json 🤷‍♂️

There shouldn't be a package.json it's a static site, does that need to be configured as well?

It's not the clearest on how to use, even with the README.md

@spences10
Copy link
Author

Ok, so I thought I could pass the /public/ folder to now-pipeline as I'm presuming that now-pipeline is the same as now from the terminal on my machine, so I was hoping that I could do that, here's my .travis.yml

sudo: false

language: node_js

cache:
  directories:
    - node_modules

notifications:
  email: false

node_js:
  - '9'

before_script:
  - npm prune

script:
  - npm run build
  # - cd public
  - npm i -g now-pipeline
  - touch .npmignore
  - DEBUG=now-pipeline now-pipeline /public/

  # - now-pipeline --test "npm run deploy"
  # - now-pipeline-list

  # - npm i -g now-pipeline
  # - now-pipeline-prune
  # - now-pipeline 'npm run deploy'
  # - now-pipeline --alias scottspence.now.sh

# after_success:

And I have the output for it here it seems to be deploying the whole project, well that's what I'm gleaning from now-pipeline deploying 480 files:

4.97s$ DEBUG=now-pipeline now-pipeline /public/
Mon, 08 Jan 2018 10:53:10 GMT now-pipeline deploying 480 files
Mon, 08 Jan 2018 10:53:10 GMT now-pipeline [ 'package.json',
....

@wulfmann
Copy link
Contributor

wulfmann commented Jan 8, 2018

Yea now-pipeline is not the same as the cl tool.

@bahmutov Is this something you'd be interested in supporting? I believe I have a way to add this feature with very minimal changes. I have a pretty solid grasp on the flow of this but obviously you know more than I do. From the zeit docs this seems like it would be valid. So if you want I can put up another PR so you can my thoughts. If not just let me know.

@bahmutov
Copy link
Owner

bahmutov commented Jan 8, 2018 via email

@wulfmann
Copy link
Contributor

wulfmann commented Jan 8, 2018

Added a new PR for your review and changes! Open to all thoughts.

@spences10
Copy link
Author

Hi @wulfmann

I've tried this with now-pipeline --dir /public/ then I tried with - DEBUG=now-pipeline dir /public/ and got the following error in the output [here] if you're interested, here's a nice pic of it as well 😄

image

So from the error message and looking at the PR merged does the arg need to have the -- in it?

I'm now going to try - DEBUG=now-pipeline dir /public/ then if that fails I'll try specify the version of now-pipeline to use in the .travis.yaml

here: https://travis-ci.org/spences10/blog.scottspence.me/builds/327671010

@spences10
Copy link
Author

No none of the variations does anything when specifying a directory it always results in the previously pictured error message

@wulfmann
Copy link
Contributor

I will take a look at this tonight. Is there any chance you could share your directory structure and package.json so I can recreate?

@spences10
Copy link
Author

Hi @wulfmann, I changed over to the zeit example eventually, folder structure is here, and here is my package.json

The clean and build script are unchanged which is what was being used by now-pipeline as it seems that it's only me that's having this issue I'm happy to close this.

Thanks

@wulfmann
Copy link
Contributor

@spences10 Yes that would be great if you could close this one. I'm still looking into the other issue with the deploy, but since this is isolated and you feel good about it, go ahead and close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants