🔧 Simplify scripts and development (#155)
* 🔧 Update scripts and configs * 🔧 Add shebang to script * 🔥 Remove test and dev configs, pass inline * ✨ Add local development dev-link set up * 📝 Update generated docs with refactor * 📝 Add Contributing guide
This commit is contained in:

committed by
GitHub

parent
a7fd258e18
commit
f09fb854bf
22
scripts/dev-fsfp-back.sh
Normal file
22
scripts/dev-fsfp-back.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
# Run this script from outside the project, to integrate a dev-fsfp project with changes and review modifications
|
||||
|
||||
# Exit in case of error
|
||||
set -e
|
||||
|
||||
if [ ! -d ./full-stack-fastapi-postgresql ] ; then
|
||||
echo "Run this script from outside the project, to integrate a sibling dev-fsfp project with changes and review modifications"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $(uname -s) = "Linux" ]; then
|
||||
echo "Remove __pycache__ files"
|
||||
sudo find ./dev-fsfp/ -type d -name __pycache__ -exec rm -r {} \+
|
||||
fi
|
||||
|
||||
rm -rf ./full-stack-fastapi-postgresql/\{\{cookiecutter.project_slug\}\}/*
|
||||
|
||||
rsync -a --exclude=node_modules ./dev-fsfp/* ./full-stack-fastapi-postgresql/\{\{cookiecutter.project_slug\}\}/
|
||||
|
||||
rsync -a ./dev-fsfp/{.env,.gitignore,.gitlab-ci.yml} ./full-stack-fastapi-postgresql/\{\{cookiecutter.project_slug\}\}/
|
13
scripts/dev-fsfp.sh
Normal file
13
scripts/dev-fsfp.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
# Exit in case of error
|
||||
set -e
|
||||
|
||||
if [ ! -d ./full-stack-fastapi-postgresql ] ; then
|
||||
echo "Run this script from outside the project, to generate a sibling dev-fsfp project with independent git"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -rf ./dev-fsfp
|
||||
|
||||
cookiecutter --no-input -f ./full-stack-fastapi-postgresql project_name="Dev FSFP"
|
34
scripts/dev-link.sh
Normal file
34
scripts/dev-link.sh
Normal file
@@ -0,0 +1,34 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
# Exit in case of error
|
||||
set -e
|
||||
|
||||
# Run this from the root of the project to generate a dev-link project
|
||||
# It will contain a link to each of the files of the generator, except for
|
||||
# .env and frontend/.env, that will be the generated ones
|
||||
# This allows developing with a live stack while keeping the same source code
|
||||
# Without having to generate dev-fsfp and integrating back all the files
|
||||
|
||||
rm -rf dev-link
|
||||
mkdir -p tmp-dev-link/frontend
|
||||
|
||||
cookiecutter --no-input -f ./ project_name="Dev Link"
|
||||
|
||||
mv ./dev-link/.env ./tmp-dev-link/
|
||||
mv ./dev-link/frontend/.env ./tmp-dev-link/frontend/
|
||||
|
||||
rm -rf ./dev-link/
|
||||
mkdir -p ./dev-link/
|
||||
|
||||
cd ./dev-link/
|
||||
|
||||
for f in ../\{\{cookiecutter.project_slug\}\}/* ; do
|
||||
ln -s "$f" ./
|
||||
done
|
||||
|
||||
cd ..
|
||||
|
||||
mv ./tmp-dev-link/.env ./dev-link/
|
||||
mv ./tmp-dev-link/frontend/.env ./dev-link/frontend/
|
||||
|
||||
rm -rf ./tmp-dev-link
|
@@ -1,3 +1,7 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
rm -rf \{\{cookiecutter.project_slug\}\}/.git
|
||||
rm -rf \{\{cookiecutter.project_slug\}\}/backend/app/poetry.lock
|
||||
rm -rf \{\{cookiecutter.project_slug\}\}/frontend/node_modules
|
||||
@@ -5,7 +9,5 @@ rm -rf \{\{cookiecutter.project_slug\}\}/frontend/dist
|
||||
git checkout \{\{cookiecutter.project_slug\}\}/README.md
|
||||
git checkout \{\{cookiecutter.project_slug\}\}/.gitlab-ci.yml
|
||||
git checkout \{\{cookiecutter.project_slug\}\}/cookiecutter-config-file.yml
|
||||
git checkout \{\{cookiecutter.project_slug\}\}/docker-compose.deploy.networks.yml
|
||||
git checkout \{\{cookiecutter.project_slug\}\}/.env
|
||||
git checkout \{\{cookiecutter.project_slug\}\}/frontend/.env
|
||||
|
||||
|
16
scripts/test.sh
Normal file
16
scripts/test.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
# Exit in case of error
|
||||
set -e
|
||||
|
||||
# Run this from the root of the project
|
||||
|
||||
rm -rf ./testing-project
|
||||
|
||||
cookiecutter --no-input -f ./ project_name="Testing Project"
|
||||
|
||||
cd ./testing-project
|
||||
|
||||
bash ./scripts/test.sh "$@"
|
||||
|
||||
cd ../
|
Reference in New Issue
Block a user