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

Provide Guidance on Using NATS in a CI/CD flow #196

Open
ColinSullivan1 opened this issue Jan 5, 2021 · 1 comment
Open

Provide Guidance on Using NATS in a CI/CD flow #196

ColinSullivan1 opened this issue Jan 5, 2021 · 1 comment

Comments

@ColinSullivan1
Copy link
Member

I keep sending this email and answering similar questions. We need to add something like this to doc:

NATS and CI/CD

Running NATS in your CI/CD environment is fairly straightforward. The NATS server is so lightweight it's really easy to spin up and test with, for example in .NET we can run about 500 tests in under 7 minutes in azure pipelines with almost every test launching a server instance.

Installing the NATS Server

To setup CI with the latest NATS server you have a few options - you can build or run our nightly docker image.

To build: https://github.com/nats-io/nats.java/blob/master/install_deps.sh
Docker: $ docker run -p 4222:4222 synadia/nats-server:nightly

For past releases you can unzip a tar file from github and use an official release, but you won't have edge features.

Or just use github actions if you are in a github environment:
https://github.com/nats-io/jetstream-gh-action

NATS Server test helpers and Usage

Test helpers vary client to client. Here are some examples.

Java

Here is the class you can copy to run the NATS server from java:
https://github.com/nats-io/nats.java/blob/master/src/test/java/io/nats/client/NatsTestServer.java

Example tests:
https://github.com/nats-io/nats.java/blob/master/src/test/java/io/nats/client/JetstreamTests.java

Node.js

https://github.com/nats-io/nats.js/blob/master/test/support/nats_server_control.js
and usage:
https://github.com/nats-io/nats.js/blob/master/test/basics.js#L32

Others

(add .NET, deno, C, python, etc).

Check out each NATS client repository's CI/CD workflow for hints as to run the NATS server CI/CD in your environment.

@gcolliso
Copy link
Member

@ColinSullivan1 This needs to be in nats.docs vs nats-site repo. Where in Docs do you want this guide? nats-server/running?

@ColinSullivan1 ColinSullivan1 transferred this issue from nats-io/nats-site Jan 19, 2021
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

2 participants