]> Untitled Git - lemmy.git/blob - docker/prod/deploy.sh
Revert "Revert "Removing docker/federation and docker/travis folders.""
[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 # Setting the version on the front end
10 cd ../../
11 # Setting the version on the backend
12 echo "pub const VERSION: &str = \"$new_tag\";" > "lemmy_api/src/version.rs"
13 git add "lemmy_api/src/version.rs"
14 # Setting the version for Ansible
15 echo $new_tag > "ansible/VERSION"
16 git add "ansible/VERSION"
17
18 cd docker/prod || exit
19
20 # Changing various references to the Lemmy version
21 sed -i "s/dessalines\/lemmy-ui:.*/dessalines\/lemmy-ui:$new_tag/" ../dev/docker-compose.yml
22 sed -i "s/dessalines\/lemmy:.*/dessalines\/lemmy:$new_tag/" ../prod/docker-compose.yml
23 sed -i "s/dessalines\/lemmy-ui:.*/dessalines\/lemmy-ui:$new_tag/" ../prod/docker-compose.yml
24
25 git add ../dev/docker-compose.yml
26 git add ../prod/docker-compose.yml
27
28 # The commit
29 git commit -m"Version $new_tag"
30 git tag $new_tag
31
32 # export COMPOSE_DOCKER_CLI_BUILD=1
33 # export DOCKER_BUILDKIT=1
34
35 # # Rebuilding docker
36 # if [ $third_semver -eq 0 ]; then
37 #   # TODO get linux/arm/v7 build working
38 #   # Build for Raspberry Pi / other archs too
39 #   docker buildx build --platform linux/amd64,linux/arm64 ../../ \
40 #     --file Dockerfile \
41 #     --tag dessalines/lemmy:$new_tag \
42 #     --push
43 # else
44 #   docker buildx build --platform linux/amd64 ../../ \
45 #     --file Dockerfile \
46 #     --tag dessalines/lemmy:$new_tag \
47 #     --push
48 # fi
49
50 # Push
51 git push origin $new_tag
52 git push
53
54 # Pushing to any ansible deploys
55 # cd ../../../lemmy-ansible || exit
56 # ansible-playbook -i prod playbooks/site.yml --vault-password-file vault_pass