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

lets-git-pull

v0.0.7

Published

Deployment management for Lets using git pull

Downloads

4

Readme

lets-git-pull

git-pull deployment management for Lets. Basically provides the same functionality as capistrano.

Current state

Getting started

See Lets for how to install lets.

Install lets-git-pull:

npm install lets-git-pull

Create the following Letsfile.js:

var gitpull = require('lets-git-pull');

module.exports = function (lets) {
  // Create a stage
  var stagename = lets.Stage({
    host: '1.2.3.4',
    username: 'username',
    password: 'asdasd',
    agent: process.env.SSH_AUTH_SOCK,
    agentForward: true,

    repository: '[email protected]:letsjs/lets-git-pull.git',
    remotePath: '/var/lets/sitename'
  });

  // Add your own instructions, like symlink to the server's folder
  stagename.on('deploy:publish', function (options, done) {
    this.getConnection(function(c) {
      c.exec('ln -nfs ' + options.current + ' /var/www/site.com', done);
    });
  });

  // Deploy using git pull
  stagename.plugin(gitpull());

  // Add the stage to lets
  lets.addStage('stagename', stagename);
};

Then run this in the terminal:

lets deploy:setup stagename
lets deploy:check stagename
lets deploy stagename

That's it! More examples will come later.

Usage

lets-ssh options:

The following options may be used but not specific to this plugin, see lets-ssh for more information:

  • host (required)
  • username (required)
  • password
  • agent
  • agentForward
  • tryKeyboard

Required options:

options.repository
The url of the repository.

options.remotePath
The path where the files will be put on the remote, without trailing slash.

Optional options:

options.branch = 'master'
The branch to checkout. Default is master.

options.keepRevisions = 5
How many revisions to keep on cleanup. Default is 5.

options.removeOldRevisionOnRollback = true
Whether or not to remove the old revision on rollback.

Options made available by lets-git-pull:

options.currentPath
The absolute path to the folder where the current revision is stored. Available after deploy:update.

options.current
The absolute path to the symlink ([remotePath]/current) to the current revision. Use for e.g. symlinking the project to the webserver's public-html file. Available after deploy:publish.

options.oldRevision
The absolute path to the folder where the old revision is stored when rolling back. Available after deploy:rollback.

Contribution

See guidelines for lets.

Tests

Run tests using npm test, grunt test or make test. You need to set up your own SSH-server to test against. On OS X a really simple way is to simply enable Sharing->Remote Login (preferably on a for this purpose designated account). However on OS X (and any other server which doesn't use GNU CLI tools) you also need to install GNU find (using e.g. brew install findutils --default-names), since the tests use a flag (-printf) which the BSD version doesn't support.

When you have an SSH-server to test against, copy test/config-sample.js to config.js and enter its details.