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

@zauberware/ssh-deploy

v0.0.1

Published

a simple tool for deployment over ssh

Downloads

3

Readme

ssh-deploy

Table of Contents

Install

npm i @zauberware/ssh-deploy --save

Create vhosts

nginx minimum config for default .env

storybook

server {
    listen 80;
    server_name storybook.example.com;

    # Tell Nginx your app's 'public' directory is
    root /home/exampleuser/storybook/current;
}

staging

server {
    listen 80;
    server_name staging.example.com;

    # Tell Nginx your app's 'public' directory is
    root /home/exampleuser/staging/current;
}

production

server {
    listen 80;
    server_name production.example.com;

    # Tell Nginx your app's 'public' directory is
    root /home/exampleuser/production/current;
}

.env

Configure and put these env variables to your .env file. Or use the gui for the basic configuration

ENV_MODE=init npm explore @zauberware/ssh-deploy -- npm run sshDeploy --env=$PWD

Sample

DEFAULT_USERNAME=exampleuser
DEFAULT_PASSWORD=supersecretpassword
DEFAULT_HOST=example.com
DEFAULT_PORT=22

DEFAULT_HOST_BASEPATH=~/
DEFAULT_HOST_LOGFOLDER=releases/

LOCAL_STORYBOOK_FOLDER=storybook-static/
LOCAL_APPFOLDER=build/

Options

Overview of possible .env key=value options

local folders

| Key | Defaultvalue | Description | | :--------------------- | :---------------: | ------------------------------------------------------ | | LOCAL_STORYBOOK_FOLDER | storybook-static/ | folder where the storybook build on your machine lives | | LOCAL_APPFOLDER | build/ | folder where the build on your machine lives |

connection

| Key | Defaultvalue | Description | | ---------------------- | :----------: | ------------------------------------------------------------------------------------------------------ | | DEFAULT_USERNAME | --- | user for ssh connection | | DEFAULT_PASSWORD | --- | password for ssh connection | | DEFAULT_HOST | --- | hostaddress or name for ssh connection | | DEFAULT_PORT | --- | port for ssh connection | | DEFAULT_HOST_BASEPATH | ~/ | basepath where the subfolders for deployment live (default subfolders: production, staging, storybook) | | DEFAULT_HOST_LOGFOLDER | releases/ | relative path to logfile savelocation |

optional options for storybook

| Key | Defaultvalue | Description | | :------------------------ | :----------: | ---------------------------------------------------------- | | STORYBOOK_USERNAME | --- | | | STORYBOOK_PASSWORD | --- | | | STORYBOOK_HOST | --- | | | STORYBOOK_PORT | --- | | | STORYBOOK_HOST_BASEPATH | ~/ | | | STORYBOOK_HOST_DEPLOYPATH | storybook/ | | | STORYBOOK_HOST_LOGFOLDER | releases/ | relative path to logfile savelocation for storybook deploy |

optional options for staging

| Key | Defaultvalue | Description | | :---------------------- | :----------: | ----------- | | STAGING_USERNAME | --- | | | STAGING_PASSWORD | --- | | | STAGING_HOST | --- | | | STAGING_PORT | --- | | | STAGING_HOST_BASEPATH | ~/ | | | STAGING_HOST_DEPLOYPATH | staging/ | | | STAGING_HOST_LOGFOLDER | releases/ | |

optional options for production

| Key | Defaultvalue | Description | | :------------------------- | :----------: | ----------- | | PRODUCTION_USERNAME | --- | | | PRODUCTION_PASSWORD | --- | | | PRODUCTION_HOST | --- | | | PRODUCTION_PORT | --- | | | PRODUCTION_HOST_BASEPATH | ~/ | | | PRODUCTION_HOST_DEPLOYPATH | production | | | PRODUCTION_HOST_LOGFOLDER | releases/ | |

package.json scripts

Put these scripts into your root package.json

"deploy": "ENV_MODE=deploy npm explore @zauberware/ssh-deploy -- npm run sshDeploy --env=$PWD",
"rollback": "ENV_MODE=rollback npm explore @zauberware/ssh-deploy -- npm run sshDeploy --env=$PWD",
"sshDeploy": "npm explore @zauberware/ssh-deploy -- npm run sshDeploy --env=$PWD",