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

travis-config-server

v0.3.1

Published

Server for easing creation of .travis.yml configs

Downloads

4

Readme

travis-config-server Travis Coveralls NPM

A simple web service to ease the building of .travis.yml configs

Setup

In order to utilize travis-config-server, you need to install some prerequisites on the server you'll have it running. travis-config-server needs to be able to run the command-line travis utility to encrypt sensitive data into the generated .travis.yml.

Installing travis CLI

The Travis CLI can be installed by following the directions here: https://github.com/travis-ci/travis.rb#installation

Configuring travis-config-server

We can't encrypt what we don't know, so you have to create a config file (.tcs.json) which holds the secrets you want travis-config-server to encrypt into .travis.yml for you when it's generated. The file looks something like this:

{
  "travis": {
    // the personal access token for the github user that will be
    // used for doing automated version bumps (must have write permissons on the repo)
    "rwToken": "<long-ugly-hash-1>"
  },
  "npm": {
    // the API token for the npm user to do deploy into npmjs.com
    "apiToken": "<long-ugly-hash-2>"
  },
  "slack": {
    // The slack integration token (with the team name in front)
    "token": "<team>:<slack-token>"
  }
}

Fill in the info above and store that file somewhere you can point at later, maybe ~/.tcs.json

Usage

Using the service is done in two ways.

  1. Starting up the server somewhere
  2. Hitting the server to get your .travis.yml file.

Launching the server

Install the server

npm install -g travis-config-server

Navigate somewhere you don't mind temporary directories being created when people request .travis.yml files on the server you want to host your travis-config-server instance.

mkdir -p ~/travis-config-server
cd ~/travis-config-server

Start up the server (telling it where the .tcs.json is stored)

TCS_CONFIG_PATH=~/.tcs.json DEBUG=server travis-config-server

Once you're confident it's working and you have the right info in your .tcs.json file, you can launch the server so it won't stop when you log out:

TCS_CONFIG_PATH=~/.tcs.json nohup travis-config-server &

Requesting a .travis.yml file

Downloading a .travis.yml file from this service is very simple. Let's say your server is running at https://my-domain.com. To request a .travis.yml for the foo-bar repository in the baz-bob org, issue the following command:

curl -O https://my-domain.com:3333/baz-bob/foo-bar/.travis.yml

You now have a .travis.yml file with all the encrypted goodies you need. Here's the current baseline it's using:

language: node_js
sudo: false
node_js:
- '5.3'
branches:
  except:
  - /^v[0-9\.]+/
before_install:
- npm install -g coveralls pr-bumper
- pr-bumper check
install:
- npm install
- bower install
after_success:
- sed -i -- 's/SF:${module}\/\(.*\)/SF:addon\/\1.js/' coverage/lcov.info && rm -f coverage/lcov.info--
- cat coverage/lcov.info | coveralls
addons:
  apt:
    sources:
    - ubuntu-toolchain-r-test
    packages:
    - g++-4.8
env:
  matrix:
  - CXX=g++-4.8
  global:
before_deploy:
- pr-bumper bump
deploy:
  provider: npm
  email: [email protected]
  skip_cleanup: true
  api_key:
  on:
    branch: master
    tags: false
after_deploy:
- .travis/publish-gh-pages.sh
notifications:
  slack:

The following commands are then run against the .travis.yml before it's returned in the web service reponse:

travis login --github-token $GITHUB_TOKEN
travis encrypt GITHUB_TOKEN=$GITHUB_TOKEN --add -r $SLUG
travis encrypt $NPM_API_TOKEN --add deploy.api_key -r $SLUG
travis encrypt "$SLACK_TOKEN" --add notifications.slack -r $SLUG