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

@nrk/ps-octo-publisher

v1.4.0

Published

WebApp publisher for Octopus

Downloads

228

Maintainers

stiansstianslorecasterlorecasternrk-ps-teamcitynrk-ps-teamcityswlaswlanrk-midas-jenkinsnrk-midas-jenkinsandorpandorandorpandornrkrichardnrkrichardgesigesigundelsby-nrkgundelsby-nrkjonstalecarlsenjonstalecarlsenmslhmmslhmnrk-sofie-cinrk-sofie-cinytaminnytaminjesperstarkarjesperstarkarskjalgepalgskjalgepalgeirikhalvardeirikhalvardastokkeastokken640071n640071jfjeldskaarjfjeldskaarsondrbwsondrbwhenrik-mattssonhenrik-mattssonolapeterolapeterdervodevdervodevstefanogdennrkstefanogdennrkhaavardmhaavardmyryrnrk-kurator-jenkinsnrk-kurator-jenkinstorgeilotorgeilonrk-user-syncnrk-user-syncdhdeploydhdeployespenwaespenwaovstetunovstetunstianljstianljharaldkjharaldkjmariusumariusucristobalcristobalknuthaugknuthaugthohalvthohalvjohnarnejohnarneeshaswinieshaswinimorrowmorrowoyvindehoyvindehlaatlaattoggutoggunrk-jenkinsnrk-jenkinszenangstzenangstplommaplommaevjandevjandmoltubakkmoltubakkmariehovlandmariehovlandingridgureningridgurenlu-luxlu-luxanderslianderslisiljesiljestiandgstiandgsjurlursjurlurandipodnrkandipodnrkpkejpkejyosrimtiyosrimtimorten.nyhaugmorten.nyhaugingvildcathingvildcatherlend.joneserlend.jonesbrneirikbrneirikmollersemollersetbnrktbnrknordankenordankesimonmitternachtsimonmitternachtmartintorgersenmartintorgersenrebchrrebchrsteipalsteipalcarinafraningcarinafraningdiscobusdiscobuseirikjstnrkeirikjstnrkmartingundersenmartingundersentinkajtstinkajtshallvardlidhallvardlidtomivartomivarajacoajacotobinustobinusmortenokmortenokfeiringfeiringnrk-ark-deploynrk-ark-deployjeangilbertlouisjeangilbertlouisheidimorkheidimorkingriddraageningriddraagenfridajalborgfridajalborgbruusibruusirosvollrosvollchristianeidechristianeideenordbyenordbyglen_imrieglen_imriemia.aasbakkenmia.aasbakkenelathamnaelathamnaevjjan17evjjan17olatoftolatoftkongsrudkongsrudchrpeterchrpeteringvildforsethingvildforsethharaldk76haraldk76stigokstigokjohannesodlandjohannesodlandanders993anders993vildefjvildefjvildepkvildepkhelenperhelenperrolerbolerrolerbolermeloyguttmeloyguttanders.baggethunanders.baggethunespenhalstensenespenhalstensenandreeldareideandreeldareideytterboytterbovagifabilovvagifabilovhermangudesenhermangudesenhaakemonhaakemonhenningkollerhenningkollerteodor-elstadteodor-elstaddanjohnrkdanjohnrkopetopetandrefauandrefaumadsernmadserncbjerkancbjerkankariaankariaangardkroyergardkroyermikkelnygardmikkelnygardsiddisesiddiseklizterklizteredplayzedplayztrulsltrulslmiatollaksvikmiatollaksvikmachineboycommachineboycomclaudio-nrkclaudio-nrkgrimburgrimburn07073n07073theasparrowhawktheasparrowhawkshieldyarmorshieldyarmoremte123emte123supermeisensupermeisentoshbtoshbarevjensenarevjensenbaltebalteeschoieneschoienmaar1052maar1052ragnaroh-nrkragnaroh-nrkrannveigncrannveigncharaldskharaldskluminrkluminrkeskilgheskilghtorsrextorsrexthormodbthormodbjoakimmohnjoakimmohnebrautasetebrautasetkjellovenordlienkjellovenordlienjanerikbrjanerikbrgunderwondergunderwonderjulusianjulusiandaardaldaardalmmepmmepjimalexbergerjimalexbergersiiverssiiversmuddahmuddahihlnrkihlnrkmorten-nrkmorten-nrkkristjgrkristjgrhenrkhenrkknutboknutbosokkemannensokkemannensanderknrksanderknrkjensragejensragekjellvnnrkkjellvnnrknicklassvendsrudnicklassvendsrudellenulrikellenulrikjorn_georgjorn_georgingryeeingryeehalvorhhalvorhphajsiphajsimartioskmartiosktobiasrptobiasrpjimmeloysundjimmeloysundlarsjorgentvedtlarsjorgentvedtkjartanmichalsenkjartanmichalsenmariusenerlynrkmariusenerlynrkkennethdammyrkennethdammyrnikolai.kjarem.ellingsennikolai.kjarem.ellingsentekbeartekbear

Keywords

Readme

web-app-octopus-publisher

install size npm version

⚠️ This is an internal tool used by the TV web team @ NRK
The package is public only for ease of use with npx in CI
settings so we dont have to provide npx --userconfig <.npmrc>

Simple NodeJS cli tool for:

  • packaging node web apps
  • posting package to octopus deploy
  • generating release notes
  • updating release notes on octopus release

For the pack->push->releaseNotes flow to work the Octopus project needs to be set up with automatic release creation

The tool uses name from ${process.cwd()}/package.json for:

  • octopus feed id
  • octopus project name
  • pm2 process name

The package exposes a bin (waop) if installed locally or globally.

Usage

Typical use case for node apps in the PS.Web repo, use npx in npm script and be explicit about the version (@1.0.x)

{
  "scripts": {
    "predeploy": "npm prune --production",
    "deploy": "npx @nrk/[email protected] publish -w <AzureProdAppName>"
  }
}

Or, install globally and use exported bin waop

> npm i -g @nrk/ps-octo-publisher
> waop publish

Display help

> npx @nrk/ps-octo-publisher -h
> npx @nrk/ps-octo-publisher notes -h
> npx @nrk/ps-octo-publisher publish -h

Generate Release notes

Generating release notes (commit history) in current directory.

Release notes Options

| Name | Alias | Default | | ---- | ----------- | ------- | | -u | --url | '' | | -w | --webApp | '' | | -o | --outFile | '' | | -p | --plain | false | | -d | --debug | false |

Using waop notes

Options -u and -w are used for the same purpose, but -w is inserted into a template https://${w}.azurewebsites.net/ping and -u is used as is. The options expect the resulting url to respond with json that satisfies:

interface Ping {
  hash?: string; // commit hash
  date?: string; // json date
  env?: {
    DEPLOY_TIME?: string; // json date
  };
}

If either of those properties exist they are used to determine which commits are to be included in the release notes so that commies = [<prop>...master].

  • waop notes - generate notes from last 5 commits in current folder
  • waop notes -p - generate notes as plain text (no markdown links)
  • waop notes -o releaseNotes.md - output to file
  • waop notes -u https://tv.nrk.no/ping - provide url
  • waop notes -w web-header-prod-we - provide Azure Web App name

Publish

Packages app in zip and pushes to Octopus Deploy. On publish success tries to set release notes on the auto-created release.

For release notes to be exact commit diff from what is currently in production, provide the -w option with the Azure Web App name (e.g. -w tv-web-search-prod-we)

Publish Options

| Name | Alias | Default | | ---- | ---------------- | ------------------------------------------------------------------ | | -g | --globs | ['*.*', 'dist/**', 'static/**', 'scripts/**', 'node_modules/**'] | | -c | --pm2 | true | | -w | --webApp | '' | | -k | --octoKey | '' (by default read from process.env['OCTOPUS_API_KEY']) | | -s | --octoServer | 'https://madeploy04/' | | -v | --buildVersion | '' (by default read from process.env['BuildVersion']) | | -n | --dryRun | '' |

By default octoKey and buildVersion is read from env['OCTOPUS_API_KEY'] and env.BuildVersion respectively. Passing those variables in does nothing if the environment variables are defined.

Using waop publish

  • waop publish -v 0.1.1 -k <api-key> - publish version 0.1.1
  • waop publish -g dist/** - publish only content in dist/**
  • waop publish --pm2 false - publish and do't add pm2.config.json
  • waop publish --w tv-web-search-prod-we - publish and call https://tv-web-search-prod-we.azurewebsites.net/ping to get commit hash / build date to use for release notes.

Git formatting patterns

There are many alternatives we could use for the commit history.
Some of the placeholders that can be used in --pretty=format:"" are:

  • '%h': abbreviated commit hash
  • '%an': author name
  • '%aN': author name (respecting .mailmap)
  • '%ae': author email
  • '%aE': author email (respecting .mailmap)
  • '%ad': author date (format respects --date= option)
  • '%aD': author date, RFC2822 style
  • '%ar': author date, relative
  • '%at': author date, UNIX timestamp
  • '%ai': author date, ISO 8601-like format
  • '%aI': author date, strict ISO 8601 format
  • '%cn': committer name
  • '%cN': committer name (respecting .mailmap, see git-shortlog[1] or git-blame[1])
  • '%ce': committer email
  • '%cE': committer email (respecting .mailmap, see git-shortlog[1] or git-blame[1])
  • '%cd': committer date (format respects --date= option)
  • '%cD': committer date, RFC2822 style
  • '%cr': committer date, relative
  • '%ct': committer date, UNIX timestamp
  • '%ci': committer date, ISO 8601-like format
  • '%cI': committer date, strict ISO 8601 format
  • '%d': ref names, like the --decorate option of git-log[1]
  • '%D': ref names without the " (", ")" wrapping.
  • '%e': encoding
  • '%s': subject
  • '%f': sanitized subject line, suitable for a filename
  • '%b': body
  • '%B': raw body (unwrapped subject and body)
  • '%N': commit notes