Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add dockerImage dev env package to nix flake #3424

Merged
merged 2 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 53 additions & 2 deletions ci/apps/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#@ "bump_image_in_chart_name",
#@ "bump_image_in_chart")

#@ def consent_image():
#@ return data.values.docker_registry + "/galoy-consent"
#@ def galoy_dev_image():
#@ return data.values.docker_registry + "/galoy-dev"
#@ end

#@ apps = ["consent", "dashboard"]
Expand All @@ -27,12 +27,47 @@ groups:
- #@ build_edge_image_name(app)
- #@ bump_image_in_chart_name(app)
#@ end
- name: dev-image
jobs:
- build-galoy-dev-image

jobs:
#@ for app in apps:
- #@ build_edge_image(app)
- #@ bump_image_in_chart(app)
#@ end
- name: build-galoy-dev-image
serial: true
plan:
- in_parallel:
- { get: galoy-dev-image-def, trigger: true }
- task: build
attempts: 2
privileged: true
config:
platform: linux
image_resource:
type: registry-image
source:
repository: nixos/nix
inputs:
- name: galoy-dev-image-def
path: repo
outputs:
- name: repo
run:
path: bash
args:
- -c
- |
cd repo && \
nix \
--extra-experimental-features "nix-command flakes impure-derivations ca-derivations" \
build \
".#dockerImage"
- put: galoy-dev-image
params:
image: repo/result

resources:
#@ for app in apps:
Expand Down Expand Up @@ -61,3 +96,19 @@ resources:
uri: #@ data.values.git_charts_uri
branch: "image-bump-bot-branch"
private_key: #@ data.values.github_private_key

- name: galoy-dev-image-def
type: git
source:
paths: [flake.*]
uri: #@ data.values.git_uri
branch: #@ data.values.git_branch
private_key: #@ data.values.github_private_key

- name: galoy-dev-image
type: registry-image
source:
tag: edge
username: #@ data.values.docker_registry_user
password: #@ data.values.docker_registry_password
repository: #@ galoy_dev_image()
9 changes: 9 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
postgresql
alejandra
gnumake
docker
docker-compose
shellcheck
shfmt
Expand Down Expand Up @@ -163,6 +164,14 @@
api-cron = tscDerivation {pkgName = "api-cron";};
consent = nextDerivation {pkgName = "consent";};
dashboard = nextDerivation {pkgName = "dashboard";};

dockerImage = pkgs.dockerTools.buildNixShellImage {
tag = "latest";
drv = pkgs.stdenv.mkDerivation {
name = "galoy-dev";
inherit nativeBuildInputs;
};
};
};

devShells.default = mkShell {
Expand Down
Loading