diff --git a/.github/workflows/build_images.yml b/.github/workflows/build_images.yml deleted file mode 100644 index b0e19bf..0000000 --- a/.github/workflows/build_images.yml +++ /dev/null @@ -1,53 +0,0 @@ ---- -# Multiarch build file credits go to Lars Kellogg-Stedman at blog.oddbit.com. If You ever see this - thanks! -name: 'build images' - -on: - push: - branches: - - master - -jobs: - docker: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Prepare - id: prep - run: | - DOCKER_IMAGE=${{ secrets.DOCKER_ORG }}/${GITHUB_REPOSITORY#*/} - VERSION=$(cat VERSION) - - TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:latest" - - # Set output parameters. - echo ::set-output name=tags::${TAGS} - echo ::set-output name=docker_image::${DOCKER_IMAGE} - - - name: Set up QEMU - uses: docker/setup-qemu-action@master - with: - platforms: all - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build - uses: docker/build-push-action@v2 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./Dockerfile - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ steps.prep.outputs.tags }} diff --git a/.github/workflows/publish-chart.yaml b/.github/workflows/publish-chart.yaml index 0d27b05..ed5e9aa 100644 --- a/.github/workflows/publish-chart.yaml +++ b/.github/workflows/publish-chart.yaml @@ -2,7 +2,7 @@ name: Publish chart on: push: tags: - - "v*.*.*" + - "*.*.*" workflow_dispatch: jobs: publish-chart: @@ -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/nix-shell-action@v3.3.0 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 "renku@datascience.ch" 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 diff --git a/deploy/chartpress.yaml b/deploy/chartpress.yaml index b9012a6..bb5c1c8 100644 --- a/deploy/chartpress.yaml +++ b/deploy/chartpress.yaml @@ -11,4 +11,5 @@ charts: contextPath: ../ dockerFilePath: ../Dockerfile valuesPath: - - image + - csiControllerRclone.rclone.image + - csiNodepluginRclone.rclone.image diff --git a/deploy/csi-rclone/values.yaml b/deploy/csi-rclone/values.yaml index 79ab0ca..1404270 100644 --- a/deploy/csi-rclone/values.yaml +++ b/deploy/csi-rclone/values.yaml @@ -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 diff --git a/devenv/nix/containerImage.nix b/devenv/nix/containerImage.nix index 1305040..9bc4e99 100644 --- a/devenv/nix/containerImage.nix +++ b/devenv/nix/containerImage.nix @@ -20,4 +20,4 @@ pkgs.dockerTools.streamLayeredImage { mkdir -p ./plugin mkdir -p ./tmp ''; -} \ No newline at end of file +} diff --git a/devenv/nix/shell.nix b/devenv/nix/shell.nix index 3c3821d..ad739b1 100644 --- a/devenv/nix/shell.nix +++ b/devenv/nix/shell.nix @@ -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" ''; }