81 lines
1.9 KiB
YAML
81 lines
1.9 KiB
YAML
resources:
|
|
- name: site-repo
|
|
type: git
|
|
source:
|
|
uri: https://git.pim.kunis.nl/pim/static.git
|
|
- name: site-registry-image
|
|
type: registry-image
|
|
source:
|
|
repository: git.pim.kunis.nl/pim/static
|
|
tag: latest
|
|
username: pim
|
|
password: ((registry_token))
|
|
|
|
jobs:
|
|
- name: build-and-deploy-static-website
|
|
plan:
|
|
- get: site-repo
|
|
trigger: true
|
|
- task: build-site
|
|
config:
|
|
platform: linux
|
|
image_resource:
|
|
type: registry-image
|
|
source:
|
|
repository: jekyll/builder
|
|
inputs:
|
|
- name: site-repo
|
|
outputs:
|
|
- name: site-html
|
|
params:
|
|
JEKYLL_ENV: production
|
|
run:
|
|
path: sh
|
|
args:
|
|
- -exc
|
|
- |
|
|
ls -lash
|
|
chown jekyll:jekyll site-html
|
|
cd site-repo/jekyll
|
|
bundle install
|
|
bundle exec jekyll build --disable-disk-cache --destination ../../site-html
|
|
- task: build-image
|
|
privileged: true
|
|
config:
|
|
platform: linux
|
|
image_resource:
|
|
type: registry-image
|
|
source:
|
|
repository: concourse/oci-build-task
|
|
inputs:
|
|
- name: site-repo
|
|
- name: site-html
|
|
outputs:
|
|
- name: image
|
|
params:
|
|
DOCKERFILE: site-repo/Dockerfile
|
|
run:
|
|
path: build
|
|
- put: site-registry-image
|
|
params:
|
|
image: image/image.tar
|
|
- task: deploy-site
|
|
config:
|
|
platform: linux
|
|
image_resource:
|
|
type: registry-image
|
|
source:
|
|
repository: raesene/alpine-containertools
|
|
params:
|
|
DOCKER_HOST: ssh://root@maestro.dmz
|
|
run:
|
|
path: sh
|
|
args:
|
|
- -exc
|
|
- |
|
|
ls -lash
|
|
mkdir $HOME/.ssh
|
|
echo -e "Host maestro.dmz\n\tStrictHostKeyChecking no" > $HOME/.ssh/config
|
|
echo "((private_key))" > $HOME/.ssh/id_ed25519
|
|
chmod 600 $HOME/.ssh/id_ed25519
|
|
docker service update static_static --force
|