Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 799 | Blame | Compare with Previous | Last modification | View Log | RSS feed

# installation de l'espace de test
# syntax:
# make <cible> [dbu=<bdd_utilisateur> [dbp=<bdd_mot_de_passe>]]
all: test

test:
        @test '!' -e config.ini || { echo "config.ini exists"; exit 1; }
        @cp config.defaut.ini config.ini
        @sed -r -i -f test-conf.sed config.ini
        @sed -r -i -f test-sous-conf.sed config_*.ini
        @test -n "$(dbu)" -o -n "$(dbp)" && make bddconf || true

prod:
        @test '!' -e config.ini || { echo "config.ini exists"; exit 1; }
        @cp config.defaut.ini config.ini
        @sed -r -i -f prod-conf.sed config.ini
        @test -n "$(dbu)" -o -n "$(dbp)" && make bddconf || true

bddconf:
        @test -n "$(dbu)" &&  sed -r -i "/^bdd_utilisateur/s/= .*/= \"$(dbu)\"/" config.ini || true
        @test -n "$(dbp)" &&  sed -r -i "/^bdd_mot_de_passe/s/= .*/= \"$(dbp)\"/" config.ini || true

framework:
        @mv framework.defaut.php framework.php

cache:
        @cache=$(shell sed -n '/chemin_cache/s/.*= *//p' config.ini)
        @test -n "$(cache)" && mkdir -p $(cache) || true