read ssh config from file
deploy through docker stack
This commit is contained in:
parent
be32f23c79
commit
94f104bece
3 changed files with 34 additions and 4 deletions
23
docker-stack.yml.template
Normal file
23
docker-stack.yml.template
Normal file
|
@ -0,0 +1,23 @@
|
|||
# vi: ft=yaml
|
||||
version: '3'
|
||||
|
||||
networks:
|
||||
traefik:
|
||||
external: true
|
||||
|
||||
services:
|
||||
static:
|
||||
image: git.pim.kunis.nl/pim/concourse-test:TAG
|
||||
networks:
|
||||
- traefik
|
||||
deploy:
|
||||
placement:
|
||||
constraints:
|
||||
- "node.labels.public == true"
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.static.entrypoints=websecure
|
||||
- traefik.http.services.static.loadbalancer.server.port=80
|
||||
- traefik.http.routers.static.rule=Host(`pim.kunis.nl`)
|
||||
- traefik.http.routers.static.tls=true
|
||||
- traefik.http.routers.static.tls.certresolver=letsencrypt
|
13
pipeline.yml
13
pipeline.yml
|
@ -60,7 +60,7 @@ jobs:
|
|||
- |
|
||||
build
|
||||
ls image
|
||||
cat image/digest | cut -d ":" -f 2- > image/tags
|
||||
cat image/digest | cut -d ":" -f 2- > image/tag
|
||||
- task: get-site-packages
|
||||
config:
|
||||
platform: linux
|
||||
|
@ -97,7 +97,9 @@ jobs:
|
|||
- put: site-registry-image
|
||||
params:
|
||||
image: image/image.tar
|
||||
additional_tags: image/tags
|
||||
additional_tags: image/tag
|
||||
- load_var: tag
|
||||
file: image/tag
|
||||
- task: deploy-site
|
||||
config:
|
||||
platform: linux
|
||||
|
@ -107,6 +109,8 @@ jobs:
|
|||
repository: raesene/alpine-containertools
|
||||
params:
|
||||
DOCKER_HOST: ssh://root@maestro.dmz
|
||||
inputs:
|
||||
- name: site-repo
|
||||
run:
|
||||
path: sh
|
||||
args:
|
||||
|
@ -114,7 +118,8 @@ jobs:
|
|||
- |
|
||||
ls -lash
|
||||
mkdir $HOME/.ssh
|
||||
echo -e "Host maestro.dmz\n\tStrictHostKeyChecking no" > $HOME/.ssh/config
|
||||
cp site-repo/ssh_config $HOME/.ssh/config
|
||||
echo "((private_key))" > $HOME/.ssh/id_ed25519
|
||||
chmod 600 $HOME/.ssh/id_ed25519
|
||||
docker service update --force --image git.pim.kunis.nl/pim/static:latest static_static
|
||||
sed "s/TAG/((.:tag))/g" "site-repodocker-stack.yml.template" > docker-stack.yml
|
||||
docker stack deploy --compose-file docker-stack.yml static
|
||||
|
|
2
ssh_config
Normal file
2
ssh_config
Normal file
|
@ -0,0 +1,2 @@
|
|||
Host maestro.dmz
|
||||
StrictHostKeyChecking no
|
Reference in a new issue