Skip to content

Commit 48d65db

Browse files
authored
Fixed agola config (#36)
* Fixed agola * Removed unnecessary clone * Removed unnecessary restore_workspace * Saved setup
1 parent 8fc7331 commit 48d65db

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

.agola/config.jsonnet

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
local alpine_runtime(version, arch) = {
2+
type: 'pod',
3+
arch: arch,
4+
containers: [
5+
{ image: 'alpine/git:' + version },
6+
],
7+
};
8+
19
local go_runtime(version, arch) = {
210
type: 'pod',
311
arch: arch,
@@ -15,7 +23,7 @@ local task_build_go(setup) = {
1523
BIN: setup.bin,
1624
},
1725
steps: [
18-
{ type: 'clone' },
26+
{ type: 'restore_workspace', dest_dir: '.' },
1927
{
2028
type: 'run',
2129
name: 'build',
@@ -36,21 +44,15 @@ local task_build_go(setup) = {
3644
go build -o ${BIN}
3745
|||,
3846
},
39-
{
47+
{
4048
type: 'save_to_workspace',
4149
contents: [{
4250
source_dir: '.',
4351
dest_dir: '.',
4452
paths: [
4553
setup.bin,
46-
'Makefile',
47-
'package/**',
48-
'fetch/**',
49-
'sql/**',
50-
'config.json',
51-
'LICENSE', // Needed by windows
5254
],
53-
}],
55+
}]
5456
},
5557
],
5658
depends: ['test'],
@@ -205,13 +207,23 @@ steps: [
205207
{
206208
name: 'ercole-agent-rhel5',
207209
tasks: [
210+
{ name: 'clone',
211+
runtime: alpine_runtime('2.36.3', 'amd64'),
212+
working_dir: '/go/src/github.com/ercole-io/ercole-agent-rhel5',
213+
steps: [
214+
{ type: 'clone' },
215+
{ type: 'save_to_workspace', contents: [{ source_dir: '.', dest_dir: '.', paths: ['**'] }] },
216+
],
217+
},
218+
] + [
208219
{ name: 'test',
209220
runtime: go_runtime('1.3', 'amd64'),
210221
working_dir: '/go/src/github.com/ercole-io/ercole-agent-rhel5',
211222
steps: [
212-
{ type: 'clone' },
223+
{ type: 'restore_workspace', dest_dir: '.' },
213224
{ type: 'run', name: '', command: 'go test ./...' },
214225
],
226+
depends: ['clone'],
215227
},
216228
] + [
217229
task_build_go(setup)

0 commit comments

Comments
 (0)