From 05b338c9bc8e3f7e1e73ab1addfc922a932594ea Mon Sep 17 00:00:00 2001 From: Simone Gotti Date: Wed, 22 May 2019 17:09:57 +0200 Subject: [PATCH] add agola build config --- .agola/config.jsonnet | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .agola/config.jsonnet diff --git a/.agola/config.jsonnet b/.agola/config.jsonnet new file mode 100644 index 0000000..77dc847 --- /dev/null +++ b/.agola/config.jsonnet @@ -0,0 +1,38 @@ +local node_runtime(version, arch) = { + arch: arch, + containers: [ + { + image: 'node:' + version, + }, + ], +}; + +local task_build(version, arch) = { + name: 'build - node ' + version + ' ' + arch, + runtime: node_runtime(version, arch), + environment: {}, + steps: [ + { type: 'run', command: 'env' }, + { type: 'clone' }, + { type: 'restore_cache', keys: ['cache-node'+version+'-sum-{{ md5sum "package.json" }}', 'cache-node'+version+'-date-'], dest_dir: './node_modules' }, + { type: 'run', command: 'npm install' }, + { type: 'run', command: 'npm run build' }, + { type: 'save_cache', key: 'cache-node'+version+'-sum-{{ md5sum "package.json" }}', contents: [{ source_dir: './node_modules' }] }, + { type: 'save_cache', key: 'cache-node'+version+'-date-{{ year }}-{{ month }}-{{ day }}', contents: [{ source_dir: './node_modules' }] }, + ], +}; + +{ + runs: [ + { + name: 'agola web build/test', + tasks: std.flattenArrays([ + [ + task_build(version, arch), + ] + for version in ['11', '12'] + for arch in ['amd64'] + ]) + }, + ], +}