|
@@ -1,36 +1,25 @@
|
|
|
#!/bin/bash
|
|
|
-# Deploy to www.jovian-hersemeule.eu
|
|
|
|
|
|
-echo 'Deploy website to OVH'
|
|
|
+echo 'Deploy website through FTP'
|
|
|
|
|
|
-gitRoot=`git rev-parse --show-toplevel`
|
|
|
-origin="$gitRoot/src"
|
|
|
-host='ftp.cluster021.hosting.ovh.net'
|
|
|
-user='jovianhedk'
|
|
|
-port='21'
|
|
|
-dest='www'
|
|
|
+: "{FTP_HOST:?FTP_HOST not set or empty}"
|
|
|
+: "{FTP_USER:?FTP_USER not set or empty}"
|
|
|
+: "{FTP_PORT:=21}"
|
|
|
+: "{FTP_DEST:=www}"
|
|
|
+: "{DIST_DIR:=dist}"
|
|
|
|
|
|
-cd $origin
|
|
|
-files=`echo favicon.ico *.php include/*.php projets/*.php include/css/*.css include/css/custom/*.css include/js/*.js include/images/* include/icon/* include/generated/*.txt download/*`
|
|
|
+files=`find $DIST_DIR -type f`
|
|
|
echo 'Files to be sent :'
|
|
|
echo "$files"
|
|
|
|
|
|
-echo "FTP to $host"
|
|
|
-read -s -p "[deploy] password for $user: " password
|
|
|
+echo "FTP to $FTP_HOST"
|
|
|
+read -s -p "[deploy] password for $FTP_USER: " password
|
|
|
echo
|
|
|
|
|
|
-# Dump varying files
|
|
|
-bash "$gitRoot/undeployed/scripts/deploy/up-date.sh"
|
|
|
-bash "$gitRoot/undeployed/scripts/deploy/up-version.sh"
|
|
|
-
|
|
|
# ftp operation
|
|
|
-ftp -pvin $host $port<<EOT
|
|
|
-user $user $password
|
|
|
-nmap \$1 $dest/\$1
|
|
|
+ftp -pvin $FTP_HOST $FTP_PORT<<EOT
|
|
|
+user $FTP_USER $password
|
|
|
+nmap $DIST_DIR\$1 $FTP_DEST/\$1
|
|
|
mput $files
|
|
|
bye
|
|
|
EOT
|
|
|
-
|
|
|
-# Cancel dump mofifications
|
|
|
-git checkout -- "$gitRoot/src/include/generated/date.txt"
|
|
|
-git checkout -- "$gitRoot/src/include/generated/version.txt"
|