Files
Iain Sproat 4d831e56bb Initial helm chart and fix CircleCI (#2)
* Initial helm chart
* fix(circleci): adds ssh key finger print
2023-02-08 19:36:53 +00:00

106 lines
3.0 KiB
YAML

version: 2.1
workflows:
package-helm-chart:
jobs:
- get-version:
filters:
tags: &filter-allow-all
only: /.*/
- pre-commit:
filters:
tags: *filter-allow-all
- helm-package-and-publish:
filters:
tags: *filter-allow-all
branches: &filter-only-main
only:
- main
requires:
- get-version
- pre-commit
jobs:
get-version:
docker: &docker-image
- image: cimg/base:2022.04
working_directory: &workingdir /tmp/ci
steps:
- checkout
- run: mkdir -p workspace
- run:
name: set version
command: |
echo "export VERSION=$(.circleci/get_version.sh)" >> workspace/env-vars
- run:
name: store version
command: |
cat workspace/env-vars >> $BASH_ENV
- run:
name: echo version
command: |
echo "VERSION=${VERSION}"
- persist_to_workspace:
root: workspace
paths:
- env-vars
pre-commit:
parameters:
config_file:
default: ./.pre-commit-config.yaml
description: Optional, path to pre-commit config file.
type: string
cache_prefix:
default: ''
description: |
Optional cache prefix to be used on CircleCI. Can be used for cache busting or to ensure multiple jobs use different caches.
type: string
docker:
- image: speckle/pre-commit-runner:latest
resource_class: &docker-resource-class medium
working_directory: *workingdir
steps:
- checkout
- restore_cache:
keys:
- cache-pre-commit-<<parameters.cache_prefix>>-{{ checksum "<<parameters.config_file>>" }}
- run:
name: Install pre-commit hooks
command: pre-commit install-hooks --config <<parameters.config_file>>
- save_cache:
key: cache-pre-commit-<<parameters.cache_prefix>>-{{ checksum "<<parameters.config_file>>" }}
paths:
- ~/.cache/pre-commit
- run:
name: Run pre-commit
command: pre-commit run --all-files --config <<parameters.config_file>>
- run:
command: git --no-pager diff
name: git diff
when: on_fail
helm-package-and-publish:
docker:
- image: quay.io/helmpack/chart-testing:v3.7.1-amd64
resource_class: *docker-resource-class
working_directory: *workingdir
steps:
- checkout
- add_ssh_keys:
fingerprints:
- '99:72:8a:c8:d2:8d:f5:b8:66:c0:01:12:ee:24:2b:16'
- attach_workspace:
at: /tmp/workspace
- run:
name: populate environment variables
command: |
cat /tmp/workspace/env-vars >> $BASH_ENV
- run:
name: Build and Publish
command: ./.circleci/package_and_publish_helm.sh
environment:
APP_VERSION: '3.0.441-x64'