Change deploy to use ansible
This commit is contained in:
15
Taskfile.yml
15
Taskfile.yml
@@ -113,7 +113,18 @@ tasks:
|
||||
sh: git rev-parse --short HEAD
|
||||
TIMESTAMP:
|
||||
sh: date +%s
|
||||
IMAGE_TAG: homepage-nginx:{{.COMMIT_HASH}}-{{.TIMESTAMP}}
|
||||
DOCKER_IMAGE: homepage-nginx:{{.COMMIT_HASH}}-{{.TIMESTAMP}}
|
||||
cmds:
|
||||
- task: build-prod
|
||||
- docker build --pull --file docker/Dockerfile.nginx.prod --tag {{.IMAGE_TAG}} .
|
||||
- docker build --pull --file docker/Dockerfile.nginx.prod --tag {{.DOCKER_IMAGE}} .
|
||||
- task: deploy-with-ansible
|
||||
vars:
|
||||
DOCKER_IMAGE: '{{.DOCKER_IMAGE}}'
|
||||
|
||||
|
||||
deploy-with-ansible:
|
||||
internal: true
|
||||
requires:
|
||||
vars: [DOCKER_IMAGE]
|
||||
dir: '/home/av/projects/private/pet-project-server'
|
||||
cmd: ansible-playbook -i production.yml playbook-app-homepage.yml --extra-vars 'homepage_web_image={{.DOCKER_IMAGE}}'
|
||||
|
||||
Reference in New Issue
Block a user