From c3d98b2c2a05d7c4cb178df64150a0dc4a643b88 Mon Sep 17 00:00:00 2001 From: Mathieu Sanchez Date: Thu, 25 Apr 2019 11:20:03 +0900 Subject: [PATCH] Add cofnig jenkins API + install node on server + install pip in jenkins docker --- Config API Jenkins.sh | 71 +++++++++++++++++++++++++++++++++++++++++++ docker/install-sdk.sh | 4 ++- install.sh | 10 ++++++ 3 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 Config API Jenkins.sh diff --git a/Config API Jenkins.sh b/Config API Jenkins.sh new file mode 100644 index 0000000..f4d1c25 --- /dev/null +++ b/Config API Jenkins.sh @@ -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 \ No newline at end of file diff --git a/docker/install-sdk.sh b/docker/install-sdk.sh index acd23a0..29a7fd7 100755 --- a/docker/install-sdk.sh +++ b/docker/install-sdk.sh @@ -8,6 +8,8 @@ rm /root/sdk-tools-linux-4333796.zip yes | /root/tools/bin/sdkmanager "platforms;android-28" --sdk_root=/opt/android-sdk 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 - apt-get install -y nodejs + +git config --global http.sslverify "false" diff --git a/install.sh b/install.sh index a3fb87f..020def9 100755 --- a/install.sh +++ b/install.sh @@ -37,6 +37,12 @@ ssh-keygen -t rsa -b 4096 -C "c2a.toulouse@gmail.com" # Install let's encrypt 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 ./docker/install-nginx.sh ./docker/install-gitlab.sh @@ -46,3 +52,7 @@ git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt ./docker/install-mongo.sh 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"