diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8f9202a25d8205e64653c2e1a1da2ed640465408..4682398010512d258cc77d42ec7566c314fbde2d 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 9c5552cb9951165dc3ce704ae5e27e2ac63f8f51..7e3d41c2ac4a4c95e7d2a1b75aa8ad84f397b0e4 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