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

dokku-gulp-tasks

v1.0.0

Published

A few opinionated gulp.js tasks for speeding-up deployment with Dokku.

Downloads

34

Readme

Dokku gulp tasks

A few opinionated gulp.js tasks for speeding-up deployment with Dokku.

These tasks assume the following about your environment:

  • Your application uses MySQL
  • You're running Dokku v0.4.14 or later, and using the official MySQL plugin
  • You have SSH keys set up for the dokku user
  • You're running in a Vagrant machine, with the root of your application shared at /vagrant
  • You have an existing gulpfile.babel.js

Getting started

  1. Install the package to your project with npm install --save dokku-gulp-tasks
  2. Require the package in your gulpfile.js, and pass it an instance of gulp:
// ES2015-style
import deployTasks from 'dokku-gulp-tasks';
deployTasks(gulp);

// CommonJS-style
require('dokku-gulp-tasks')(gulp);
  1. Create a env.json (see example) in the root of your project to describe the local database credentials, and remote Dokku server(s).

You can override the shared directory with the sharedDirectory parameter:

// env.json
{
  "sharedDirectory": "/home/vagrant"
}

You can force the scripts to expect to be run in the context of a Vagrant machine (versus the host machine) by setting isVagrantContext:

// env.json
{
  "isVagrantContext": true
}

By default, the script will check if the user who invoked it matches vagrant to determine the context.

Usage

gulp dokku [--command <command>] [--env <env>]

Deployment

The dokku task allows you to run arbitrary Dokku commands, specified in the command argument (for example, gulp dokku apps will list the apps deployed to the server). If you have multiple Dokku servers specified in env.json, you can specify an environment by key with the env argument.

gulp dokku:init [--env <env>]

Readies the Dokku server for deployment of the app by performing the following tasks:

  • Creates a new app
  • Creates a MySQL container
  • Links the app and MySQL containers
gulp dokku:remote [--env <env>]

Creates a git remote for the Dokku server. This task is run automatically by dokku:init, but is useful for adding a remote for an app that was initialized by another developer.

gulp dokku:deploy [--env <env>]

Deploys the application by pushing the current branch to the Dokku server.

Databases

gulp db:dump-local [--env <env>]

Dumps the database from the local Vagrant machine to the .tmp directory.

gulp db:dump-remote [--env <env>] [--mariadb]

Dumps the database of the remote Dokku app to the .tmp directory. The mariadb flag provides legacy support for Kloadut's Dokku MariaDB plugin.

gulp db:push [--env <env>] [--mariadb]

Pushes the database from the local Vagrant machine to a remote Dokku app.

gulp db:pull [--env <env>] [--mariadb]

Pulls the database of the remote Dokku app to the local Vagrant machine.

gulp db:backup [--env <env>] [--mariadb]

Creates timestamped dumps of the databases from both the local Vagrant machine, and the remote Dokku app to the /databases directory.