ci: ported to new Plan syntax + implemented CUE fmt + go linter + code cleanup

Signed-off-by: Sam Alba <samalba@users.noreply.github.com>
This commit is contained in:
Sam Alba
2022-02-23 15:15:44 -08:00
parent 2a9cf1ce7c
commit 297fded56d
2 changed files with 65 additions and 13 deletions

View File

@@ -6,6 +6,7 @@ import (
let GoVersion = "1.17"
let GolangCILintVersion = "1.44.0"
let CUEVersion = "0.4.2"
// Base container images used for the CI
#Images: {
@@ -40,4 +41,40 @@ let GolangCILintVersion = "1.44.0"
_goLinter: docker.#Pull & {
source: "index.docker.io/golangci/golangci-lint:v\(GolangCILintVersion)"
}
// base image for CUE cli + alpine distrib
cue: _cue._alpine.output
_cue: {
_cueBinary: docker.#Pull & {
source: "index.docker.io/cuelang/cue:\(CUEVersion)"
}
_alpine: docker.#Build & {
_packages: ["bash", "git"]
steps: [
docker.#Pull & {
source: "index.docker.io/alpine:3"
},
for pkg in _packages {
docker.#Run & {
command: {
name: "apk"
args: ["add", pkg]
flags: {
"-U": true
"--no-cache": true
}
}
}
},
docker.#Copy & {
// input: _alpine.output
contents: _cueBinary.output.rootfs
source: "/usr/bin/cue"
dest: "/usr/bin/cue"
},
]
}
}
}