8 third_semver=$(echo $new_tag | cut -d "." -f 3)
10 # Setting the version on the front end
12 echo "export const version: string = '$(git describe --tags)';" > "ui/src/version.ts"
13 git add "ui/src/version.ts"
14 # Setting the version on the backend
15 echo "pub const VERSION: &str = \"$(git describe --tags)\";" > "server/src/version.rs"
16 git add "server/src/version.rs"
17 # Setting the version for Ansible
18 git describe --tags > "ansible/VERSION"
19 git add "ansible/VERSION"
23 # Changing the docker-compose prod
24 sed -i "s/dessalines\/lemmy:.*/dessalines\/lemmy:$new_tag/" ../prod/docker-compose.yml
25 sed -i "s/dessalines\/lemmy:.*/dessalines\/lemmy:$new_tag/" ../../ansible/templates/docker-compose.yml
26 git add ../prod/docker-compose.yml
27 git add ../../ansible/templates/docker-compose.yml
30 git commit -m"Version $new_tag"
34 docker tag dev_lemmy:latest dessalines/lemmy:x64-$new_tag
35 docker push dessalines/lemmy:x64-$new_tag
37 # Build for Raspberry Pi / other archs
39 # Arm currently not working
40 # docker build -t lemmy:armv7hf -f Dockerfile.armv7hf ../../
41 # docker tag lemmy:armv7hf dessalines/lemmy:armv7hf-$new_tag
42 # docker push dessalines/lemmy:armv7hf-$new_tag
45 # Only do this on major releases (IE the third semver is 0)
46 if [ $third_semver -eq 0 ]; then
47 # Registering qemu binaries
48 docker run --rm --privileged multiarch/qemu-user-static:register --reset
50 docker build -t lemmy:aarch64 -f Dockerfile.aarch64 ../../
51 docker tag lemmy:aarch64 dessalines/lemmy:arm64-$new_tag
52 docker push dessalines/lemmy:arm64-$new_tag
55 # Creating the manifest for the multi-arch build
56 if [ $third_semver -eq 0 ]; then
57 docker manifest create dessalines/lemmy:$new_tag \
58 dessalines/lemmy:x64-$new_tag \
59 dessalines/lemmy:arm64-$new_tag
61 docker manifest create dessalines/lemmy:$new_tag \
62 dessalines/lemmy:x64-$new_tag
65 docker manifest push dessalines/lemmy:$new_tag
68 git push origin $new_tag
71 # Pushing to any ansible deploys
73 ansible-playbook lemmy.yml --become