diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3b79254e843ee4579e131fef11d596e1240bf783..a454e570ccb10b37e3cfa29ef558601badcec292 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,58 +9,8 @@ stages: - security include: + - local: .gitlab/ci/verify.yml + - local: .gitlab/ci/build.yml + - local: .gitlab/ci/test.yml - local: .gitlab/ci/test.dependency_check.yml - -.Check Makefile: - stage: verify - tags: - - linux, dockerd - script: - - docker run --rm -v "${PWD}:/work" -w /work mandrean/checkmake ./Makefile - -.Lint and Validate dockerfiles: - stage: verify - tags: - - linux, dockerd - script: - - make test - -.Make All Images: - stage: build - image: projectatomic/dockerfile-lint - tags: - - linux, dockerd - script: - - make - -.Test Sonar Scanner: - stage: test - tags: - - dockerd - script: - - docker run --rm its-registry.unl.edu/unl-its/docker-ci/static-code-analysis sonar-scanner -v - - docker run --rm -v "${PWD}:/work" -w /work its-registry.unl.edu/unl-its/docker-ci/detect-secrets -s - -.Test PHP Lint: - stage: test - tags: - - linux, dockerd - script: - - t/php-lint/tests.sh - -.Push to Container Registry: - after_script: - - rm -f /var/lib/gitlab-runner/.docker/config.json - stage: publish - tags: - - linux, dockerd - script: - - make publish - -.Scan with Tenable: - stage: security - tags: - - linux, dockerd - script: - - make security - + - local: .gitlab/ci/publish.yml diff --git a/.gitlab/ci/build.yml b/.gitlab/ci/build.yml new file mode 100644 index 0000000000000000000000000000000000000000..039b932fac01b8e5c3a4d3979ee9ce6e2b517d78 --- /dev/null +++ b/.gitlab/ci/build.yml @@ -0,0 +1,8 @@ + +Make All Images: + stage: build + image: projectatomic/dockerfile-lint + tags: + - linux, dockerd + script: + - make diff --git a/.gitlab/ci/publish.yml b/.gitlab/ci/publish.yml new file mode 100644 index 0000000000000000000000000000000000000000..32a03af89f12addcae38b2f2dae2ffba2646bcad --- /dev/null +++ b/.gitlab/ci/publish.yml @@ -0,0 +1,8 @@ +Push to Container Registry: + after_script: + - rm -f /var/lib/gitlab-runner/.docker/config.json + stage: publish + tags: + - linux, dockerd + script: + - make publish diff --git a/.gitlab/ci/test.yml b/.gitlab/ci/test.yml new file mode 100644 index 0000000000000000000000000000000000000000..2fcdc9d9d9e2ba65f459449ccee3c7d9528d9b3c --- /dev/null +++ b/.gitlab/ci/test.yml @@ -0,0 +1,16 @@ +Test Container Versions: + stage: test + tags: + - dockerd + script: + - docker run --rm its-registry.unl.edu/unl-its/docker-ci/static-code-analysis sonar-scanner -v + - docker run --rm -v "${PWD}:/work" -w /work its-registry.unl.edu/unl-its/docker-ci/detect-secrets -s + - docker run --rm its-registry.unl.edu/unl-its/docker-ci/dependency-check dependency-check -v + +Test PHP Lint: + stage: test + tags: + - linux, dockerd + script: + - t/php-lint/tests.sh + diff --git a/.gitlab/ci/verify.yml b/.gitlab/ci/verify.yml new file mode 100644 index 0000000000000000000000000000000000000000..b3d8218baffdcd1654550fca8d5cf071701c4712 --- /dev/null +++ b/.gitlab/ci/verify.yml @@ -0,0 +1,13 @@ +Check Makefile: + stage: verify + tags: + - linux, dockerd + script: + - docker run --rm -v "${PWD}:/work" -w /work mandrean/checkmake ./Makefile + +Lint and Validate dockerfiles: + stage: verify + tags: + - linux, dockerd + script: + - make test \ No newline at end of file