0% found this document useful (0 votes)
35 views1 page

Build Script 1

The document describes archiving a git repository HEAD into a zip file, copying it to the build directory and extracting it there. It then runs unit tests on the extracted code, checking for errors and exiting if any are found, otherwise reporting success. It then removes the existing html directory, extracts the zip file into a new directory under deployments, and symlinks the new directory as html. Finally it removes any old zip files from the deploy directory.

Uploaded by

Nilesh Kadam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views1 page

Build Script 1

The document describes archiving a git repository HEAD into a zip file, copying it to the build directory and extracting it there. It then runs unit tests on the extracted code, checking for errors and exiting if any are found, otherwise reporting success. It then removes the existing html directory, extracts the zip file into a new directory under deployments, and symlinks the new directory as html. Finally it removes any old zip files from the deploy directory.

Uploaded by

Nilesh Kadam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

git archive HEAD --format=zip > $JOB_NAME-$BUILD_NUMBER-archive.

zip
cp -r $JOB_NAME-$BUILD_NUMBER-archive.zip /build/
cd /build/
mkdir $JOB_NAME-$BUILD_NUMBER
unzip $JOB_NAME-$BUILD_NUMBER-archive.zip -d $JOB_NAME-$BUILD_NUMBER
#Unit Testing
echo "unit testing started"
if grep 'Fatel' /build/$JOB_NAME-$BUILD_NUMBER/index.php; then
echo "Test is failed in following number of line"
sed -n '/Fatel/=' /build/$JOB_NAME-$BUILD_NUMBER/index.php
exit 1
fi
echo "Test is Successful"

-------------------------------------------
cd /var/www/
sudo rm -rf html
cd /var/www/deployments
sudo mkdir $JOB_NAME-$BUILD_NUMBER
sudo unzip /deploy/$JOB_NAME-$BUILD_NUMBER-archive.zip -d
/var/www/deployments/$JOB_NAME-$BUILD_NUMBER
cd /var/www
sudo ln -s deployments/$JOB_NAME-$BUILD_NUMBER html
#Removing Cache
cd /deploy
rm DEV-*.zip

You might also like