mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-06-19 20:54:49 -04:00
Automatic deploy 28994149
This commit is contained in:
parent
fd9ac99e5b
commit
4468c029db
4 changed files with 12 additions and 13 deletions
15
deploy.sh
15
deploy.sh
|
@ -1,19 +1,18 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Invalidate web cache
|
||||
# Generate a random number between 1000 and 9999
|
||||
random_number=$(shuf -i 1000-9999 -n 1)
|
||||
# Use sed to replace the pattern with the random number
|
||||
sed -i "s/\?v=[0-9]*/\?v=$random_number/g" ./app/src/main/assets/index.html
|
||||
|
||||
|
||||
# Replace the version code and name in gradle for fdroid and play store
|
||||
versionCode=$(($(date +%s) / 60))
|
||||
versionName=$(date +"%Y-%m-%d %H:%M:%S")
|
||||
sed -i '' -e "s/^[[:space:]]*versionCode = .*/ versionCode = $versionCode/" \
|
||||
-e "s/^[[:space:]]*versionName = .*/ versionName = \"$versionName\"/" \
|
||||
-e "s/^[[:space:]]*versionName = .*/ versionName = \"$versionCode\"/" \
|
||||
./app/build.gradle.kts
|
||||
|
||||
|
||||
|
||||
# Invalidate web cache
|
||||
sed -i "s/\?v=[0-9]*/\?v=$versionCode/g" ./app/src/main/assets/index.html
|
||||
|
||||
|
||||
git add .
|
||||
git commit -m "Automatic deploy $versionCode"
|
||||
git tag -f $versionCode
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue