Skip to content
Draft
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
3 changes: 3 additions & 0 deletions .github/actions/default/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ runs:
steps:
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
access-tokens = github.com=${{ inputs.token }}
## Disabling cache for now, as it's slowing down the build. Downloading nix
## dependencies from cache.nixos.org is faster than restoring from the cache.
#- name: Cache dependencies
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ Dockerfile.cross
charts

*.tgz

.just-lib
53 changes: 3 additions & 50 deletions Justfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
set dotenv-load
set positional-arguments

import '.just-lib/helm/recipes.just'
export HELM_DIR := "helm"

default:
@just --list

Expand Down Expand Up @@ -40,56 +43,6 @@ generate:
generate-mock:
go generate -run mockgen ./...

helm-update:
#!/bin/bash
set pipefail -e

rm -f helm/operator/templates/gen/*
rm -f helm/crds/templates/crds/*

kustomize build config/default --output helm/operator/templates/gen
kustomize build config/crd --output helm/crds/templates/crds

# Patch all CRD files to add helm.sh/resource-policy and custom annotations support
for file in helm/crds/templates/crds/*.yaml; do
awk '/controller-gen.kubebuilder.io\/version:/ {
print
print " helm.sh/resource-policy: keep"
print " {{{{- with .Values.annotations }}"
print " {{{{- toYaml . | nindent 4 }}"
print " {{{{- end }}"
next
} 1' "$file" > "$file.tmp" && mv "$file.tmp" "$file"
done

rm -f helm/operator/templates/gen/v1_namespace*.yaml
rm -f helm/operator/templates/gen/apps_v1_deployment_*.yaml
helm dependencies update ./helm/operator

helm-validate args='':
for dir in $(ls -d helm/*); do \
helm lint ./$dir --strict {{args}}; \
helm template ./$dir {{args}}; \
done

helm-package suffix='': helm-update
#!/bin/bash
set -e
for dir in $(ls -d helm/*); do
if [ -n "{{suffix}}" ]; then
version=$(grep '^version:' "$dir/Chart.yaml" | awk '{print $2}' | tr -d '"')
pushd "$dir" && helm package . --version "${version}-{{suffix}}" && popd
else
pushd "$dir" && helm package . && popd
fi
done

helm-publish suffix='': (helm-package suffix)
echo $GITHUB_TOKEN | docker login ghcr.io -u NumaryBot --password-stdin
for path in $(ls -d helm/*/*.tgz); do \
helm push ${path} oci://ghcr.io/formancehq/helm; \
done

generate-docs:
mkdir -p "docs/09-Configuration reference"
go run github.com/elastic/crd-ref-docs@v0.2.0 \
Expand Down
18 changes: 18 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
url = "github:nix-community/NUR";
inputs.nixpkgs.follows = "nixpkgs";
};

just-lib = { url = "github:formancehq/just-lib/feat/actions-and-tests"; flake = false; };
};

outputs = { self, nixpkgs, nixpkgs-unstable, nur }:
outputs = { self, nixpkgs, nixpkgs-unstable, nur, just-lib }:
let
supportedSystems = [
"x86_64-linux"
Expand Down Expand Up @@ -46,7 +48,6 @@
go_1_26
gotools
just
kubernetes-helm
kustomize_4
setup-envtest
yq
Expand All @@ -60,7 +61,12 @@
in
{
default = pkgs.mkShell {
packages = stablePackages ++ unstablePackages ++ otherPackages;
shellHook = ''
ln -sfn ${just-lib} .just-lib
source ${just-lib}/helm/setup-plugins.sh
'';
packages = stablePackages ++ unstablePackages ++ otherPackages
++ (import "${just-lib}/helm/pkgs.nix" { inherit pkgs; });
};
}
);
Expand Down
Loading