From 3069a06ac5142303543668f810a8047ced9cfb3b Mon Sep 17 00:00:00 2001
From: Erick Hitter <git-contrib@ethitter.com>
Date: Sat, 23 Feb 2019 18:30:07 -0800
Subject: [PATCH] Working build, at long last!

---
 .gitlab-ci.yml   | 13 ++++++++-----
 scripts/build.sh | 11 ++++++++---
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8f9202a..4682398 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,14 +6,17 @@ stages:
   - test
   - deploy
 
-#test_build_script:
-#  stage: test_pre_build
-#  image: koalaman/shellcheck-alpine:latest
-#  script:
-#    - shellcheck ./scripts/build.sh
+test_build_script:
+  stage: test_pre_build
+  image: koalaman/shellcheck-alpine:latest
+  script:
+    - shellcheck ./scripts/build.sh
 
 build_nginx:
   stage: build
   script:
     - chmod +x ./scripts/build.sh
     - ./scripts/build.sh
+  artifacts:
+    paths:
+      - src/nginx/objs/nginx
diff --git a/scripts/build.sh b/scripts/build.sh
index 9c5552c..7e3d41c 100644
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -51,7 +51,7 @@ git clone -q --recursive --depth 1 https://github.com/nginx/nginx.git -b "$NGINX
 # Configure nginx
 echo ""
 echo "CONFIGURE NGINX"
-cd "$NGINX_SRC_DIR" || exit
+cd "$NGINX_SRC_DIR" || exit 1
 
 ./auto/configure \
     --prefix=/etc/nginx \
@@ -99,5 +99,10 @@ echo "BUILDING NGINX"
 echo "Using $(nproc) jobs"
 make
 
-ls -la "$NGINX_SRC_DIR"
-ls -la "$NGINX_SRC_DIR/objs"
+if [[ ! -f "$NGINX_SRC_DIR/objs/nginx" ]]; then
+    exit 1
+fi
+
+# Verify build works
+cd "$NGINX_SRC_DIR/objs" || exit 1
+./nginx -V
-- 
GitLab