]> Untitled Git - lemmy.git/blob - docker/prod/deploy.sh
For untagged commits, include hash in version name (fixes #1563)
[lemmy.git] / docker / prod / deploy.sh
1 #!/bin/sh
2 set -e
3 #git checkout main
4
5 # Creating the new tag
6 new_tag="$1"
7 third_semver=$(echo $new_tag | cut -d "." -f 3)
8
9 # The ansible and docker installs should only update for non release-candidates
10 # IE, when the third semver is a number, not '2-rc'
11 if [ ! -z "${third_semver##*[!0-9]*}" ]; then
12   sed -i "s/dessalines\/lemmy:.*/dessalines\/lemmy:$new_tag/" ../prod/docker-compose.yml
13   sed -i "s/dessalines\/lemmy-ui:.*/dessalines\/lemmy-ui:$new_tag/" ../prod/docker-compose.yml
14   git add ../prod/docker-compose.yml
15
16   # Setting the version for Ansible
17   pushd ../../
18   echo $new_tag > "ansible/VERSION"
19   git add "ansible/VERSION"
20   popd
21 fi
22
23 # The commit
24 git commit -m"Version $new_tag"
25 git tag $new_tag
26
27 # export COMPOSE_DOCKER_CLI_BUILD=1
28 # export DOCKER_BUILDKIT=1
29
30 # Push
31 git push origin $new_tag
32 git push
33
34 # Pushing to any ansible deploys
35 # cd ../../../lemmy-ansible || exit
36 # ansible-playbook -i prod playbooks/site.yml --vault-password-file vault_pass