Browse Source

Adding Concourse pipeline

master
Drew Short 5 years ago
parent
commit
ff64357f2c
  1. 70
      pipeline.yml
  2. 11
      upload_pipeline.sh

70
pipeline.yml

@ -0,0 +1,70 @@
---
resources:
- name: git-resource
type: git
icon: git
source:
uri: ssh://git@git.nulloctet.com:8437/warricksothr/sothr-dot-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
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=sothr
PIPELINE=sothr-dot-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