chore: added script builder and updated scripts
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
872628fe05
commit
edb2f36b57
4 changed files with 89 additions and 1 deletions
|
@ -1,3 +1,15 @@
|
||||||
|
# !/usr/bin/env bash
|
||||||
|
|
||||||
|
#mfgames-project:setup@v0.0.0
|
||||||
|
log() { echo "🚧 $(basename $0): $@"; }
|
||||||
|
cd $(dirname $(dirname $0))
|
||||||
|
#mfgames-project:setup
|
||||||
|
|
||||||
|
log "cleaning old files"
|
||||||
rm -f *.epub *.pdf
|
rm -f *.epub *.pdf
|
||||||
|
|
||||||
|
log "installing NPM"
|
||||||
npm install --ci
|
npm install --ci
|
||||||
|
|
||||||
|
log "running build"
|
||||||
npm run build
|
npm run build
|
||||||
|
|
55
scripts/mfgames-project-script-builder.sh
Executable file
55
scripts/mfgames-project-script-builder.sh
Executable file
|
@ -0,0 +1,55 @@
|
||||||
|
# !/usr/bin/env bash
|
||||||
|
|
||||||
|
# Variables
|
||||||
|
version=0.0.0
|
||||||
|
|
||||||
|
# Make sure we have the proper parameters.
|
||||||
|
usage() {
|
||||||
|
echo "USAGE $0 script.sh [script2.sh]"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "x$1" = "x" ]
|
||||||
|
then
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Go through the script and look for each one.
|
||||||
|
for script in "$@"
|
||||||
|
do
|
||||||
|
# Write out the file.
|
||||||
|
echo '# !/usr/bin/env bash' > .mfgames-project.tmp
|
||||||
|
|
||||||
|
if [ -f $script ]
|
||||||
|
then
|
||||||
|
cat $script \
|
||||||
|
| sed -n '/usr.bin.env bash/!p' \
|
||||||
|
| sed '/^#mfgames-project:setup@/q' \
|
||||||
|
| sed -n '/mfgames-project:setup/!p' \
|
||||||
|
>> .mfgames-project.tmp
|
||||||
|
else
|
||||||
|
echo >> .mfgames-project.tmp
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "#mfgames-project:setup@v$version" >> .mfgames-project.tmp
|
||||||
|
|
||||||
|
if [ -f $script ] && grep 'log() { echo' $script > /dev/null
|
||||||
|
then
|
||||||
|
grep 'log() { echo' $script >> .mfgames-project.tmp
|
||||||
|
else
|
||||||
|
unicode=$(unipicker)
|
||||||
|
echo "log() { echo \"$unicode \$(basename \$0): \$@\"; }" >> .mfgames-project.tmp
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "cd \$(dirname \$(dirname \$0))" >> .mfgames-project.tmp
|
||||||
|
echo "#mfgames-project:setup" >> .mfgames-project.tmp
|
||||||
|
|
||||||
|
if [ -f $script ]
|
||||||
|
then
|
||||||
|
sed '1,/^#mfgames-project:setup$/d' < $script >> .mfgames-project.tmp
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Finish up and make the script executable.
|
||||||
|
mv .mfgames-project.tmp $script
|
||||||
|
chmod a+x $script
|
||||||
|
done
|
|
@ -1,4 +1,15 @@
|
||||||
cd $(dirname $0)/..
|
# !/usr/bin/env bash
|
||||||
|
|
||||||
|
#mfgames-project:setup@v0.0.0
|
||||||
|
log() { echo "🚢 $(basename $0): $@"; }
|
||||||
|
cd $(dirname $(dirname $0))
|
||||||
|
#mfgames-project:setup
|
||||||
|
|
||||||
|
log "cleaning old old version"
|
||||||
rm -f exit-planning*
|
rm -f exit-planning*
|
||||||
|
|
||||||
|
log "installing NPM"
|
||||||
npm install --ci
|
npm install --ci
|
||||||
|
|
||||||
|
log "running release"
|
||||||
npx semantic-release
|
npx semantic-release
|
||||||
|
|
|
@ -1,2 +1,12 @@
|
||||||
|
# !/usr/bin/env bash
|
||||||
|
|
||||||
|
#mfgames-project:setup@v0.0.0
|
||||||
|
log() { echo "🧪 $(basename $0): $@"; }
|
||||||
|
cd $(dirname $(dirname $0))
|
||||||
|
#mfgames-project:setup
|
||||||
|
|
||||||
|
log "installing NPM"
|
||||||
npm install --ci
|
npm install --ci
|
||||||
|
|
||||||
|
log "verifying commits"
|
||||||
npx commitlint-gitlab-ci -x @commitlint/config-conventional
|
npx commitlint-gitlab-ci -x @commitlint/config-conventional
|
||||||
|
|
Loading…
Reference in a new issue