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

ciena-devops

v1.1.0

Published

A collection of scripts and configurations used by the Ciena organization in their DevOps

Downloads

15

Readme

ciena-devops

A collection of scripts and configurations used by the Ciena organization in their DevOps

scripts/slack/incoming-webhooks/send-message.sh

After pr-bumper has merged an outstanding PR and bumped the package version this script should then be ran to send a message to the #frost-foundation Slack channel.

The message will look like:

Example Slack Message

PATCHES will have a green color, MINOR blue, and MAJOR burgundy.

An error message may also be sent when an error is encountered:

Example Slack Error Message

Configuration

package.json

A repository property needs to added to the package.json file, such as:

"repository": {
  "type": "git",
  "url": "https://<url>/<organization>/<repo>.git"
},

TravisCI

An environment variable needs to be added to the TravisCI configuration at https://travis-ci.org as well as two additions need to be added to the .travis.yml file.

The environment variable that needs to be added to the respective package's configuration in TravisCI is SLACK_INCOMING_WEBHOOK_URL and needs to be set to the url of the incoming webhook integration for the #frost-foundation channel. To do this visit https://travis-ci.org/<organization>/<repo>/settings. NOTE: When adding the SLACK_INCOMING_WEBHOOK_URL variable, make sure to keep the "Display value in build log" set to "OFF" otherwise the url will be written to the build logs for the public to see.

The additions to the .travis.yml file are to add the ciena-devops package to the npm install in the before_install configuration, such as:

before_install:
- npm install -g pr-bumper@^3.2.3 ciena-devops^1.0.0

The second addition is to add an after_deploy configuration, such as:

after_deploy:
- $(npm root -g)/ciena-devops/scripts/slack/incoming-webhooks/send-message.sh

TeamCity

#1

An environment variable needs to be added to the TeamCity project configuration named env.tc.slack.frost-foundation.incoming.webhook whose value is set to the url of the incoming webhook integration for the #frost-foundation channel.

#2

The Setup CI Environment (inherited) build step needs to be duplicated and modified, with the original build step being set to disabled. Name the new build step: Setup CI Environment (deviates from inherited by exporting SLACK_INCOMING_WEBHOOK_URL

The modification that needs to be made is to add

# Fill in SLACK_INCOMING_WEBHOOK_URL
export SLACK_INCOMING_WEBHOOK_URL="%env.tc.slack.frost-foundation.incoming.webhook%"

somewhere within the cat << EOF > ${ENV_DIR}/nenv section, before the EOF entry.

#3

A new build step needs to be added to the TeamCity project configuration with the following information:

TeamCity Build Step

where the contents of the Custom script are:

#!/bin/bash
NAME=frost-ci-image
IMAGE=$(docker images | grep ${NAME} | awk '{print$3}')
CONTAINER=$(docker ps -a | grep $IMAGE | awk '{print$1}')

# Fill in TEAMCITY_PULL_REQUEST
stripped_branch=$(echo "%teamcity.build.branch%" | sed -e "s/\/merge//")
re='^[0-9]+$'
if [[ $stripped_branch =~ $re ]]
then
    export TEAMCITY_PULL_REQUEST="$stripped_branch"
else
    export TEAMCITY_PULL_REQUEST="false"
fi

if [[ "$TEAMCITY_PULL_REQUEST" = "false" ]]
then
    docker exec $CONTAINER nenv npm install -g ciena-devops@^1.0.0 || exit $?
    docker exec $CONTAINER nenv /opt/node-envs/%env.node_version%/lib/node_modules/ciena-devops/scripts/slack/incoming-webhooks/send-message.sh || exit $?
fi

and set to run after the Slack Notification (1) (inherited) step and before the Cleanup Container (inherited) step.

scripts/package-info.sh

This script contains several functions related to retrieving information about packages.

Creating new scripts

When developing new scripts you must change the permissions of them before committing, as per https://docs.travis-ci.com/user/customizing-the-build/#Implementing-Complex-Build-Steps

You may also find the https://www.shellcheck.net tool helpful when writing bash scripts.