Need help with setting up pipeline

Hey I’m pretty new to CI/CD and wanted to get into it with Drone. However I’m having some difficulties setting up my pipeline. I’m using a Docker runner for this btw.

Basically what I want to achieve is have my VueJS app deployed to my webhost (GCE). So I have everything set up and the Docker GO image example works fine. However when I try to build my VueJS app I keep getting a package.json file not found problem.

Here is my yaml file:

kind: pipeline
type: docker
steps:
- name: deploy
  image: node:latest
  commands:
    - npm install
    - npm run serve

So by looking at my logs I get this error

npm WARN saveError ENOENT: no such file or directory, open ‘/drone/src/package.json’

So with this I have couple questions:

  1. I also have the exec runner installed to and can’t seem to make execute any commands like mkdir, so is there like a root folder this runs on? I couldn’t find any of the files/directories I made as a test anyways
  2. How can I just build the image with my own Dockerfile instead of pulling it from the registry
  3. How can I also execute commands to run the image as a container as well

Yaml examples will be much appreciated, Thanks!

bump need some help on this thanks, additionally would like to know how to deploy a docker container to my webhost or how to deploy using exec runner. Thanks!

npm WARN saveError ENOENT: no such file or directory, open ‘/drone/src/package.json’

The error states the package.json file the does not exist. So I think the first step to debug would be to prove the the file does in fact exist:

kind: pipeline
type: docker
steps:
  - name: deploy
    image: node:latest
    commands:
+     - ls -la
+     - ls -la package.json
      - npm install
      - npm run serve

also as an aside, I am wondering why you want to npm run serve since this is typically a blocking command and would block your entire pipeline, causing it to eventually timeout, and the pipeline to fail.