Skip to content

Commit

Permalink
initial import (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
mguptahub authored Jun 14, 2024
1 parent 5299c7e commit bc32765
Show file tree
Hide file tree
Showing 60 changed files with 4,239 additions and 0 deletions.
129 changes: 129 additions & 0 deletions .github/workflows/chart-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: Helm Preview Build

on:
workflow_dispatch:
inputs:
plane-ce:
description: "Plane CE"
required: false
default: false
type: boolean
plane-enterprise:
description: "Plane Enterprise"
required: false
default: false
type: boolean

env:
PREVIEW_BUILD_FOLDER: helm-preview
AWS_ACCESS_KEY_ID: ${{ secrets.HELM_PREVIEW_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.HELM_PREVIEW_AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ vars.HELM_PREVIEW_AWS_REGION }}
AWS_BUCKET: ${{ vars.HELM_PREVIEW_BUCKET }}
HELM_SUB_FOLDER: ${{ github.run_id }}
CHART_PREFIX: ${{ github.run_id }}
BUILD_PLANE_CE: ${{ github.event.inputs.plane-ce }}
BUILD_PLANE_EE: ${{ github.event.inputs.plane-enterprise }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v4
with:
path: code

- name: Configure Git
working-directory: code
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
mkdir -p helm-preview
- name: Set up Helm
uses: azure/setup-helm@v4

- name: Prepare GPG key #this step is for using exported keys and make your github runner
working-directory: code
run: |
gpg_dir=.cr-gpg
mkdir "$gpg_dir"
keyring="$gpg_dir/secring.gpg" #referring keyring to private key of gpg
base64 -d <<< "$GPG_KEYRING_BASE64" > "$keyring" #storing base64 GPG key into keyring
passphrase_file="$gpg_dir/passphrase"
echo "$GPG_PASSPHRASE" > "$passphrase_file" #storing passphrase data into a file
echo "CR_PASSPHRASE_FILE=$passphrase_file" >> "$GITHUB_ENV" #saving passphrase into github-environment
echo "CR_KEYRING=$keyring" >> "$GITHUB_ENV" #saving private key into github-environemnt
env:
GPG_KEYRING_BASE64: "${{ secrets.GPG_KEYRING_BASE64 }}" #Referring secrets of github above
GPG_PASSPHRASE: "${{ secrets.GPG_PASSPHRASE }}"

- id: build-plane-ce
if: ${{ env.BUILD_PLANE_CE == 'true' }}
name: Build Plane-CE
working-directory: code
env:
EXPORT_DIR: ${{env.PREVIEW_BUILD_FOLDER}}
CHART_REPO: plane-ce
run: |
flatBranchName=$(echo "${{ github.ref_name}}" | sed 's/\//\-/g')
sed -i "s/name: ${{env.CHART_REPO}}/name: ${{ env.CHART_PREFIX }}-${{env.CHART_REPO}}/" charts/${{env.CHART_REPO}}/Chart.yaml
sed -i "s/description: .*/description: ${flatBranchName}/g" charts/${{env.CHART_REPO}}/Chart.yaml
sed -i "s/version: \(.*\)/version: \1-${flatBranchName}/" charts/${{env.CHART_REPO}}/Chart.yaml
helm package --sign --key "Plane" --keyring $CR_KEYRING --passphrase-file "$CR_PASSPHRASE_FILE" charts/$CHART_REPO -u -d ${{ env.EXPORT_DIR }}/${{env.CHART_REPO}}/charts
cp charts/${{env.CHART_REPO}}/README.md ${{ env.EXPORT_DIR }}/${{env.CHART_REPO}}/${{env.CHART_REPO}}.md
helm repo index ${{ env.EXPORT_DIR }}/${{env.CHART_REPO}}
- id: build-plane-enterprise
if: ${{ env.BUILD_PLANE_EE == 'true' }}
name: Build Plane-Enterprise
working-directory: code
env:
EXPORT_DIR: ${{env.PREVIEW_BUILD_FOLDER}}
CHART_REPO: plane-enterprise
run: |
flatBranchName=$(echo "${{ github.ref_name}}" | sed 's/\//\-/g')
sed -i "s/name: ${{env.CHART_REPO}}/name: ${{ env.CHART_PREFIX }}-${{env.CHART_REPO}}/" charts/${{env.CHART_REPO}}/Chart.yaml
sed -i "s/description: .*/description: ${flatBranchName}/g" charts/${{env.CHART_REPO}}/Chart.yaml
sed -i "s/version: \(.*\)/version: \1-${flatBranchName}/" charts/${{env.CHART_REPO}}/Chart.yaml
helm package --sign --key "Plane" --keyring $CR_KEYRING --passphrase-file "$CR_PASSPHRASE_FILE" charts/$CHART_REPO -u -d ${{ env.EXPORT_DIR }}/${{env.CHART_REPO}}/charts
cp charts/${{env.CHART_REPO}}/README.md ${{ env.EXPORT_DIR }}/${{env.CHART_REPO}}/${{env.CHART_REPO}}.md
helm repo index ${{ env.EXPORT_DIR }}/${{env.CHART_REPO}}
- name: Publish
if: ${{ env.BUILD_PLANE_CE == 'true' || env.BUILD_PLANE_EE == 'true' }}
working-directory: code
run: |
# helm repo index ${{env.PREVIEW_BUILD_FOLDER}}
touch ${{env.PREVIEW_BUILD_FOLDER}}/index.html
# echo "<p>Helm Preview Build for Branch:${{github.ref_name}}</p>" > ${{env.PREVIEW_BUILD_FOLDER}}/index.html
HTML_CONTENT="
<p>Helm Preview Build for Branch:${{github.ref_name}}</p>
<ul>"
if [ "${{ env.BUILD_PLANE_CE }}" == "true" ]; then
HTML_CONTENT="$HTML_CONTENT
<li><a href='plane-ce/index.yaml'>Plane-CE</a></li>"
fi
if [ "${{ env.BUILD_PLANE_EE }}" == "true" ]; then
HTML_CONTENT="$HTML_CONTENT
<li><a href='plane-enterprise/index.yaml'>Plane-Enterprise</a></li>"
fi
HTML_CONTENT="$HTML_CONTENT
</ul>"
echo $HTML_CONTENT >> ${{env.PREVIEW_BUILD_FOLDER}}/index.html
pip install awscli
aws s3 cp ${{env.PREVIEW_BUILD_FOLDER}} s3://${{env.AWS_BUCKET}}/${{ env.HELM_SUB_FOLDER }} --recursive
echo "************************************************"
echo "http://${{env.AWS_BUCKET}}.s3-website.${{env.AWS_REGION}}.amazonaws.com/${{env.HELM_SUB_FOLDER}}"
echo "************************************************"
67 changes: 67 additions & 0 deletions .github/workflows/chart-releaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Chart Release

on:
workflow_dispatch:
push:
branches:
- master

env:
CR_CONFIGFILE: "${{ github.workspace }}/cr.yaml"
CR_TOOL_PATH: "${{ github.workspace }}/.cr-tool"
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
TARGET_BRANCH: "${{ github.ref_name }}"

jobs:
setup:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Install Helm
uses: azure/setup-helm@v4

- name: Prepare GPG key #this step is for using exported keys and make your github runner
run: |
gpg_dir=.cr-gpg
mkdir "$gpg_dir"
keyring="$gpg_dir/secring.gpg" #referring keyring to private key of gpg
base64 -d <<< "$GPG_KEYRING_BASE64" > "$keyring" #storing base64 GPG key into keyring
passphrase_file="$gpg_dir/passphrase"
echo "$GPG_PASSPHRASE" > "$passphrase_file" #storing passphrase data into a file
echo "CR_PASSPHRASE_FILE=$passphrase_file" >> "$GITHUB_ENV" #saving passphrase into github-environment
echo "CR_KEYRING=$keyring" >> "$GITHUB_ENV" #saving private key into github-environemnt
env:
GPG_KEYRING_BASE64: "${{ secrets.GPG_KEYRING_BASE64 }}" #Referring secrets of github above
GPG_PASSPHRASE: "${{ secrets.GPG_PASSPHRASE }}"

- name: Rename Chart
if: github.ref_name != 'master'
run: |
flatBranchName=$(echo "${{ env.TARGET_BRANCH }}" | sed 's/\//\-/g')
sed -i "s/name: \(.*\)/name: \1-${flatBranchName}/" charts/plane-ce/Chart.yaml
sed -i "s/name: \(.*\)/name: \1-${flatBranchName}/" charts/plane-enterprise/Chart.yaml
- name: Release Charts
uses: helm/chart-releaser-action@v1.6.0
with:
charts_dir: charts
config: cr.yaml
packages_with_index: false
skip_existing: true
env:
CR_TOKEN: ${{ env.CR_TOKEN }}
CR_KEY: "Plane"
CR_KEYRING: ${{ env.CR_KEYRING }}
CR_PASSPHRASE_FILE: ${{ env.CR_PASSPHRASE_FILE }}
CR_SIGN: true
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dist/
test-helm.yaml
.DS_Store
*/local-values.yaml
test.yaml
test-*.yaml
16 changes: 16 additions & 0 deletions artifacthub-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Artifact Hub repository metadata file
#
# Some settings like the verified publisher flag or the ignored packages won't
# be applied until the next time the repository is processed. Please keep in
# mind that the repository won't be processed if it has not changed since the
# last time it was processed. Depending on the repository kind, this is checked
# in a different way. For Helm http based repositories, we consider it has
# changed if the `index.yaml` file changes. For git based repositories, it does
# when the hash of the last commit in the branch you set up changes. This does
# NOT apply to ownership claim operations, which are processed immediately.
#
repositoryID: 1f012931-5011-4f86-bd8e-c0ef4f819ace

ignore:
- name: plane-ce
version: develop
24 changes: 24 additions & 0 deletions charts/plane-ce/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
test-*.yaml
Empty file added charts/plane-ce/Chart.lock
Empty file.
17 changes: 17 additions & 0 deletions charts/plane-ce/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v2

name: plane-ce
description: Meet Plane. An open-source software development tool to manage issues, sprints, and product roadmaps with peace of mind.

type: application

version: 1.0.18
appVersion: "0.20.0"

home: https://plane.so
icon: https://plane.so/favicon/favicon-32x32.png
sources:
- https://github.com/makeplane/plane

annotations:
artifacthub.io/license: AGPL-3.0
Loading

0 comments on commit bc32765

Please sign in to comment.