feat: add gitlab ci

This commit is contained in:
Nya Candy 2023-01-25 10:51:40 +08:00
parent d51bef2058
commit 7188db21b6
No known key found for this signature in database
GPG Key ID: 8B1BE5E86F2E66AE
1 changed files with 23 additions and 0 deletions

23
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,23 @@
include:
- template: Security/SAST.gitlab-ci.yml
sast:
stage: .pre
stages:
- build
build-job:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
- >-
/kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}:latest"
--destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}"