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

Supporting environment variables #3

Merged
merged 4 commits into from
Jun 20, 2024
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
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ LABEL maintainer="Yann David (@Typositoire) <davidyann88@gmail>"
ARG KUBERNETES_VERSION=1.28.7
ARG GCLOUD_VERSION=416.0.0
ARG DOCTL_VERSION=1.57.0
ARG AWSCLI_VERSION=2.13.25-r0
ARG AWSCLI_VERSION=2.15.14-r0
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upgraded this as I ran into an error while building.

ERROR: unable to select packages:
aws-cli-2.15.14-r0:
breaks:world[aws-cli=2.13.25-r0]

ARG HELM_PLUGINS_TO_INSTALL="https://github.com/databus23/helm-diff"


#gcloud path
ENV PATH $PATH:/usr/local/gcloud/google-cloud-sdk/bin

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PROJECT = concourse-helm3
ID = YOUR_DOCKER_HOST_HERE/${PROJECT}
ID = artielabs/${PROJECT}
VERSION = $(shell cat VERSION)


Expand Down
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
# IMPORTANT

https://github.com/Typositoire/concourse-helm3-resource/issues/102

# Helm Resource for Concourse

![CI Build](https://concourse.pubb-it.com/api/v1/teams/main/pipelines/concourse-helm3-resource/jobs/build-image-tag/badge)

Deploy [Helm Charts](https://github.com/helm/helm) from [Concourse](https://concourse-ci.org/).

Heavily based on the work of [`linkyard/concourse-helm-resource`][linkyard].

[linkyard]: https://github.com/linkyard/concourse-helm-resource
Heavily based on the work of [`linkyard/concourse-helm-resource`](https://github.com/linkyard/concourse-helm-resource).

## IMPORTANT NOTES

Expand All @@ -23,6 +17,7 @@ Heavily based on the work of [`linkyard/concourse-helm-resource`][linkyard].
- Most of those have been fixed with v1.25.0 available in GHCR only

## Docker Image

You can pull the resource image from [`typositoire/concourse-helm3-resource`][dockerhub]. !["Dockerhub Pull Badge"](https://img.shields.io/docker/pulls/typositoire/concourse-helm3-resource.svg "Dockerhub Pull Badge")

[dockerhub]: https://hub.docker.com/repository/docker/typositoire/concourse-helm3-resource
Expand All @@ -31,7 +26,7 @@ You can pull the resource image from [`typositoire/concourse-helm3-resource`][do

Starting with version 1.25.0, can you can no longer pull this resource from Docker Hub.

Starting with version 1.19.1, you can pull the resource from Github [`ghcr.io/typositoire/concourse-helm3-resource`][github packages]. Docker hub will eventually stop receiving new images.
Starting with version 1.19.1, you can pull the resource from GitHub [`ghcr.io/typositoire/concourse-helm3-resource`][github packages]. Docker hub will eventually stop receiving new images.

[github packages]: https://github.com/Typositoire/concourse-helm3-resource/pkgs/container/concourse-helm3-resource

Expand Down Expand Up @@ -64,6 +59,7 @@ resource_types:
- `stable_repo`: _Optional_ A `"false"` (must be "string" not boolean) value will disable using a default Helm stable repo. Any other value will be used to Override default Helm stable repo URL <https://charts.helm.sh/stable>. Useful if running helm deploys without internet access.
- `tracing_enabled`: _Optional._ Enable extremely verbose tracing for this resource. Useful when developing the resource itself. May allow secrets to be displayed. (Default: false)
- `helm_setup_purge_all`: _Optional._ Uninstalls and purge every helm release. Use with extreme caution. (Default: false)
- `env_vars`: _Optional._ A key/value pair of environment variables that will be set before running the helm command. This is useful for using different Helm storage options.

## Source options for Google Cloud

Expand Down Expand Up @@ -169,6 +165,8 @@ resources:
repos:
- name: some_repo
url: https://somerepo.github.io/charts
env_vars:
- HELM_DRIVER=sql
```

DigitalOcean
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.36.0
1.37.0
11 changes: 9 additions & 2 deletions assets/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,21 @@ setup_gcp_kubernetes() {
setup_helm() {
# $1 is the name of the payload file
# $2 is the name of the source directory


history_max=$(jq -r '.source.helm_history_max // "10"' < $1)

helm_bin="helm"

$helm_bin version

# Are there any environment variables? If so, let's iterate over and them set it.
env_vars=$(jq -c '.source.env_vars // {}' < "$1")
if [ "$env_vars" != "{}" ]; then
for key in $(echo "$env_vars" | jq -r 'keys[]'); do
value=$(echo "$env_vars" | jq -r --arg key "$key" '.[$key]')
export "$key"="$value"
done
fi

helm_setup_purge_all=$(jq -r '.source.helm_setup_purge_all // "false"' <$1)
if [ "$helm_setup_purge_all" = "true" ]; then
local release
Expand Down
Loading