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

fix broken alpine package repository #81

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
e1972bf
Add new arguments
Jan 10, 2020
14bdb1b
Upgrade helm3 version
Jan 10, 2020
63da276
Add repo add capabilities
Jan 10, 2020
6b6b0e1
Update readme with helm repo add instructions
Jan 10, 2020
ff8c878
Update action keys
Jan 10, 2020
268dbf3
Add missing inputs
Jan 10, 2020
5fc0329
Replace _ to -
Jan 10, 2020
7613a57
List repos to debug issue
Jan 10, 2020
29af0fe
Remove helm keyword
Jan 10, 2020
bccdbf1
Change argument type
Jan 10, 2020
901970f
Add repo update
Jan 10, 2020
d979715
Add in the same commenda
Jan 10, 2020
c272bc9
Unpack array
Jan 10, 2020
3c9ab6c
Change from const to let
Jan 10, 2020
ea3f24e
try semi colon
Jan 10, 2020
c7179e4
Merge upstream
mpraski Jan 25, 2021
6924066
Merge pull request #2 from vimeda/merge-upstream-master
mpraski Jan 25, 2021
8d17700
First add repo, then run deployment
mpraski Jan 25, 2021
bf37844
Use exception to signal failure
mpraski Jan 25, 2021
66e7ea1
Default to helm3
mpraski Jan 25, 2021
eef5203
Default options for helm3
mpraski Jan 25, 2021
caab363
Merge pull request #3 from vimeda/run-multiple-commands
mpraski Jan 25, 2021
c4bff61
Update repo cache after adding
mpraski Jan 25, 2021
3dd2a4b
Merge pull request #4 from vimeda/helm-repo-update
mpraski Jan 26, 2021
514898b
Extract process config to main function
mpraski Jan 26, 2021
88012c5
Merge pull request #5 from vimeda/move-process-config-to-main
mpraski Jan 26, 2021
8176c43
Add missing input parameters to action.yml
AyrtonRicardo Dec 6, 2021
5dc1ac6
Merge pull request #6 from AyrtonRicardo/add-missing-input-to-action-yml
AyrtonRicardo Dec 6, 2021
84210d3
Update docker image
fcjack Jan 23, 2022
9c8ceff
Merge pull request #7 from vimeda/update-docker
fcjack Jan 23, 2022
0619496
Updated helm version
Mar 16, 2022
64604cb
Merge pull request #8 from 47deg/master
kieranajp Jul 18, 2022
8ec80b5
Update README.md
4406arthur Jul 26, 2022
29480cb
Merge pull request #11 from 4406arthur/patch-1
kieranajp Nov 4, 2022
1ad3b04
Update Dockerfile to use 3.10 in PYTHONPATH
hvpareja Nov 28, 2022
d514ea0
Pin Alpine version to 3.16
hvpareja Dec 2, 2022
53f614b
Merge pull request #12 from hvpareja/update-pythonpath-3.10
kieranajp Dec 5, 2022
ecb3030
Add docker build workflow, change action to use prebuild image
CondensedTea Dec 17, 2022
caf6b94
fix ghcr password
CondensedTea Dec 17, 2022
9053a8f
add checkout step to build workflow
CondensedTea Dec 17, 2022
8c03df1
change image path to parent repo
CondensedTea Dec 17, 2022
8edef42
fix image reference in action.yml
CondensedTea Dec 17, 2022
70204fe
Merge branch 'master' into feature-docker-build-workflow
CondensedTea Dec 17, 2022
f29454d
Merge pull request #13 from CondensedTea/feature-docker-build-workflow
kieranajp Jan 3, 2023
17cc841
fix alpine package repository
libracoder Apr 19, 2023
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
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build docker image
on:
push:
branches: ["master"]

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: docker/setup-buildx-action@v2

- uses: docker/login-action@v2
with:
registry: "ghcr.io"
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/metadata-action@v4
id: meta
with:
images: "ghcr.io/vimeda/helm"
tags: |
${{ github.sha }}
latest

- uses: actions/checkout@v3

- uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
FROM alpine:3.10.2
FROM alpine:3.16.0

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.4.2-linux-amd64.tar.gz"
ENV HELM_3_FILE="helm-v3.8.1-linux-amd64.tar.gz"


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

RUN apk add --no-cache ca-certificates \
--repository http://dl-3.alpinelinux.org/alpine/edge/community/ \
--repository https://dl-3.alpinelinux.org/alpine/latest-stable/community/ \
jq curl bash nodejs aws-cli && \
# Install helm version 2:
curl -L ${BASE_URL}/${HELM_2_FILE} |tar xvz && \
Expand All @@ -21,7 +24,6 @@ RUN apk add --no-cache ca-certificates \
# Init version 2 helm:
helm init --client-only

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

COPY . /usr/src/
ENTRYPOINT ["node", "/usr/src/index.js"]
42 changes: 38 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ payload if the action was triggered by a deployment.
- `namespace`: Kubernetes namespace name. (required)
- `chart`: Helm chart path. If set to "app" this will use the built in helm
chart found in this repository. (required)
- `chart_version`: The version of the helm chart you want to deploy (distinct from app version)
- `chart-version`: The version of the helm chart you want to deploy (distinct from app version)
- `values`: Helm chart values, expected to be a YAML or JSON string.
- `track`: Track for the deployment. If the track is not "stable" it activates
the canary workflow described below.
Expand All @@ -34,7 +34,10 @@ payload if the action was triggered by a deployment.
- `helm`: Helm binary to execute, one of: [`helm`, `helm3`].
- `version`: Version of the app, usually commit sha works here.
- `timeout`: specify a timeout for helm deployment
- `repository`: specify the URL for a helm repo to come from
- `repo`: Helm chart repository to be added.
- `repo-alias`: Helm repository alias that will be used.
- `repo-username`: Helm repository username if authentication is needed.
- `repo-password`: Helm repository password if authentication is needed.
- `atomic`: If true, upgrade process rolls back changes made in case of failed upgrade. Defaults to true.

Additional parameters: If the action is being triggered by a deployment event
Expand All @@ -43,8 +46,8 @@ action will execute a `helm delete $service`

#### Versions

- `helm`: v2.16.1
- `helm3`: v3.0.0
- `helm`: v2.17.0
- `helm3`: v3.8.1

### Environment

Expand Down Expand Up @@ -158,3 +161,34 @@ jobs:
env:
KUBECONFIG_FILE: '${{ secrets.KUBECONFIG }}'
```

## Example add custom repository

Sometime you may want to add a custom repository, like [chartmuseum](https://github.com/helm/chartmuseum). For th

```yaml
# .github/workflows/pr-cleanup.yml
name: PRCleanup
on:
pull_request:
types: [closed]

jobs:
deployment:
runs-on: 'ubuntu-latest'
steps:
- name: 'Deploy'
uses: 'deliverybot/helm@v1'
with:
release: 'nginx'
namespace: 'default'
chart: 'chartmuseum/app'
token: '${{ github.token }}'
repo: 'http://chartmuseum.example.com'
repo-alias: chartmuseum
repo-username: ${{ secrets.CHARTMUSEUM_USERNAME }}
repo-password: ${{ secrets.CHARTMUSEUM_PASSWORD }}
env:
KUBECONFIG_FILE: '${{ secrets.KUBECONFIG }}'
```

31 changes: 25 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Deliverybot Helm Action
description: Deploys a helm chart
author: deliverybot
icon: box
color: gray-dark
name: Helm Deploy
description: Deploys a helm chart to Kubernetes
author: lykon
branding:
icon: anchor
color: gray-dark
inputs:
release:
description: Helm release name. Will be combined with track if set. (required)
Expand Down Expand Up @@ -45,6 +46,24 @@ inputs:
version:
description: Version of the app, usually commit sha works here.
required: false
chart-version:
description: The version of the helm chart you want to deploy (distinct from app version)
required: false
track:
description: Track for the deployment. If the track is not "stable" it activates the canary workflow described in the docs.
required: false
repo:
description: Helm chart repository to be added.
required: false
repo-alias:
description: Helm repository alias that will be used.
required: false
repo-username:
description: Helm repository username if authentication is needed.
required: false
repo-password:
description: Helm repository password if authentication is needed.
required: false
runs:
using: docker
image: Dockerfile
image: docker://ghcr.io/vimeda/helm
Loading