Public | Automated Build

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description

fluo-frontend-publisher

Running the container

  1. Mount the website sources under /mnt/app
  2. Point the publisher to the config by using "--config /path/to/file" as command (/mnt/app/config.js by default).
  3. Publisher listens on the configured port. Run docker with -p to publish the correct port.
  4. If you are wokring with git and need a key to fetch current files, mount the key under /mnt/id_rsa.

Example docker command:

sudo docker run \
    -v /home/vagrant/website:/mnt/app \
    -v /home/vagrant/.ssh/id_rsa:/mnt/id_rsa \
    -p 8003:8003 \
    -ti \
    dypsilon/fluo-frontend-publisher \
    --config /mnt/app/frontend/config.js

Example fig file:

publisher:
    image: dypsilon/fluo-frontend-publisher
    ports:
        - "8003:8003"
    volumes:
        - .:/mnt/app
        - /home/vagrant/.ssh/id_rsa:/mnt/id_rsa
    command: --config /mnt/app/frontend/config.js

Configuration

Use the normal fronted config of fluo-frontend to configure the publisher. All publisher configuration resides in the "publisher" key.

Example:

config.publisher = {
    'server': { 'host': '0.0.0.0', 'port': '8003' },
    'historySize': 3000,
    'workingCopy': {
        'path': path.join(__dirname, '..'),
        'repository': 'origin',
        'refspec': 'master'
    },
    'deployment': [
        {
            type: 'ftp',
            options: {
                connection: {
                    host: process.env['PROD_FTP_HOST'],
                },
                auth: {
                    username: process.env['PROD_FTP_USER'],
                    password: process.env['PROD_FTP_PW']
                },
                debug: false
            }
        }
    ]
}

Git working copy

Configure the path and the branch of the working copy here. If this options is used, publisher will attempt to pull current files from the remote git working copy.

Example:

config.publisher = {
    'workingCopy': {
        'path': path.join(__dirname, '..'),
        'repository': 'origin',
        'refspec': 'master'
    }
}

Deployment

If the "deployment" option is used, the publisher expects an array of objects for each remote server. Here is an example of a configuration for one remote ftp server:

config.publisher = {
    'deployment': [
        {
            type: 'ftp',
            options: {
                connection: {
                    host: process.env['PROD_FTP_HOST'],
                },
                auth: {
                    username: process.env['PROD_FTP_USER'],
                    password: process.env['PROD_FTP_PW']
                },
                debug: false
            }
        }
    ]
}

type - the type of the remote server.
options - an object with options which will be passed directly to the adapter.

FTP Deployment

The FTP remote type expects following options:

connection - an object with jsftp options. See https://github.com/sergi/jsftp
auth - and object with credentials (username and password) for authentication
debug - enable or disable debug mode. The debug messages will be emitted using the normal fluo-frontend monitor.
uploadTimeout - a timeout which will be used between uploading files. Defaults to 200ms.

Docker Pull Command
Owner
dypsilon

Comments (0)