mirror of
https://gitlab.com/TECHNOFAB/coder-templates.git
synced 2025-12-12 02:00:11 +01:00
ci: add CI and rename image to nix-coder-image
This commit is contained in:
parent
7cd71e7537
commit
b98a1e728c
3 changed files with 33 additions and 1 deletions
4
.gitlab-ci.yaml
Normal file
4
.gitlab-ci.yaml
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
include:
|
||||||
|
- project: TECHNOFAB/nix-gitlab-ci
|
||||||
|
ref: main
|
||||||
|
file: gitlab-ci.yml
|
||||||
28
flake.nix
28
flake.nix
|
|
@ -82,6 +82,34 @@
|
||||||
modules = [./nix-kubernetes];
|
modules = [./nix-kubernetes];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ci = {
|
||||||
|
stages = ["build" "upload"];
|
||||||
|
jobs = {
|
||||||
|
"build" = {
|
||||||
|
stage = "build";
|
||||||
|
script = [
|
||||||
|
"nix build .#nix-coder-image"
|
||||||
|
];
|
||||||
|
after_script = [
|
||||||
|
"install -D result dist/nix-coder-image.tar.gz"
|
||||||
|
];
|
||||||
|
artifacts.paths = ["dist/"];
|
||||||
|
};
|
||||||
|
"upload" = {
|
||||||
|
stage = "upload";
|
||||||
|
needs = ["build"];
|
||||||
|
deps = [pkgs.skopeo];
|
||||||
|
script = [
|
||||||
|
''
|
||||||
|
skopeo --insecure-policy copy --dest-creds "''${CI_REGISTRY_USER}:''${CI_REGISTRY_PASSWORD}" --tmpdir /tmp \
|
||||||
|
"docker-archive:dist/nix-coder-image.tar.gz" \
|
||||||
|
"docker://''${CI_REGISTRY_IMAGE}/nix-coder-image:''${CI_COMMIT_SHORT_SHA}"
|
||||||
|
''
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
container = [
|
container = [
|
||||||
{
|
{
|
||||||
name = "workspace";
|
name = "workspace";
|
||||||
image = "registry.gitlab.com/technofab/coder-templates/coder-workspace:\${data.coder_parameter.image_tag.value}";
|
image = "registry.gitlab.com/technofab/coder-templates/nix-coder-image:\${data.coder_parameter.image_tag.value}";
|
||||||
command = ["/bin/sh" "-c" "\${resource.coder_agent.coder.init_script}"];
|
command = ["/bin/sh" "-c" "\${resource.coder_agent.coder.init_script}"];
|
||||||
env = [
|
env = [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue