server/.gitlab-ci.yml

123 lines
3.6 KiB
YAML
Raw Normal View History

2023-06-09 21:16:05 +00:00
---
stages:
- deps
2023-06-10 00:13:23 +00:00
- build
2023-07-22 09:39:04 +00:00
- fickit
2023-07-13 23:04:04 +00:00
- sast
2023-07-14 00:07:31 +00:00
- qa
2023-06-10 01:36:49 +00:00
- image
2023-07-14 00:07:31 +00:00
- container_scanning
2023-06-09 21:16:05 +00:00
cache:
paths:
- .go/pkg/mod/
- qa/ui/node_modules/
- frontend/ui/node_modules/
include:
- '.gitlab-ci/build.yml'
- '.gitlab-ci/image.yml'
2023-07-14 00:07:31 +00:00
- template: SAST.gitlab-ci.yml
- template: Security/Dependency-Scanning.gitlab-ci.yml
2023-07-14 00:07:31 +00:00
- template: Security/Secret-Detection.gitlab-ci.yml
- template: Security/Container-Scanning.gitlab-ci.yml
.scanners-matrix:
parallel:
matrix:
2024-03-22 22:06:40 +00:00
- IMAGE_NAME: [checker, admin, evdist, frontend-ui, nginx, dashboard, repochecker, qa, receiver, generator, remote-challenge-sync-airbus]
2023-07-14 00:07:31 +00:00
container_scanning:
stage: container_scanning
extends:
- .scanners-matrix
variables:
DOCKER_SERVICE: localhost
DOCKERFILE_PATH: Dockerfile-${IMAGE_NAME}
CI_APPLICATION_REPOSITORY: ${CI_REGISTRY_IMAGE}/${CI_COMMIT_REF_SLUG}/${IMAGE_NAME}
CI_APPLICATION_TAG: latest
GIT_STRATEGY: fetch
before_script:
- 'echo "Scanning: ${IMAGE_NAME}"'
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
sast:
stage: sast
interruptible: true
needs: []
2023-07-14 11:08:58 +00:00
before_script:
- rm -rf .go/
2023-07-14 00:07:31 +00:00
secret_detection:
stage: sast
interruptible: true
needs: []
dependency_scanning:
2023-07-14 00:07:31 +00:00
stage: qa
interruptible: true
needs: []
2023-06-10 01:36:49 +00:00
2023-06-09 21:16:05 +00:00
get-deps:
stage: deps
2024-09-13 10:09:15 +00:00
image: golang:1-alpine
2023-07-14 00:07:31 +00:00
before_script:
- export GOPATH="$CI_PROJECT_DIR/.go"
- mkdir -p .go
2023-06-09 21:16:05 +00:00
script:
- apk --no-cache add git
- go get -v -d ./...
2023-06-09 21:16:05 +00:00
vet:
stage: sast
2023-07-13 23:04:04 +00:00
needs: ["build-qa-ui"]
2023-06-09 21:16:05 +00:00
dependencies:
- build-qa-ui
2024-09-13 10:09:15 +00:00
image: golang:1-alpine
2023-07-14 00:07:31 +00:00
before_script:
- export GOPATH="$CI_PROJECT_DIR/.go"
- mkdir -p .go
2023-06-09 21:16:05 +00:00
script:
- apk --no-cache add build-base
- go vet -v -buildvcs=false -tags gitgo ./...
- go vet -v -buildvcs=false ./...
2023-07-22 09:39:04 +00:00
fickit:
stage: fickit
interruptible: true
needs: ["build-admin","build-checker","build-dashboard","build-evdist","build-generator","build-qa","build-receiver","build-repochecker"]
image: nemunaire/linuxkit
2023-07-22 09:39:04 +00:00
tags: ['docker']
before_script:
- mkdir -p ~/.docker
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"username\":\"${CI_REGISTRY_USER}\",\"password\":\"${CI_REGISTRY_PASSWORD}\"}}}" > ~/.docker/config.json
script:
- dockerd & sleep 5
- linuxkit pkg push -force -org "${CI_REGISTRY_IMAGE}/${CI_COMMIT_REF_SLUG}" fickit-pkg/boot/
- linuxkit pkg push -force -org "${CI_REGISTRY_IMAGE}/${CI_COMMIT_REF_SLUG}" fickit-pkg/kexec/
- linuxkit pkg push -force -org "${CI_REGISTRY_IMAGE}/${CI_COMMIT_REF_SLUG}" fickit-pkg/mariadb-client/
- linuxkit pkg push -force -org "${CI_REGISTRY_IMAGE}/${CI_COMMIT_REF_SLUG}" fickit-pkg/mdadm/
- linuxkit pkg push -force -org "${CI_REGISTRY_IMAGE}/${CI_COMMIT_REF_SLUG}" fickit-pkg/rsync/
- linuxkit pkg push -force -org "${CI_REGISTRY_IMAGE}/${CI_COMMIT_REF_SLUG}" fickit-pkg/syslinux/
- linuxkit pkg push -force -org "${CI_REGISTRY_IMAGE}/${CI_COMMIT_REF_SLUG}" fickit-pkg/unbound/
- sed -i "s@nemunaire/fic-@${CI_REGISTRY_IMAGE}/master/@;s@nemunaire/@${CI_REGISTRY_IMAGE}/${CI_COMMIT_REF_SLUG}/@" fickit-backend.yml fickit-boot.yml fickit-frontend.yml fickit-prepare.yml fickit-update.yml
- linuxkit build -format kernel+squashfs fickit-backend.yml
- linuxkit build -format kernel+squashfs fickit-frontend.yml
2023-07-24 14:14:52 +00:00
- linuxkit build -format kernel+initrd fickit-boot.yml
- linuxkit build -format kernel+initrd fickit-prepare.yml
- linuxkit build -format kernel+initrd fickit-update.yml
2023-07-22 09:39:04 +00:00
artifacts:
2023-10-23 17:06:14 +00:00
expire_in: 8 hours
2023-07-22 09:39:04 +00:00
paths:
- fickit-backend-squashfs.img
- fickit-frontend-squashfs.img
2023-07-24 14:14:52 +00:00
- fickit-boot-kernel
- fickit-boot-initrd.img
- fickit-prepare-initrd.img
- fickit-update-initrd.img