spring-cloud-samples / spring-cloud-contract-nodejs Goto Github PK
View Code? Open in Web Editor NEWSpring Cloud Contract with Node JS application
Spring Cloud Contract with Node JS application
mongo:jessie image in the docker compose file seem to need authentication details. Is there a different mongo image we could use to run this sample project?
Attempting to run the Spring Cloud Contract example tests I cloned the repo and ran the npm test
as described in the README.md. I got the following error ERROR: JAVA_HOME is set to an invalid directory: /root/.sdkman/candidates/java/current/
.
Originally I assumed this was an issue with my local install of SDKMAN, but learning the Spring supported docker images also use SDKMAN - I found the directory being called out in the error above matches the Dockerfile's line 19: https://github.com/spring-cloud/spring-cloud-contract/blob/bbb4db35838f62c8e6df7479e64a33bd875f765d/docker/spring-cloud-contract-stub-runner-docker/Dockerfile#L19
I'm running this on a Mac in iTerm2 and from the terminal within IntelliJ with the same results. Here is my terminal output to try and provide additional context:
$ npm -v
6.14.11
$ node -v
v10.24.0
$ java --version
openjdk 11.0.10 2021-01-19
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.10+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.10+9, mixed mode)
$ echo $SDKMAN_DIR
/Users/[my_home]/.sdkman
$ echo $JAVA_HOME
/Users/[my_home]/.sdkman/candidates/java/current
$ npm test
> [email protected] test /Users/[my_home]/git/github/spring-cloud-samples/spring-cloud-contract-nodejs
> ./run_tests.sh
Running tests against Artifactory
~/git/github/spring-cloud-samples/spring-cloud-contract-nodejs/docker ~/git/github/spring-cloud-samples/spring-cloud-contract-nodejs
Killing docker_artifactory_1 ... done
Killing docker_mongo_1 ... done
~/git/github/spring-cloud-samples/spring-cloud-contract-nodejs
Fetching submodules
Submodule path 'spring-cloud-contract-nodejs-external-contracts': checked out '01c1a8a9f0ba4804a907642f48a26a9e3195c1f2'
Entering 'spring-cloud-contract-nodejs-external-contracts'
From https://github.com/spring-cloud-samples/spring-cloud-contract-nodejs-external-contracts
* branch master -> FETCH_HEAD
Successfully rebased and updated detached HEAD.
Building docker
~/git/github/spring-cloud-samples/spring-cloud-contract-nodejs/docker ~/git/github/spring-cloud-samples/spring-cloud-contract-nodejs
Going to remove docker_artifactory_1, docker_mongo_1
Removing docker_artifactory_1 ... done
Removing docker_mongo_1 ... done
mongo uses an image, skipping
Building artifactory
Step 1/4 : FROM docker.bintray.io/jfrog/artifactory-oss:5.5.1
---> add606aca80a
Step 2/4 : MAINTAINER Marcin Grzejszczak <[email protected]>
---> Using cache
---> f0bb37404ef7
Step 3/4 : COPY artifactory.config.import.yml /var/opt/jfrog/artifactory/etc/artifactory.config.import.yml
---> Using cache
---> bc69e380670a
Step 4/4 : ENTRYPOINT ["/bin/sh", "-c", "/entrypoint-artifactory.sh"]
---> Using cache
---> e56f266e24a4
Successfully built e56f266e24a4
Successfully tagged docker_artifactory:latest
Creating docker_mongo_1 ... done
Creating docker_artifactory_1 ... done
~/git/github/spring-cloud-samples/spring-cloud-contract-nodejs
Waiting for 30 seconds for artifactory to boot properly
Working around certificate issues
up to date in 4.965s
[!] 215 vulnerabilities found [1263 packages audited]
Severity: 89 Low | 14 Moderate | 112 High
Run `npm audit` for more detail
+ [email protected]
updated 1 package in 6.156s
[!] 215 vulnerabilities found [1263 packages audited]
Severity: 89 Low | 14 Moderate | 112 High
Run `npm audit` for more detail
appending output to nohup.out
Sc Contract Version [3.0.2-SNAPSHOT]
Application URL [http://host.docker.internal:9876]
Artifactory URL [http://host.docker.internal:8081/artifactory/libs-release-local]
Project Version [0.0.1.RELEASE]
Setting project name to [bookstore]
Running the build
ERROR: JAVA_HOME is set to an invalid directory: /root/.sdkman/candidates/java/current/
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
npm ERR! Test failed. See above for more details.
Thoughts?
All 3 examples doesnt work. I always get the error
> Task :test FAILED
Results: (0 tests, 0 successes, 0 failures, 0 skipped)
Got [Model.find() no longer accepts a callback in Mongoose](https://stackoverflow.com/questions/75655652/model-find-no-longer-accepts-a-callback-in-mongoose)
error when running node app
Fixed by doing npm install mongoose@4
Replacing docker-compose
with podman-compose
from https://github.com/containers/podman-compose helped
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.