Skip to content

Commit

Permalink
use nix to build image for chart publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf Grubenmann committed Jan 5, 2024
1 parent 89553a8 commit ff2dc91
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 64 deletions.
53 changes: 0 additions & 53 deletions .github/workflows/build_images.yml

This file was deleted.

29 changes: 23 additions & 6 deletions .github/workflows/publish-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Publish chart
on:
push:
tags:
- "v*.*.*"
- "*.*.*"
workflow_dispatch:
jobs:
publish-chart:
Expand All @@ -17,19 +17,36 @@ jobs:
token: ${{secrets.GITHUB_TOKEN }}
- name: install dependencies
run: pip install chartpress
- name: Publish chart and images
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Flake check
run: nix flake check
- name: Publish images
uses: workflow/[email protected]
env:
DOCKER_USERNAME: ${{ secrets.RENKU_DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.RENKU_DOCKER_PASSWORD }}
with:
flakes-from-devshell: true
flakes: .#csi-rclone-container-layerd
script: |
export TAG=$(echo ${GITHUB_REF} |cut -d/ -f3)
nix build .#csi-rclone-container-layerd && ./result | docker load
docker tag csi-rclone:latest renku/csi-rclone:latest
docker tag csi-rclone:latest renku/csi-rclone:${TAG}
echo ${DOCKER_PASSWORD}|docker login -u ${DOCKER_USERNAME} --password-stdin
docker push renku/csi-rclone:latest
docker push renku/csi-rclone:${TAG}
- name: Publish chart
run: |
cd deploy
git config --global user.email "[email protected]"
git config --global user.name "Renku Bot"
echo ${DOCKER_PASSWORD}|docker login -u ${DOCKER_USERNAME} --password-stdin
export TAG=${echo ${GITHUB_REF} |cut -d/ -f3}
export TAG=$(echo ${GITHUB_REF} |cut -d/ -f3)
helm dep update csi-rclone
chartpress --tag $TAG
helm lint csi-rclone
chartpress --tag $TAG --push --publish-chart
chartpress --tag latest --push
chartpress --tag $TAG --no-build --publish-chart
3 changes: 2 additions & 1 deletion deploy/chartpress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ charts:
contextPath: ../
dockerFilePath: ../Dockerfile
valuesPath:
- image
- csiControllerRclone.rclone.image
- csiNodepluginRclone.rclone.image
2 changes: 0 additions & 2 deletions deploy/csi-rclone/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ csiNodepluginRclone:
env:
csiEndpoint: unix://plugin/csi.sock
image:
#repository: wunderio/csi-rclone
#tag: v1.3.3
repository: csi-rclone
tag: "latest"
imagePullPolicy: IfNotPresent
Expand Down
2 changes: 1 addition & 1 deletion devenv/nix/containerImage.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ pkgs.dockerTools.streamLayeredImage {
mkdir -p ./plugin
mkdir -p ./tmp
'';
}
}
2 changes: 1 addition & 1 deletion devenv/nix/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ pkgs.mkShell {
export RCLONE_CONFIG=$PROJECT_ROOT/devenv/local-s3/switch-engine-ceph-rclone-config.conf
# Load secrets as ENVs
eval "$("$direnv" dotenv bash <(sops -d .env))"
eval "$("$direnv" dotenv bash <(sops -d .env))"|| eval "bash"
'';
}

0 comments on commit ff2dc91

Please sign in to comment.