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

@uscreen.de/shipit-deploy-cd

v0.5.9

Published

shipit deploy without git

Downloads

105

Readme

shipit-deploy-cd

Build Status Known Vulnerabilities

A shipit deployment task without git requirements.

Task is to just copy some local artefacts to a remote location. This is esp. usefull in Continous-Delivery-Scenarios. And that's why the package appended cd. It's using rsync under the hood to only transfer changes and keeps a capristrano like directory structure:

$ tree -L 2
.
├── current -> releases/20190725153703
└── releases
    ├── 20190623143320
    ├── 20190723150429
    ├── 20190724151443
    ├── 20190725152609
    └── 20190725153703

install

a) Install all required packages in one shot:

$ yarn add shipit-cli @uscreen.de/shipit-deploy-cd # or use npm -i

b) Or just add shipit-deploy-cd to any existing setup:

$ yarn add @uscreen.de/shipit-deploy-cd # or use npm -i

...will yield if shipit-cli missing

configure

Add some proper task configuration to your shipitfile.js, example:

// convenience: read app name from it's package.json
const { name } = require('./package.json')

module.exports = shipit => {

  // require and instantiate
  require('@uscreen.de/shipit-deploy-cd')(shipit)

  shipit.initConfig({
    // defaults, every env will inherit from here
    default: {
      dist: 'dist/*', // local source to sync from, can also be an array, like ['public', 'assets']
      deployTo: `/<remote>/<path>/<to>/<deploy>/<to>/${name}`,
      keepReleases: 5 // we keep a copy of last 5 releases
    },

    // example stage server (ssh connection settings)
    stage: {
      servers: '[email protected]'
    },
    
    // example live servers (like above but 2 boxes)
    live: {
      servers: [
        '[email protected]',
        '[email protected]'
        ]
    }
  })

  // convenience: register as 'deploy' task
  shipit.task('deploy', async () => {
    shipit.start('deploy-cd')
  })
}

use

As with all other shipit tasks, this one gets invoked by using the shipit-cli, ie.:

$ shipit stage deploy-cd # or, when registered with another task name
$ shipit stage deploy

Workflow tasks

Following workflow task events are emitted:

  • 'deploy'
  • 'updated'
  • 'published'
  • 'cleaned'
  • 'deployed'

Tests

For testing we use the package dev-service to run an sshd service we can deploy to.

To use dev-service, you need docker & docker-compose in your PATH (e.g. via Docker Desktop). With direnv dev-service is automatically added to you PATH as long as you reside inside the shipit-deploy-cd folder.

To prepare, copy your public ssh key into services/sshd/authorized_keys/www, e.g. with:

cp ~/.ssh/id_rsa.pub services/sshd/authorized_keys/www

Next adjust the host keys' permissions to be only accessible for the owner:

chmod 600 services/sshd/ssh_keys/*

Now use dev-service to install & start the sshd service:

service install
service start

Before you run the tests first time, you may find it useful to ssh to the service once to confirm the authenticity of the used host:

ssh [email protected] -p 2222

Run the tests by

yarn test

Afterwards, stop the sshd service by

service stop

Roadmap

  • add api/config docs