[gjs: 3/4] CI: create a mechanism to clean the hoard



commit 242adcd6738a9b0c9eb3e255350c0adf4f3e9e79
Author: Claudio André <claudioandre br gmail com>
Date:   Tue Oct 31 10:46:09 2017 -0200

    CI: create a mechanism to clean the hoard
    
    Using the same idea behind the "ci skip" standard for ignoring builds.

 .gitlab-ci.yml  |  7 +++++++
 test/test-ci.sh | 25 +++++++++++++++++++++++++
 2 files changed, 32 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 11912d0..670fddf 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -17,6 +17,13 @@ before_script:
     - $(pwd)/.cache/jhbuild/build/gjs/test-suite.log
 
   script:
+    # Clean the hoard (if requested)
+    - $(pwd)/test/test-ci.sh INSTALL_GIT
+    - commit_message=$(git log -1)
+    - 'if [[ $commit_message == *"[clean hoard]"* && -d "/hoard/SAVED" ]]; then
+         rm -rf /hoard/SAVED;
+       fi'
+
     # Build and test GJS
     - 'if [[ -d "/hoard/SAVED/$OS/jhbuild" ]]; then
          $(pwd)/test/test-ci.sh GET_FILES;
diff --git a/test/test-ci.sh b/test/test-ci.sh
index fe21793..58947a2 100755
--- a/test/test-ci.sh
+++ b/test/test-ci.sh
@@ -1,5 +1,27 @@
 #!/bin/bash -e
 
+function do_Install_Git(){
+    echo
+    echo '-- Installing Git --'
+
+    if [[ $BASE == "ubuntu" ]]; then
+        apt-get update -qq
+
+        # Git
+        apt-get -y -qq install git > /dev/null
+
+    elif [[ $BASE == "fedora" ]]; then
+        dnf -y -q upgrade
+
+        # git
+        dnf -y -q install git
+    else
+        echo
+        echo '-- Error: invalid BASE code --'
+        exit 1
+    fi
+}
+
 function do_Install_Base_Dependencies(){
     echo
     echo '-- Installing Base Dependencies --'
@@ -218,6 +240,9 @@ if [[ $1 == "BUILD_MOZ" ]]; then
 elif [[ $1 == "GET_FILES" ]]; then
     do_Get_Files
 
+elif [[ $1 == "INSTALL_GIT" ]]; then
+    do_Install_Git
+
 elif [[ $1 == "GJS" ]]; then
     do_Install_Base_Dependencies
     do_Install_Dependencies


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]