Skip to content

Commit

Permalink
refactor(scripts): Add comments on deployment scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbmrd committed Sep 4, 2024
1 parent 6ba7ad7 commit ab0b87f
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 10 deletions.
5 changes: 5 additions & 0 deletions cleanAll
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

# Suppression :
# - des archives générées
# - des fichiers compilés
# - de la Javadoc générée

rm -f *.tar.gz
rm -rf bin/*
rm -rf docs/*
2 changes: 2 additions & 0 deletions compile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash

# Clean le projet
./cleanAll

# Compilation du projet
echo "Compiling into bin/ folder"
javac -d bin/ src/*.java
echo "Done!"
5 changes: 3 additions & 2 deletions genDeliverable
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/bin/bash

# Clean le projet
./cleanAll

# Récupération des dernières sources du projet
echo "Récupération de la dernière version du projet"
git pull --quiet

# Création de l'archive
echo "Creating archive..."

tar -cf BAUMARD-MAQUENNE.tar.gz ./docs ./src ./bin ./compile ./genDoc ./cleanAll ./hello ./runTests ./README.md

echo "Archive created with success!"
3 changes: 1 addition & 2 deletions genDoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

# Génération de la Javadoc
echo "Generating javadoc into /docs folder"

javadoc -d ./docs -quiet ./src/*.java -Xdoclint:none

echo "Done!"
15 changes: 11 additions & 4 deletions hello
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#!/bin/bash

# Création du dossier 'bin' si inexistant
if [ ! -d "bin" ]; then
echo "Directory 'bin' does not exist. Creating it..."
mkdir bin
fi

# Compilation du code
./compile

# shellcheck disable=SC2164
cd bin
java HelloWorld Jordan
java HelloWorld Mathis
cd bin || exit

# Exécution du programme
java HelloWorld
7 changes: 5 additions & 2 deletions runTests
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
#!/bin/bash

# Création du dossier 'bin' si inexistant
if [ ! -d "bin" ]; then
echo "Directory 'bin' does not exist. Creating it..."
mkdir bin
fi

# Compilation du code
./compile

cd bin || exit

args=("Jordan" "Mathis" "Billy" "Fanch")

echo "Running tests..."

# Exécution des tests
args=("Jordan" "Mathis" "Billy" "Fanch")

for arg in "${args[@]}"; do
java HelloWorld "$arg"
done
Expand Down

0 comments on commit ab0b87f

Please sign in to comment.