This is Dropcat

Deliver a simple static site

The example I have here is this documentation. Which is static HTML created from markdown. The site is in the folder _site in the root folder.

Setup

Dropcat file

First create a basic dropcat.prod.yml (prod environment) in .dropcat folder:

.dropcat
└── dropcat.prod.yml

In that file put your ssh-login detalis plus path to publish site to like:

app_name: mysite
remote:
  environment:
    server: some.server.ip
    ssh_user: some.user
    ssh_port: 22
    web_root: /var/www
    alias: mysite_latest_prod
    identity_file: /path/to/my/rsa/private/key
    ssh_key_password: pass

Delivery bash script

In your project root folder, create a folder called .delivery. In that folder create a file called number.sh, on first and only line add the number 1.

.deliver
└── number.sh

In the root folder create at script called delivery.sh

#!/bin/bash
# simple site deliver script with dropcat
number_file=".deliver/number.sh" #the file where you keep your number of the delivery
number=$(cat "$number_file")

export BUILD_DATE="$(date +"%Y%m%d")"
export BUILD_NUMBER="$number"
export DROPCAT_ENV=prod

dropcat tar --folder="$PWD/_site"
dropcat upload
dropcat move

# next number to use for delivery
next=$(expr $number + 1)
# write the number to the file
echo $next > "$number_file"

The script will add +1 to the number in number.sh so each deliver will get a new number.

The delivered folder is placed in /var/www defined in the [remote][environment][web_root] in the dropcat.prod.yml