arkisto/.gitlab-ci.yml

66 lines
1.6 KiB
YAML
Raw Normal View History

2022-07-09 15:23:22 +00:00
---
# You can override the included template(s) by including variable overrides
# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings
# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings
# Container Scanning customization: https://docs.gitlab.com/ee/user/application_security/container_scanning/#customizing-the-container-scanning-settings
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
stages:
2022-07-09 15:29:18 +00:00
- build
2022-07-09 15:23:22 +00:00
- test
2022-07-09 15:29:18 +00:00
- publish
2022-07-09 17:33:29 +00:00
build:executable:
2022-07-09 15:29:18 +00:00
stage: build
image: crystallang/crystal:1.5.0
2022-07-09 15:29:18 +00:00
script:
2022-07-09 17:39:39 +00:00
# Debug
- crystal version
- shards version
# Build
2022-07-09 15:30:25 +00:00
- make build
2022-07-09 15:29:18 +00:00
artifacts:
paths:
- bin
cache:
paths:
- lib
2022-07-09 15:23:22 +00:00
build:docker-image:
2022-07-09 17:33:29 +00:00
stage: build
image: docker:20.10.16
services:
- docker:20.10.16-dind
2022-07-09 17:35:58 +00:00
needs:
2022-07-09 17:33:29 +00:00
- build:executable
script:
- apk install make
- make docker-build
- make docker-save > _artifacts/docker-image.tar
2022-07-09 17:33:29 +00:00
artifacts:
paths:
- _artifacts
2022-07-09 17:33:29 +00:00
2022-07-09 15:23:22 +00:00
sast:
stage: test
publish:docker-image:
2022-07-09 15:29:18 +00:00
stage: publish
needs:
- build:docker-image
image: docker:20.10.16
services:
- docker:20.10.16-dind
2022-07-09 15:29:18 +00:00
script:
- apk install make
- make docker-load < _artifacts/docker-image.tar
- make docker-push
2022-07-09 15:29:18 +00:00
artifacts:
paths:
- bin
2022-07-09 15:23:22 +00:00
include:
- template: Security/SAST.gitlab-ci.yml