Now that we have the GitLab job helper functions in place, we can wire
them up to the CLI interface.

Signed-off-by: Erik Skultety <[email protected]>
---
 ci/Makefile |  5 ++---
 ci/build.sh | 39 +++++++++++++++++++++++++++++++++++++--
 2 files changed, 39 insertions(+), 5 deletions(-)

diff --git a/ci/Makefile b/ci/Makefile
index 217eda3cc0..8525b2ff88 100644
--- a/ci/Makefile
+++ b/ci/Makefile
@@ -208,11 +208,10 @@ ci-shell@%:
        $(MAKE) -C $(CI_ROOTDIR) ci-run-command@$* CI_COMMAND="/bin/bash"
 
 ci-build@%:
-       $(MAKE) -C $(CI_ROOTDIR) ci-run-command@$* 
CI_COMMAND="$(CI_USER_HOME)/build"
+       $(MAKE) -C $(CI_ROOTDIR) ci-run-command@$* 
CI_COMMAND="$(CI_USER_HOME)/build --build"
 
 ci-test@%:
-       $(MAKE) -C $(CI_ROOTDIR) ci-build@$*
-
+       $(MAKE) -C $(CI_ROOTDIR) ci-run-command@$* 
CI_COMMAND="$(CI_USER_HOME)/build --build --test"
 ci-help:
        @echo
        @echo
diff --git a/ci/build.sh b/ci/build.sh
index f169dd01a1..aeb1bf4b05 100644
--- a/ci/build.sh
+++ b/ci/build.sh
@@ -65,9 +65,44 @@ run_website_build() {
 }
 
 main() {
+    ACTIONS=""
+
+    while [ "$#" -ne 0 ]
+    do
+        case "$1" in
+            --build)
+                ACTIONS="$ACTIONS run_build"
+                ;;
+            --potfile)
+                ACTIONS="$ACTIONS run_potfile"
+                ;;
+            --codestyle)
+                ACTIONS="$ACTIONS run_codestyle"
+                ;;
+            --rpmbuild)
+                ACTIONS="$ACTIONS run_rpmbuild"
+                ;;
+            --test)
+                ACTIONS="$ACTIONS run_test"
+                ;;
+            --website)
+                ACTIONS="$ACTIONS run_website_build"
+                ;;
+            *)
+                echo "Error: Unknown action '$1'"
+                exit 1
+                ;;
+        esac
+        shift
+    done
+
+    ACTIONS=${ACTIONS:=run_build}
+
     run_meson_setup
-    run_build
-    run_test
+    for action in $ACTIONS
+    do
+        $action
+    done
 }
 
 main "$@"
-- 
2.39.1

Reply via email to