03451535c8
The current config format was thought for future extensions for reusing runtimes and job definitions adding some parameters. After a lot of thoughts this looks like a complex approach: the final result will be a sort of templating without a lot of powers. Other approach like external templating should be an alternative but I really don't think templating yaml is the way to go. A much better approach will to just use jsonnet when we need to create matrix runs and a lot of other use cases. So just make the config a simple yaml/json. User can generate their config using any preferred tool and in future we'll leverage jsonnet automated parsing and provide a lot of jsonnet based examples for most use cases. Main changes: * Runs are now an array and not a map. The run name is in the Name field * Tasks are now an array and not a map. The task name is in the Name field * Use https://github.com/ghodss/yaml so we'll use json struct tags and unmarshall functions
60 lines
1.7 KiB
YAML
60 lines
1.7 KiB
YAML
runs:
|
|
- name: agola build/test
|
|
tasks:
|
|
- name: build go1.12
|
|
runtime:
|
|
type: pod
|
|
arch: amd64
|
|
containers:
|
|
- image: golang:1.12-stretch
|
|
environment:
|
|
ENV01: envvalue01
|
|
working_dir: /go/src/github.com/sorintlab/agola
|
|
environment:
|
|
GO111MODULE: "on"
|
|
VAR01:
|
|
from_variable: var01
|
|
steps:
|
|
- run: env
|
|
- clone:
|
|
- run: SKIP_DOCKER_TESTS=1 go test -v -count 1 ./...
|
|
- name: build docker tests go1.12
|
|
runtime:
|
|
type: pod
|
|
arch: amd64
|
|
containers:
|
|
- image: golang:1.12-stretch
|
|
environment:
|
|
ENV01: envvalue01
|
|
working_dir: /go/src/github.com/sorintlab/agola
|
|
environment:
|
|
GO111MODULE: "on"
|
|
steps:
|
|
- run: env
|
|
- clone:
|
|
- run:
|
|
name: build docker tests binary
|
|
command: CGO_ENABLED=0 go test -c ./internal/services/runservice/executor/driver -o ./bin/docker-tests
|
|
environment:
|
|
ENV01: envvalue01
|
|
- save_to_workspace:
|
|
contents:
|
|
- source_dir: ./bin
|
|
dest_dir: /bin/
|
|
paths:
|
|
- "*"
|
|
- name: test docker driver
|
|
runtime:
|
|
type: pod
|
|
arch: amd64
|
|
containers:
|
|
- image: docker:stable-dind
|
|
privileged: true
|
|
entrypoint: dockerd
|
|
steps:
|
|
- run: env
|
|
- restore_workspace:
|
|
dest_dir: .
|
|
- run: ./bin/docker-tests -test.parallel 1 -test.v
|
|
depends:
|
|
- build docker tests go1.12 |