Skip to content
Snippets Groups Projects
Verified Commit 6e396e1d authored by Guillaume Poittevin's avatar Guillaume Poittevin
Browse files

Fix all shell script

Change-Id: I63fa487ba021082d5c11d75e7088009a463b634c
parent ed87ced8
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
echo "Current build-version : $(<build-version)"
if [ "$1" != "" ]
then
version=$1
else
echo "Parameter version not found."
exit 1
fi
echo "Deploy version : $version"
file="app_$version.tgz"
if [ -f "$file" ]
then
echo "$file found."
else
echo "$file not found."
exit 1
fi
# rm app/ ? (assets, config, public/build, public/bundles, src, templates, tests, translations, vendor)
echo "Suppression des anciens fichiers ..."
rm -rf app/assets
rm -rf app/config
rm -rf app/public/*
rm -rf app/src
rm -rf app/templates
rm -rf app/tests
rm -rf app/translations
rm -rf app/vendor
echo "Decompression ..."
sh -c "tar xzf $file"
cd app/
echo "Composer update ..."
sh -c "composer update"
echo "Clear Caches ..."
sh -c "./bin/console cache:clear"
echo "Assets ..."
sh -c "./bin/console assets:install --symlink"
echo "Warmup ..."
sh -c "./bin/console cache:warmup"
echo "Droits ..."
chmod -R 777 var
ARG PHP_VERSION ARG PHP_VERSION
ARG COMPOSER_VERSION ARG COMPOSER_VERSION
ARG ENVIRONMENT
ARG XDEBUG_VERSION
FROM composer:${COMPOSER_VERSION} AS composer FROM composer:${COMPOSER_VERSION} AS composer
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
uid=$(stat -c %u /srv) uid=$(stat -c %u /srv)
gid=$(stat -c %g /srv) gid=$(stat -c %g /srv)
if [ $uid == 0 ] && [ $gid == 0 ]; then if [ "$uid" -eq 0 ] && [ "$gid" -eq 0 ]; then
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
php-fpm --allow-to-run-as-root php-fpm --allow-to-run-as-root
else else
...@@ -21,5 +21,5 @@ user=$(grep ":x:$uid:" /etc/passwd | cut -d: -f1) ...@@ -21,5 +21,5 @@ user=$(grep ":x:$uid:" /etc/passwd | cut -d: -f1)
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
php-fpm php-fpm
else else
exec gosu $user "$@" exec gosu "$user" "$@"
fi fi
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
PROJECT='adullact-departements_et_notaires' PROJECT='adullact-departements_et_notaires'
ZULIP_STREAM='cms-symfony' ZULIP_STREAM='cms-symfony'
NEXUS_REPO='https://nexus3-ovh.priv.atolcd.com/repository/adullact-departements_et_notaires' NEXUS_REPO='https://nexus3-ovh.priv.atolcd.com/repository/adullact-departements_et_notaires'
PHP_VERSION=$(cat .env.dist | grep "PHP_VERSION" | cut -d'=' -f2) PHP_VERSION=$(grep "PHP_VERSION" .env.dist | cut -d'=' -f2)
COMPOSER_VERSION=$(cat .env.dist | grep "COMPOSER_VERSION" | cut -d'=' -f2) COMPOSER_VERSION=$(grep "COMPOSER_VERSION" .env.dist | cut -d'=' -f2)
NODE_VERSION=$(cat .env.dist | grep "NODE_VERSION" | cut -d'=' -f2) NODE_VERSION=$(grep "NODE_VERSION" .env.dist | cut -d'=' -f2)
COMPOSER_ASK_VERSION=$(jq -r ".version" appli_sf/composer.json) COMPOSER_ASK_VERSION=$(jq -r ".version" appli_sf/composer.json)
GIT_DESCRIBE_VERSION=$(git describe --long) GIT_DESCRIBE_VERSION=$(git describe --long)
...@@ -25,10 +25,10 @@ else ...@@ -25,10 +25,10 @@ else
fi fi
# Compose env # Compose env
BASE_URL_UPLOAD=$(echo "${NEXUS_REPO}-${TYPE}") BASE_URL_UPLOAD="${NEXUS_REPO}-${TYPE}"
APP_FILENAME_TAR=$(echo "app_${VERSION}.tgz") APP_FILENAME_TAR="app_${VERSION}.tgz"
LATEST_URL=$(echo "${NEXUS_REPO}-latest") LATEST_URL="${NEXUS_REPO}-latest"
LATEST_APP_FILENAME=$(echo "app_latest-tar.txt") LATEST_APP_FILENAME="app_latest-tar.txt"
case "$1" in case "$1" in
PROJECT) echo "${PROJECT}"; exit 0;; PROJECT) echo "${PROJECT}"; exit 0;;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment