Skip to content

Latest commit

 

History

History
71 lines (54 loc) · 2.09 KB

README.md

File metadata and controls

71 lines (54 loc) · 2.09 KB

Node entrypoint

GitHub go.mod Go version Go Report Card Coverage Status Release

Installation

As this is intended to be a docker entrypoint the preferred way to install is using with a dockerfile.

COPY --from=ghcr.io/quantcdn/entrypoint-node:latest /usr/local/bin/entrypoint-node /usr/local/bin/entrypoint-node

This can be run directly from the docker image:

docker run --rm ghcr.io/quantcdn/entrypoint-node:latest entrypoint-node --version

Usage

$ entrypoint-node --help                                                                                                                             
usage: entrypoint-node [<flags>] [<commands>...]

Flags:
  --help      Show context-sensitive help (also try --help-long and --help-man).
  --dir=DIR   Directory to execute node commands in.
  --url=URL   The backend url (optional).
  --retry=10  Times to retry the backend connection.
  --delay=5   Delay between backend requests.
  --version   Show application version.

Args:
  [<commands>]  Node JS commands to execute.

For example to execute build and start after a backend connection has been established.

entrypoint-node --url http://localhost build start

Local development

Build

git clone [email protected]:quantcdn/entrypoint-node.git && cd entrypoint-node
go generate ./...
go build -ldflags="-s -w" -o build/entrypoint-node .
go run . -h

Run tests

go test -v ./... -coverprofile=build/coverage.out

View coverage results:

go tool cover -html=build/coverage.out

Documentation

cd docs
npm install
npm run dev