-
Notifications
You must be signed in to change notification settings - Fork 0
/
cdnup.sh
41 lines (31 loc) · 906 Bytes
/
cdnup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
#Printa Home Atual SOMENTE A NIVEL DE INFORMACAO
printf "\n\nHOME ATUAL: "
echo $HOME
printf "\n\n"
cd ~/public_html/
# Garantindo que o git esteja com fileMode false
printf "\n"
echo 'Set file mode FALSE no GIT'
/usr/bin/git config core.fileMode false
echo 'Versao atual da CDN: '
git describe
printf "\n"
echo 'Iniciando PULL ...'
/usr/bin/git pull
printf "\n"
echo 'Nova Versão Instalada:'
/usr/bin/git describe
#Gera o txt com as infos nde versao
DESCRIBE_VERSION=$(/usr/bin/git describe)
BRANCH_NAME=$(/usr/bin/git rev-parse --abbrev-ref HEAD)
DEPLOY_DATE=$(date)
echo "$DESCRIBE_VERSION-$BRANCH_NAME" > version.txt
echo "$DEPLOY_DATE" >> version.txt
#SETA PERMISSOES CORRETAS image.php e index.php
printf "\n\n"
echo 'Seta Permissão 644 nos arquivos image.php e index.php'
chmod 644 ~/public_html/image.php
printf "\n"
echo 'Arquivo version.txt final ->'
cat version.txt