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

Adds S3 helm repo as an option to deploy from #5

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
0116a1f
Installs helm-s3 plugin
miagao Jan 24, 2024
0feab19
Passes credentials to exec action
miagao Jan 24, 2024
d5d4e61
Uppercase env variables
miagao Jan 24, 2024
51a78d7
Passes env to exec.exec
miagao Jan 24, 2024
49739f3
Adds debug
miagao Jan 24, 2024
2ebab00
Inserts env vars in exec
miagao Jan 24, 2024
237efab
Fixes quote typo
miagao Jan 24, 2024
640b954
Fixes quote typo
miagao Jan 24, 2024
569b2a4
Removes repo add command
miagao Jan 24, 2024
30fe33a
Inserts env vars in exec
miagao Jan 24, 2024
10a412c
Adds KUBECONFIG file to env
miagao Jan 24, 2024
888d765
Adds process.env to helm exec
miagao Jan 24, 2024
0d62141
Adds process.env to helm exec
miagao Jan 24, 2024
591bbc0
Adds repo add in script
miagao Jan 24, 2024
a94113a
Adds plugin install into js
miagao Jan 24, 2024
bced652
Updates helm version
miagao Jan 24, 2024
841a1f2
Debugs
miagao Jan 24, 2024
308ca72
Debugs
miagao Jan 24, 2024
6c2695a
Debugs
miagao Jan 24, 2024
f7093fb
Debugs
miagao Jan 24, 2024
e930922
Debugs
miagao Jan 24, 2024
1685c74
Removed helm 2
miagao Jan 24, 2024
997d16b
Removed helm 2
miagao Jan 24, 2024
05b9f44
Debugs
miagao Jan 24, 2024
43916b4
Debugs
miagao Jan 24, 2024
3204493
Debugs
miagao Jan 24, 2024
79ea753
Debugs
miagao Jan 24, 2024
c1810c7
Debugs
miagao Jan 24, 2024
731b1a9
Debugs
miagao Jan 24, 2024
35eecaa
Removing env vars from js
miagao Jan 24, 2024
b379543
Listing helm env vars
miagao Jan 24, 2024
848d498
Adding ENV vars to match github user that runs nodejs
miagao Jan 24, 2024
4340e05
Adding ENV vars to match github user that runs nodejs
miagao Jan 24, 2024
919a446
Adding ENV VARS in index.js that matches DockerFile's
miagao Jan 24, 2024
647a516
Adding ENV VARS in Dockerfile to ensure their parity
miagao Jan 24, 2024
3999e4c
Fixes dryrun logic
miagao Feb 5, 2024
694de9c
rollback
miagao Feb 5, 2024
a8d4bf8
Tests new dryrun logic
miagao Feb 5, 2024
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
15 changes: 13 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@ ENV BASE_URL="https://get.helm.sh"

ENV HELM_2_FILE="helm-v2.17.0-linux-amd64.tar.gz"
ENV HELM_3_FILE="helm-v3.6.3-linux-amd64.tar.gz"
# make sure these variables are the same in index.js as Gitgub can change the user home
ENV HELM_CACHE_HOME="/root/.cache/helm"
ENV HELM_CONFIG_HOME="/root/.config/helm"
ENV HELM_DATA_HOME="/root/.local/share/helm"
ENV HELM_PLUGINS="/root/.local/share/helm/plugins"
ENV HELM_REGISTRY_CONFIG="/root/.config/helm/registry.json"
ENV HELM_REPOSITORY_CACHE="/root/.cache/helm/repository"
ENV HELM_REPOSITORY_CONFIG="/root/.config/helm/repositories.yaml"

RUN apk add --no-cache ca-certificates \
--repository http://dl-3.alpinelinux.org/alpine/edge/community/ \
jq curl bash nodejs aws-cli py3-setuptools &&\
apk add py3-pip && \
apk add py3-pip git && \
pip3 install awscli
RUN \
# Install helm version 2:
Expand All @@ -22,7 +30,10 @@ RUN \
chmod +x /usr/bin/helm3 && \
rm -rf linux-amd64 && \
# Init version 2 helm:
helm init --client-only
helm init --client-only && \
# install helm s3 plugin
helm3 plugin install https://github.com/hypnoglow/helm-s3.git


ENV PYTHONPATH "/usr/lib/python3.8/site-packages/"

Expand Down
28 changes: 28 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@ async function run() {
process.env.XDG_DATA_HOME = "/root/.helm/"
process.env.XDG_CACHE_HOME = "/root/.helm/"
process.env.XDG_CONFIG_HOME = "/root/.helm/"
process.env.HELM_CACHE_HOME="/root/.cache/helm"
process.env.HELM_CONFIG_HOME="/root/.config/helm"
process.env.HELM_DATA_HOME="/root/.local/share/helm"
process.env.HELM_PLUGINS="/root/.local/share/helm/plugins"
process.env.HELM_REGISTRY_CONFIG="/root/.config/helm/registry.json"
process.env.HELM_REPOSITORY_CACHE="/root/.cache/helm/repository"
process.env.HELM_REPOSITORY_CONFIG="/root/.config/helm/repositories.yaml"
} else {
process.env.HELM_HOME = "/root/.helm/"
}
Expand Down Expand Up @@ -252,6 +259,27 @@ async function run() {
ignoreReturnCode: true
});
}
let output = "";
let error = "";
let outputStdline = "";

const options = {};
options.listeners = {
stdout: (data) => {
output += data.toString();
},
stderr: (data) => {
error += data.toString();
},
stdline: (data) => {
outputStdline += data;
},
};
let command = "helm3 plugin list "
core.debug(command)
await exec.exec(command, "", options)
core.debug("output =%s",output)
core.debug("stdline =%s", outputStdline)

// Actually execute the deployment here.
if (task === "remove") {
Expand Down