Adam Johnson Adam Johnson - 1 month ago 6
Javascript Question

Deploy folder in CWD using Shipit JS

I'm trying to use shipit to deploy a

dest/
folder which is already built on the file system (using gulp), but not checked out in git, to a remote.

However, rather than rsync'ing the existing directory to the remote, it tries to clone the repo in the workspace where my
dest/
folder doesn't exist and fails.

Omitting the repositoryUrl option also causes this to fail.

Is there any way to achieve this using shipit? Or is it against the concept of shipit, and my
dest/
folder should be built using their plugins?

My flow is:

Build from
src/
->
dest/
(Gulp) -> Test -> Deploy
dest/
to remote (shipit)

My shipit config:

default:
workspace: '/tmp/.shipit'
dirToCopy: './dest/'
repositoryUrl: git@gitlab.com:group/repo.git
...
staging:
servers: 'www-data@remote.com'
deployTo: '/path/to/ship/to/'

Answer

The solution was to be more specific with the deploy tasks which got ran, and specify the workspace as the current working directory like so:

default:
  workspace: './'
  dirToCopy: 'dest'

Only running the following tasks:

  • deploy:init
  • deploy:update
  • deploy:publish
  • deploy:clean
  • deploy:finish

I.e. removing the deploy:fetch task from the default task set.

This was made easier to achieve using the Shipit Captain module to integrate it with gulp.