Add cofnig jenkins API + install node on server + install pip in jenkins docker
This commit is contained in:
		
							
								
								
									
										71
									
								
								Config API Jenkins.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										71
									
								
								Config API Jenkins.sh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,71 @@
 | 
				
			|||||||
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					pip3 install -r requirements.txt
 | 
				
			||||||
 | 
					pip3 install -U pytest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo
 | 
				
			||||||
 | 
					echo "#\n# Launching the users unit tests\n#"
 | 
				
			||||||
 | 
					echo
 | 
				
			||||||
 | 
					python3 -m pytest Tests/test_api_user.py -v
 | 
				
			||||||
 | 
					status=$?
 | 
				
			||||||
 | 
					if test $status -ne 0
 | 
				
			||||||
 | 
					then
 | 
				
			||||||
 | 
						echo "Error when executing the Users unit tests."
 | 
				
			||||||
 | 
					    exit 1
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
						echo "Successfully passed the Users unit tests."
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					echo
 | 
				
			||||||
 | 
					echo "#\n# Launching the reports unit tests\n#"
 | 
				
			||||||
 | 
					echo
 | 
				
			||||||
 | 
					python3 -m pytest Tests/test_api_reports.py -v
 | 
				
			||||||
 | 
					status=$?
 | 
				
			||||||
 | 
					if test $status -ne 0
 | 
				
			||||||
 | 
					then
 | 
				
			||||||
 | 
						echo "Error when executing the Reports unit tests."
 | 
				
			||||||
 | 
					    exit 1
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
						echo "Successfully passed the Reports unit tests."
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo
 | 
				
			||||||
 | 
					echo "#\n# Launching the reports unit tests\n#"
 | 
				
			||||||
 | 
					echo
 | 
				
			||||||
 | 
					python3 -m pytest Tests/pytest_api_vehicles.py -v
 | 
				
			||||||
 | 
					status=$?
 | 
				
			||||||
 | 
					if test $status -ne 0
 | 
				
			||||||
 | 
					then
 | 
				
			||||||
 | 
						echo "Error when executing the Vehicles unit tests."
 | 
				
			||||||
 | 
					    exit 1
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
						echo "Successfully passed the Vehicles unit tests."
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo
 | 
				
			||||||
 | 
					echo "#\n# Launching the Authentifications unit tests\n#"
 | 
				
			||||||
 | 
					echo
 | 
				
			||||||
 | 
					python3 -m pytest Tests/test_api_login.py -v
 | 
				
			||||||
 | 
					status=$?
 | 
				
			||||||
 | 
					if test $status -ne 0
 | 
				
			||||||
 | 
					then
 | 
				
			||||||
 | 
						echo "Error when executing the Authentifications unit tests."
 | 
				
			||||||
 | 
					    exit 1
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
						echo "Successfully passed the Authentifications unit tests."
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo
 | 
				
			||||||
 | 
					echo "#\n# Launching the Emails unit tests\n#"
 | 
				
			||||||
 | 
					echo
 | 
				
			||||||
 | 
					python3 -m pytest Tests/test_api_email.py -v
 | 
				
			||||||
 | 
					status=$?
 | 
				
			||||||
 | 
					if test $status -ne 0
 | 
				
			||||||
 | 
					then
 | 
				
			||||||
 | 
						echo "Error when executing the Emails unit tests."
 | 
				
			||||||
 | 
					    exit 1
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
						echo "Successfully passed the Emails unit tests."
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo
 | 
				
			||||||
 | 
					exit 0
 | 
				
			||||||
@@ -8,6 +8,8 @@ rm /root/sdk-tools-linux-4333796.zip
 | 
				
			|||||||
 yes | /root/tools/bin/sdkmanager "platforms;android-28" --sdk_root=/opt/android-sdk
 | 
					 yes | /root/tools/bin/sdkmanager "platforms;android-28" --sdk_root=/opt/android-sdk
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
apt-get update
 | 
					apt-get update
 | 
				
			||||||
apt-get install -y curl
 | 
					apt-get install -y curl python3-pip
 | 
				
			||||||
curl -sL https://deb.nodesource.com/setup_10.x | bash -
 | 
					curl -sL https://deb.nodesource.com/setup_10.x | bash -
 | 
				
			||||||
apt-get install -y nodejs
 | 
					apt-get install -y nodejs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					git config --global http.sslverify "false"
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										10
									
								
								install.sh
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								install.sh
									
									
									
									
									
								
							@@ -37,6 +37,12 @@ ssh-keygen -t rsa -b 4096 -C "c2a.toulouse@gmail.com"
 | 
				
			|||||||
# Install let's encrypt
 | 
					# Install let's encrypt
 | 
				
			||||||
git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
 | 
					git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Install node and NPM
 | 
				
			||||||
 | 
					apt-get update
 | 
				
			||||||
 | 
					apt-get install -y curl
 | 
				
			||||||
 | 
					curl -sL https://deb.nodesource.com/setup_10.x | bash -
 | 
				
			||||||
 | 
					apt-get install -y nodejs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Launch Install Script
 | 
					# Launch Install Script
 | 
				
			||||||
./docker/install-nginx.sh
 | 
					./docker/install-nginx.sh
 | 
				
			||||||
./docker/install-gitlab.sh
 | 
					./docker/install-gitlab.sh
 | 
				
			||||||
@@ -46,3 +52,7 @@ git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
 | 
				
			|||||||
./docker/install-mongo.sh
 | 
					./docker/install-mongo.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
service nginx restart
 | 
					service nginx restart
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Configure git if someone push from the server
 | 
				
			||||||
 | 
					git config --global user.name "Serveur"
 | 
				
			||||||
 | 
					git config --global user.email "c2a.toulouse@gmail.com"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user