Browse Source

Adding Concourse pipeline definition

master
Drew Short 5 years ago
parent
commit
683e3459cf
  1. 1
      .gitignore
  2. 73
      pipeline.yml
  3. 11
      upload_pipeline.sh

1
.gitignore

@ -1 +1,2 @@
public/ public/
.DS_Store

73
pipeline.yml

@ -0,0 +1,73 @@
---
resources:
- name: git-resource
type: git
icon: git
source:
uri: ssh://git@git.nulloctet.com:8437/nulloctet/blog-nulloctet-com.git
private_key: |
((pull_key))
ignore_paths:
- pipeline.yml
- upload_pipeline.sh
- README.md
jobs:
- name: publish
plan:
- get: git-resource
trigger: true
- task: build-site
config:
platform: linux
image_resource:
type: registry-image
source:
repository: ((nexus_docker_read.host))/sothr/hugo
username: ((nexus_docker_read.username))
password: ((nexus_docker_read.password))
inputs:
- name: git-resource
outputs:
- name: site-html
params:
HUGO_THEME: hyde
HUGO_BASEURL: https://blog.nulloctet.com/
run:
path: /bin/sh
args:
- -c
- |
export HUGO_SOURCE="${PWD}/git-resource"
/run.sh --minify
tar -czvf site-html/website.tgz -C /output/ .
- task: publish-site
config:
platform: linux
image_resource:
type: registry-image
source:
repository: ((nexus_docker_read.host))/sothr/deploy
tag: "stable"
username: ((nexus_docker_read.username))
password: ((nexus_docker_read.password))
inputs:
- name: site-html
params:
DEPLOY_KEY: ((deploy.key))
DEPLOY_HOST: ((deploy.host))
DEPLOY_PORT: ((deploy.port))
DEPLOY_USER: ((deploy.user))
DEPLOY_TARGET: ((deploy.target))
run:
path: /bin/bash
args:
- -c
- |
eval `ssh-agent -s`
ssh-add <(echo "${DEPLOY_KEY}")
mkdir -p ~/.ssh
ssh-keyscan -p ${DEPLOY_PORT} ${DEPLOY_HOST} >> ~/.ssh/known_hosts
mkdir /tmp/deploy
tar -xzvf site-html/website.tgz -C /tmp/deploy
rsync -avz --delete-delay -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p ${DEPLOY_PORT}" --progress /tmp/deploy/* ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_TARGET}

11
upload_pipeline.sh

@ -0,0 +1,11 @@
#!/usr/bin/env bash
TEAM=nulloctet
PIPELINE=blog-nulloctet-com
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
pushd "${DIR}"
fly -t ${TEAM} set-pipeline --pipeline ${PIPELINE} --config pipeline.yml
popd
Loading…
Cancel
Save