Commit 7841db27 authored by Olav's avatar Olav

updated files

parent 4cd56801
#!/bin/bash -x
!/bin/bash -x
# all scripts start with the above line. "-x" makes the script print out what it is doing in addition to doing it.
# a shellscript is simply a list of normal shell-commands.
......@@ -7,37 +7,16 @@
# running the command ls
# ls
#GIT_SSH_COMMAND='ssh -i /var/jenkins_home/starfleet_key -o IdentitiesOnly=yes'
# GIT_SSH_COMMAND='ssh -i /var/jenkins_home/starfleet_key -o IdentitiesOnly=yes'
# 1- clone the git repo
# 1 - clone the git repo
cd jenkins-temp
git clone https://git.cs.hioa.no/s306386/starfleet.git
cd ..
# 2- enter the git repo and build container
docker build -t starfleet:v1 ./starfleet/
# 2 - enter the git repo and build container
docker build -t starfleet:v1 jenkins-temp/starfleet/
# 3- start container
docker run -p 10080:80 --name starfleet-temp -d starfleet:v1
# 4- check the website
if curl -s http://10.0.45.30:10080/hello_world.html | grep "Hello World" ;then
# If helle world excist
echo " Hello world excist"
# clean up
docker stop starfleet-temp
docker rm starfleet-temp
rm -r starfleet
# change production server
exit 0
else
echo " Hello world doesnt excist"
# clean up
docker stop starfleet-temp
docker rm starfleet-temp
rm -r starfleet
exit 1
fi
\ No newline at end of file
# 3 - start container
docker run -p 10080:80 --name starfleet-temp -d starfleet:v1
\ No newline at end of file
#! /bin/bash
test_successCode=-1
if curl -s http://10.0.45.30:10080/hello_world.html | grep "Hello World" ;then
# If hello world excist
# If helle world excist
echo " Hello world excist"
test_successCode=0
# clean up
# docker stop starfleet-temp
# docker rm starfleet-temp
......@@ -17,7 +17,6 @@ if curl -s http://10.0.45.30:10080/hello_world.html | grep "Hello World" ;then
test_successCode=0
else
echo " Hello world doesnt excist"
test_successCode=1
# clean up
# docker stop starfleet-temp
# docker rm starfleet-temp
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment