mirror of
https://github.com/khuedoan/homelab.git
synced 2024-12-22 20:04:32 +07:00
ci: create pre-built tools image
This commit is contained in:
parent
bc8beffb73
commit
c0d1620050
@ -24,7 +24,33 @@ spec:
|
||||
value: $(params.git_url)
|
||||
- name: revision
|
||||
value: $(params.git_revision)
|
||||
- name: tools
|
||||
runAfter:
|
||||
- clone
|
||||
taskRef:
|
||||
resolver: hub
|
||||
params:
|
||||
- name: kind
|
||||
value: task
|
||||
- name: name
|
||||
value: kaniko
|
||||
- name: version
|
||||
value: "0.6"
|
||||
params:
|
||||
- name: DOCKERFILE
|
||||
value: ./Dockerfile.tools
|
||||
- name: IMAGE
|
||||
value: &toolsImage registry.khuedoan.com/homelab-tools:$(params.git_revision)
|
||||
- name: EXTRA_ARGS
|
||||
value:
|
||||
- --cache=true
|
||||
workspaces:
|
||||
- name: source
|
||||
workspace: shared-data
|
||||
- name: test
|
||||
runAfter:
|
||||
- clone
|
||||
- tools
|
||||
workspaces:
|
||||
- name: source
|
||||
workspace: shared-data
|
||||
@ -32,14 +58,12 @@ spec:
|
||||
workspaces:
|
||||
- name: source
|
||||
stepTemplate:
|
||||
image: nixos/nix:latest
|
||||
workingDir: /workspace/source
|
||||
image: *toolsImage
|
||||
workingDir: $(workspaces.source.path)
|
||||
steps:
|
||||
# TODO optimize Nix cache, this is too slow
|
||||
- name: pre-commit
|
||||
command:
|
||||
- nix-shell
|
||||
- --command
|
||||
args:
|
||||
- "pre-commit run --color=always"
|
||||
# TODO run more tests here
|
||||
|
@ -24,7 +24,33 @@ spec:
|
||||
value: $(params.git_url)
|
||||
- name: revision
|
||||
value: $(params.git_revision)
|
||||
- name: tools
|
||||
runAfter:
|
||||
- clone
|
||||
taskRef:
|
||||
resolver: hub
|
||||
params:
|
||||
- name: kind
|
||||
value: task
|
||||
- name: name
|
||||
value: kaniko
|
||||
- name: version
|
||||
value: "0.6"
|
||||
params:
|
||||
- name: DOCKERFILE
|
||||
value: ./Dockerfile.tools
|
||||
- name: IMAGE
|
||||
value: &toolsImage registry.khuedoan.com/homelab-tools:$(params.git_revision)
|
||||
- name: EXTRA_ARGS
|
||||
value:
|
||||
- --cache=true
|
||||
workspaces:
|
||||
- name: source
|
||||
workspace: shared-data
|
||||
- name: test
|
||||
runAfter:
|
||||
- clone
|
||||
- tools
|
||||
workspaces:
|
||||
- name: source
|
||||
workspace: shared-data
|
||||
@ -32,10 +58,9 @@ spec:
|
||||
workspaces:
|
||||
- name: source
|
||||
stepTemplate:
|
||||
image: nixos/nix:latest
|
||||
workingDir: /workspace/source
|
||||
image: *toolsImage
|
||||
workingDir: $(workspaces.source.path)
|
||||
steps:
|
||||
# TODO optimize Nix cache, this is too slow
|
||||
- name: pre-commit
|
||||
command:
|
||||
- nix-shell
|
||||
|
5
Dockerfile.tools
Normal file
5
Dockerfile.tools
Normal file
@ -0,0 +1,5 @@
|
||||
FROM nixos/nix
|
||||
|
||||
COPY shell.nix shell.nix
|
||||
|
||||
RUN nix-shell --command exit
|
Loading…
Reference in New Issue
Block a user