Add docker image build scripts

This commit is contained in:
2025-08-14 14:09:25 +03:00
parent aae83db2ea
commit df069a9aa1
8 changed files with 181 additions and 20 deletions

28
Taskfile.yml Normal file
View File

@@ -0,0 +1,28 @@
# https://taskfile.dev
version: '3'
vars:
GREETING: Hello, World!
tasks:
deploy:
vars:
COMMIT_HASH:
sh: git rev-parse --short HEAD
TIMESTAMP:
sh: date +%s
DOCKER_IMAGE: transcriber:{{.COMMIT_HASH}}-{{.TIMESTAMP}}
cmds:
- docker build --pull --file Dockerfile --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-transcriber.yml --tag=deploy --extra-vars 'transcriber_image={{.DOCKER_IMAGE}}'