1

Problem: I am having difficulty deploying the Jekyll build folder to an FTP server via Wercker.

I've been using Wercker for continuos integration of a Jekyll site I'm working on. Using the script below, The build process: jekyll build and jekyll doctor appear to be working as intended.

My deploy step should upload the "_site" folder to my FTP server. I'm currently using duleorlovic's ftp-deploy wercker step. It's currently uploading the entire directory, instead of just the build folder.

However, Jekyll uses the /_site folder as the directory for where the site gets built to ... how could I limit my upload to just the /_site build folder?

Thanks.

Current wercker.yml as follows:

# Wercker Configuration
# continuous delivery platform that helps software developers 
# build and deploy their applications and microservices

box: ruby
build:
  steps:

    # Install dependencies
    - bundle-install

    # Execute jeykyll doctor command to validate the
    # site against a list of known issues.
    - script:
        name: jekyll doctor
        code: bundle exec jekyll doctor

    - script:
        name: jekyll build
        code: bundle exec jekyll build --trace

deploy:
  steps:
    - duleorlovic/ftp-deploy:
        destination: $FTP_SERVER
        username: $FTP_USERNAME
        password: $FTP_PASSWORD
        timeout: 15
        remote-file: remote.txt
Alex Johnson
  • 1,504
  • 13
  • 20

2 Answers2

0

Solved the question.

Apparently Worker offers an environment variable called $WERCKER_OUTPUT_DIR. This directory is the folder that gets piped to the deploy step when the build step passes. If not passed anything, the deploy step just used the root directory (aka not your build folder).

The working wercker.yml contains the jekyll build step as follows:

   - script:
       name: jekyll build
       code: bundle exec jekyll build --trace --destination "$WERCKER_OUTPUT_DIR"

I wasn't able to find much for Wercker docs on the matter, since it seems like thier in transition between versions, but I found the solution in an example of how to use wercker.

You can see the example of using the Output Directory in their guide How Wercker Works.

Alex Johnson
  • 1,504
  • 13
  • 20
0

By passing the cwd: argument to the step you can change the working directory (according to the wercker doc):

deploy:
  steps:
  - duleorlovic/ftp-deploy:
      cwd: _site/
      destination: $FTP_SERVER
      username: $FTP_USERNAME
      password: $FTP_PASSWORD
      timeout: 15
      remote-file: remote.txt
jhgee
  • 1
  • 1