test
agola/agola-test/agola go example The run failed

This commit is contained in:
2020-05-16 00:54:48 +01:00
parent a00ee57ace
commit 7026fc7c6f
2 changed files with 51 additions and 49 deletions
+48 -49
View File
@@ -1,51 +1,50 @@
version: v0 version: v0
runs: runs:
- name: agola go example - name: agola go example
tasks: tasks:
- name: build go 1.12 - name: build go 1.12
runtime: runtime:
type: pod type: pod
arch: amd64 arch: amd64
containers: containers:
- image: golang:1.12-stretch - image: golang:1.12-stretch
steps: steps:
- clone: - clone:
- restore_cache: - restore_cache:
keys: keys:
- cache-sum-{{ md5sum "go.sum" }} - cache-sum-{{ md5sum "go.sum" }}
- cache-date- - cache-date-
## golang image sets GOPATH to /go ## golang image sets GOPATH to /go
dest_dir: /go/pkg/mod/cache dest_dir: /go/pkg/mod/cache
## This will create a binary called `agola-example-go` under ./bin - ## This will create a binary called `agola-example-go` under ./bin
- run: run:
name: build the program name: build the program
command: go build . command: go build .
## Copy the built binary to the workspace - ## Copy the built binary to the workspace
- save_to_workspace: save_to_workspace:
contents: contents:
- source_dir: . - source_dir: .
dest_dir: /bin/ dest_dir: /bin/
paths: paths:
- agola-example-go - agola-example-go
- save_cache: - save_cache:
key: cache-sum-{{ md5sum "go.sum" }} key: cache-sum-{{ md5sum "go.sum" }}
contents: contents:
- source_dir: /go/pkg/mod/cache - source_dir: /go/pkg/mod/cache
- save_cache: - save_cache:
key: cache-date-{{ year }}-{{ month }}-{{ day }} key: cache-date-{{ year }}-{{ month }}-{{ day }}
contents: contents:
- source_dir: /go/pkg/mod/cache - source_dir: /go/pkg/mod/cache
- name: run - name: run
## This task will run the built binary in the parent task and leverages the workspace capabilities ## This task will run the built binary in the parent task and leverages the workspace capabilities
runtime: runtime:
type: pod type: pod
arch: amd64 arch: amd64
containers: containers:
- image: debian:stretch - image: debian:stretch
steps: steps:
- restore_workspace: - restore_workspace:
dest_dir: . dest_dir: .
- run: ./bin/agola-example-go - run: ./bin/agola-example-go
depends: depends:
- build go 1.12 - build go 1.12
+3
View File
@@ -1,5 +1,8 @@
# Agola Go example # Agola Go example
stuff
This is just a simple example to test an agola run that'll build a simple go program using a matrix build (multiple Go versions and optionally multiple architectures) This is just a simple example to test an agola run that'll build a simple go program using a matrix build (multiple Go versions and optionally multiple architectures)
It uses the jsonnet config format. There's also a (less powerful) yaml config file (to try it delete the jsonnet config since it takes precedence) It uses the jsonnet config format. There's also a (less powerful) yaml config file (to try it delete the jsonnet config since it takes precedence)