Add CI/CD simulation files

This commit is contained in:
m.marjorie 2025-03-31 14:09:57 +08:00
parent 20a3279dee
commit d0c9a1f935
4 changed files with 22 additions and 0 deletions

4
deployed-script.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
echo "Building..."
sleep 2
echo "Done"

4
sample/build.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
echo "Building..."
sleep 2
echo "Done"

8
sample/pipeline.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
echo "CI: Building..."
./build.sh
echo "CI: Testing..."
./test.sh || { echo "Tests failed"; exit 1; }
echo "CD: Deploying..."
cp build.sh ../deployed-script.sh
echo "Deployed!"

6
sample/test.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
if [ 1 -eq 1 ]; then
echo "Test passed"
else
exit 1
fi