Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

nodejs-express: change back into /project dir at the end of build #697

Merged
merged 1 commit into from
Mar 4, 2020

Conversation

Kamran64
Copy link
Collaborator

@Kamran64 Kamran64 commented Mar 3, 2020

Checklist:

Modifying an existing stack:

  • Updated the stack version in stack.yaml

Because we don't change directory back into /project, there was an error when running the built image as no package.json could be found. This (hopefully) fixes that.

cc @sam-github

Related Issues:

Fixes: #696

@Kamran64 Kamran64 requested a review from neeraj-laad March 3, 2020 21:47
@sam-github
Copy link
Contributor

I noticed this while cloning nodejs-express to nodejs-kafka (#698), the changes look good, but I'm puzzled as to why its not caught by the stack tests.

@sam-github
Copy link
Contributor

And also puzzled as to why it doesn't get noticed by appsody run.

@Kamran64
Copy link
Collaborator Author

Kamran64 commented Mar 3, 2020

@sam-github - The stack validation tests currently only check that appsody build passes, without actually verifying that the built app runs. Hence why the travis build was passing previously. This also isn't noticed by appsody run since the changes here only affect the production build (controlled by the /image/project/Dockerfile) and not local development (Dockerfile-stack)

@sam-github
Copy link
Contributor

Manually confirmed this fixes the reported bug:

[Docker] Successfully built 39c9121f999e
[Docker] Successfully tagged dev.local/ex-express:latest
Built docker image dev.local/ex-express
Running command: docker create --name ex-express-extract dev.local/appsody/nodejs-express:0.4
Running command: docker cp ex-express-extract:/config/app-deploy.yaml /home/sam/w/cloud/appsody-stacks/incubator/ex-express/app-deploy.yaml
Running command: docker rm ex-express-extract -f
Created deployment manifest: /home/sam/w/cloud/appsody-stacks/incubator/ex-express/app-deploy.yaml
incubator/ex-express (pr/697 $%) % docker run -it dev.local/ex-express:latest

> nodejs-express@0.4.4 start /project
> node server.js

[Tue Mar  3 23:05:48 2020] com.ibm.diagnostics.healthcenter.loader INFO: Node Application Metrics 5.1.1.202003032304 (Agent Core 4.0.5)
[Tue Mar  3 23:05:49 2020] com.ibm.diagnostics.healthcenter.mqtt INFO: Connecting to broker localhost:1883
App started on PORT 3000
^C% 

Copy link
Contributor

@neeraj-laad neeraj-laad left a comment

Choose a reason for hiding this comment

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

LGTM

@Kamran64 Kamran64 merged commit 7d01a0e into appsody:master Mar 4, 2020
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.

incubator/nodejs-express 0.4.3 stack creates broken Docker images
3 participants