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