19 Feb 2018, 14:50

Hugo Deployment With Rsync And bitbucket-pipelines

Share

bitbucket-pipelines.yml

image: asato/hugo:latest

pipelines:
  branches:
    master:
      - step:
          script:
            - hugo
            - rsync -avz --delete public/ ${USER}@${HOST}:~/${DIR}

Dockerfile

FROM ubuntu

ENV HUGO_VER 0.36.1
ENV PKG_URL https://github.com/gohugoio/hugo/releases/download/v${HUGO_VER}/hugo_${HUGO_VER}_Linux-64bit.deb

RUN apt-get update -y && \
    apt-get install -y wget rsync openssh-clinet && \
    cd /tmp && \
    wget ${PKG_URL} && \
    dpkg -i hugo_${HUGO_VER}_Linux-64bit.deb && \
    rm -f hugo_${HUGO_VER}_Linux-64bit.deb && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* /var/tmp/*

CMD hugo version

reference

comments powered by Disqus