npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

docker-test.sh

v0.0.6

Published

helper scripts for running tests/ci using docker images

Downloads

25

Readme

Docker Test

Set of bash programs to test a project that uses a Dockerfile to create a runnable image.

Use

npm install docker-test.sh

Implement bin/COMMAND_NAME-hook.sh for each binary you'd like to use. You'll need to expose all non-optional callback functions - just define bash functions of the same name. You'll also need to define the non-optional variables - either set them as env vars at runtime, or define in the hook file.

The binaries are exposed via npm, so ensure your path includes local node_modules/.bin. Run the commands from a directory relative to your bin folder that contains the hooks.

Binaries

docker-test-jenkins

Runs a build for jenkins, where the repo has been checked out.

Hook file: docker-test-jenkins.sh

Variables

Either specify when running the bin, or in callbacks.sh.

# tag for image
IMAGE_TAG=auth-server

# (optional) the repo to tag built images on
DOCKER_REPO_URL=docker-registry.development.yourdomain.com:5000

# (optional) if you have a separate image-file for testing (e.g that installs with 
# testing dependencies) specify its path
TEST_DOCKERFILE=test/Dockerfile

# (optional) CSV of branches to deploy after a test that passes (see run_test_container)
DEPLOY_BRANCHES=dev,master,staging

Public API

build_test_image

Creates an image from a clean version of the git commit. Tags as $IMAGE-TAG-$GIT_COMMIT. By default this is called by test_setup.

Callbacks

test_setup() (optional)

Runs before test container, here you ensure your test environment is ready.

Default is to call build_test_image.

run_test_container()

Executes test. Ensure exit status is 1 on test failures.

test_teardown() (optional)

Cleans up after test run.

after_push() (optional)

Run a functional after an image is pushed (and thus tests have passed).