Add dependency check jobs

parent 5b0bb5fc
Pipeline #32554447 passed with stages
in 29 minutes and 46 seconds
......@@ -9,7 +9,7 @@ stages:
- cleanup
variables:
CI_IMAGE: registry.gitlab.com/gitlab-org/gitlab-runner/ci:1.8.7-0
CI_IMAGE: registry.gitlab.com/gitlab-org/gitlab-runner/ci:1.8.7-1
GOROOT: /usr/local/go
before_script:
......@@ -29,7 +29,7 @@ image: $CI_IMAGE
services:
- docker:dind
variables: &docker_variables
CI_IMAGE: registry.gitlab.com/gitlab-org/gitlab-runner/ci:1.8.7-0
CI_IMAGE: registry.gitlab.com/gitlab-org/gitlab-runner/ci:1.8.7-1
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker:2375
tags:
......@@ -155,6 +155,25 @@ tests definitions:
tags:
- gitlab-org
dep check:
<<: *except_docs
stage: prebuild
cache: {}
dependencies:
script:
- make dep_check
dep status:
<<: *except_docs
stage: prebuild
cache: {}
dependencies:
script:
- make dep_status
only:
variables:
- $CI_DEP_STATUS_ENABLED
#
# Test stage
#
......@@ -480,3 +499,4 @@ static QA:
jq -C . gl-code-quality-report.json
exit 1
fi
......@@ -56,9 +56,10 @@ export CGO_ENABLED ?= 0
# Development Tools
DEP = $(GOPATH_BIN)/dep
GOX = $(GOPATH_BIN)/gox
MOCKERY = $(GOPATH_BIN)/mockery
DEVELOPMENT_TOOLS = $(GOX) $(MOCKERY)
DEVELOPMENT_TOOLS = $(DEP) $(GOX) $(MOCKERY)
MOCKERY_FLAGS = -note="This comment works around https://github.com/vektra/mockery/issues/155"
......@@ -371,6 +372,12 @@ development_setup:
if prlctl --version ; then $(MAKE) -C tests/ubuntu parallels ; fi
if vboxmanage --version ; then $(MAKE) -C tests/ubuntu virtualbox ; fi
dep_check: $(DEP)
@cd $(PKG_BUILD_DIR) && $(DEP) check
dep_status: $(DEP)
@./scripts/dep_status_check $(PKG_BUILD_DIR)
# local GOPATH
$(GOPATH_SETUP): $(PKG_BUILD_DIR)
mkdir -p $(GOPATH_BIN)
......@@ -381,6 +388,9 @@ $(PKG_BUILD_DIR):
ln -s ../../../.. $@
# development tools
$(DEP): $(GOPATH_SETUP)
go get github.com/golang/dep/cmd/dep
$(GOX): $(GOPATH_SETUP)
go get github.com/mitchellh/gox
......
......@@ -5,7 +5,7 @@ RUN apt-get update -yq
RUN apt-get install -yq locales make xz-utils \
ruby ruby-dev python-pip \
dpkg-sig createrepo rpm \
zip libffi-dev
zip libffi-dev jq
# Set default locale for the environment
RUN echo "en_US UTF-8" > /etc/locale.gen; \
......@@ -22,6 +22,6 @@ RUN wget -q https://get.docker.com/builds/Linux/x86_64/docker-1.13.1.tgz -O /tmp
chmod +x /usr/bin/docker*; \
rm -rf /tmp/*
COPY Makefile /tmp/
COPY Makefile* /tmp/
RUN cd /tmp; \
make deps package-deps packagecloud-deps
#!/bin/bash
pkgBuildDir="${1}"
outDir="$(pwd)/out"
reportFile="${outDir}/dep_status"
mkdir -p "${outDir}"
cd "${pkgBuildDir}"
dep status -v -old -json > "${reportFile}"
if [ "$(cat "${reportFile}")" == "[]" ] ; then
exit 0
fi
jq -C . "${reportFile}"
exit 1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment