mix ...
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
3424b56452
commit
d101ca8d0f
|
@ -30,7 +30,7 @@ steps:
|
||||||
image: registry.lamelio.fr/hugo
|
image: registry.lamelio.fr/hugo
|
||||||
commands:
|
commands:
|
||||||
- ./run install
|
- ./run install
|
||||||
- ./run build
|
- ./run build staging
|
||||||
when:
|
when:
|
||||||
branch:
|
branch:
|
||||||
- master
|
- master
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
baseURL: http://127.0.0.1:1313/
|
|
@ -0,0 +1 @@
|
||||||
|
baseURL: https://lowtechweb.com/
|
|
@ -0,0 +1 @@
|
||||||
|
baseURL: https://staging.lowtechweb.com/
|
80
run
80
run
|
@ -13,35 +13,81 @@ echo "││┌─┬┬┬┐└┐┌┴┬─┤└┐││││├─┤
|
||||||
echo "│└┤┼││││░││┴┤─┤│││││││┴┤┼│"
|
echo "│└┤┼││││░││┴┤─┤│││││││┴┤┼│"
|
||||||
echo "└─┴─┴──┘░└┴─┴─┴┴┘└─┴─┴─┴─┘"
|
echo "└─┴─┴──┘░└┴─┴─┴┴┘└─┴─┴─┴─┘"
|
||||||
echo
|
echo
|
||||||
|
echo
|
||||||
|
|
||||||
|
build_production() {
|
||||||
|
echo "👷 Construction du site en mode production"
|
||||||
|
rm -rf public
|
||||||
|
hugo --environment production --minify
|
||||||
|
node themes/hugo-theme-lowtech/scripts/typo
|
||||||
|
}
|
||||||
|
|
||||||
|
build_staging() {
|
||||||
|
echo "👷 Construction du site en mode staging"
|
||||||
|
rm -rf public
|
||||||
|
hugo --environment staging -D --minify
|
||||||
|
node themes/hugo-theme-lowtech/scripts/typo
|
||||||
|
}
|
||||||
|
|
||||||
|
help() {
|
||||||
|
echo "💡 Aide"
|
||||||
|
echo "-------"
|
||||||
|
echo
|
||||||
|
echo "Commandes :"
|
||||||
|
echo "- ./run install 📦 Installation des dépendances"
|
||||||
|
echo "- ./run dev 🚧 Lancement du serveur pour le développement"
|
||||||
|
echo "- ./run dev production 🚧 Lancement du serveur pour le développement sans les brouillons"
|
||||||
|
echo "- ./run build production 👷 Construction du site en mode production"
|
||||||
|
echo "- ./run build staging 👷 Construction du site en mode staging"
|
||||||
|
echo "- ./run docker 🐳 Création de l'image Docker"
|
||||||
|
echo "- ./run deploy 🚀 Déploiement avec docker-compose"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
install() {
|
||||||
|
echo "📦 Installation des dépendances"
|
||||||
|
echo "-------------------------------"
|
||||||
|
echo
|
||||||
|
echo "- Récupération du theme"
|
||||||
|
git submodule update --init
|
||||||
|
echo "- Installation des dépendances node du theme"
|
||||||
|
cd themes/hugo-theme-lowtech && npm i
|
||||||
|
}
|
||||||
|
|
||||||
if [ $# -ge 1 ]; then
|
if [ $# -ge 1 ]; then
|
||||||
if [ $1 == "dev" ]; then
|
if [ $1 == "dev" ]; then
|
||||||
hugo server -D
|
if [ $# -ge 2 ] && [ $2 == "production" ]; then
|
||||||
|
echo "🚧 Lancement du serveur pour le développement sans les brouillons"
|
||||||
|
hugo server
|
||||||
|
else
|
||||||
|
echo "🚧 Lancement du serveur pour le développement"
|
||||||
|
hugo server -D
|
||||||
|
fi
|
||||||
elif [ $1 == "build" ]; then
|
elif [ $1 == "build" ]; then
|
||||||
rm -rf public
|
if [ $# -ge 2 ] && [ $2 == "staging" ]; then
|
||||||
hugo -D --minify
|
build_staging
|
||||||
node themes/hugo-theme-lowtech/scripts/typo
|
elif [ $# -ge 2 ] && [ $2 == "production" ]; then
|
||||||
elif [ $1 == "deploy" ]; then
|
build_production
|
||||||
echo "😎 Commence le déploiement du site"
|
else
|
||||||
|
echo "💥 Il faut choisir l'environnement (production ou staging)"
|
||||||
|
echo
|
||||||
|
help
|
||||||
|
fi
|
||||||
|
elif [ $1 == "docker" ]; then
|
||||||
|
echo "🐳 Création de l'image Docker"
|
||||||
echo
|
echo
|
||||||
echo "- Construction de l'image docker 🚀"
|
|
||||||
docker build . -t kosssi/$PROJECT
|
docker build . -t kosssi/$PROJECT
|
||||||
docker tag kosssi/$PROJECT registry.lamelio.fr/$PROJECT
|
docker tag kosssi/$PROJECT registry.lamelio.fr/$PROJECT
|
||||||
docker push registry.lamelio.fr/$PROJECT
|
docker push registry.lamelio.fr/$PROJECT
|
||||||
|
elif [ $1 == "deploy" ]; then
|
||||||
|
echo "🚀 Déploiement avec docker-compose"
|
||||||
|
echo
|
||||||
docker-compose up -d
|
docker-compose up -d
|
||||||
elif [ $1 == "install" ]; then
|
elif [ $1 == "install" ]; then
|
||||||
echo "- Initialisation de git submodule"
|
install
|
||||||
git submodule update --init
|
|
||||||
echo "- Installe les dépendances node"
|
|
||||||
cd themes/hugo-theme-lowtech && npm i
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Commands:"
|
help
|
||||||
echo "- ./run install : Installe les dépendances"
|
|
||||||
echo "- ./run dev : Lance hugo pour le développement avec l'autoreload"
|
|
||||||
echo "- ./run build : Lance la génération du site pour la prod"
|
|
||||||
echo "- ./run deploy : Lance le déploiement du site"
|
|
||||||
echo
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
END=`date +%s`
|
END=`date +%s`
|
||||||
|
|
Loading…
Reference in New Issue