Skip to content

Commit

Permalink
Merge pull request #1 from apache/main
Browse files Browse the repository at this point in the history
Pull origin
  • Loading branch information
warren830 authored Apr 24, 2023
2 parents 5e604c4 + 19c77c9 commit 31a76a4
Show file tree
Hide file tree
Showing 16 changed files with 594 additions and 418 deletions.
23 changes: 23 additions & 0 deletions .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,26 @@ github:

ghp_branch: gh-pages
ghp_path: /
enabled_merge_buttons:
# only allow squash merge
squash: true
merge: false
rebase: false
# delete origin branch after merged
del_branch_on_merge: true
protected_branches:
main:
required_status_checks:
# strict means "Require branches to be up to date before merging".
strict: true
required_pull_request_reviews:
dismiss_stale_reviews: true
require_code_owner_reviews: false
required_approving_review_count: 1
collaborators:
- daniel-hutao

notifications:
commits: [email protected]
issues: [email protected]
pullrequests: [email protected]
28 changes: 16 additions & 12 deletions .github/workflows/deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,18 @@ on:
paths:
- charts/devlake/**
- .github/workflows/deploy-test.yml
- '!**.md'

jobs:
deploy-with-helm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
database_type: ["mysql-builtin", "mysql-external", "pgsql-builtin"]
database_type: ["mysql-builtin",
# "pgsql-builtin",
"mysql-external"
]
steps:
- name: Creating kind cluster
uses: container-tools/kind-action@v1
Expand Down Expand Up @@ -79,17 +83,17 @@ jobs:
kubectl get pods -o wide
kubectl get services -o wide
- name: Helm install devlake
if: matrix.database_type == 'pgsql-builtin'
run: |
export NODE_IP=$(kubectl get nodes --namespace default -o jsonpath="{.items[0].status.addresses[0].address}")
echo Node IP: ${NODE_IP}
helm install --wait --timeout 300s deploy-test charts/devlake \
--set service.uiPort=30000 \
--set option.database=pgsql \
--set option.localtime=""
kubectl get pods -o wide
kubectl get services -o wide
# - name: Helm install devlake
# if: matrix.database_type == 'pgsql-builtin'
# run: |
# export NODE_IP=$(kubectl get nodes --namespace default -o jsonpath="{.items[0].status.addresses[0].address}")
# echo Node IP: ${NODE_IP}
# helm install --wait --timeout 300s deploy-test charts/devlake \
# --set service.uiPort=30000 \
# --set option.database=pgsql \
# --set option.localtime=""
# kubectl get pods -o wide
# kubectl get services -o wide

# TODO: using some e2e test code to replace it
- name: Curl with endpoints
Expand Down
79 changes: 79 additions & 0 deletions .github/workflows/lint-chart-and-app-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Lint for chart versions
on:
pull_request:
branches:
- main
paths:
- charts/**
- '!**.md'
jobs:
check_chart_version_matches_app_version:
name: chart version matches app version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install yq
run: echo yq should already in github ubuntu-latest
- name: chart version align with app version
run: |
set -e
chart_version_text=$(yq .version ${GITHUB_WORKSPACE}/charts/devlake/Chart.yaml)
app_version_text=$(yq .appVersion ${GITHUB_WORKSPACE}/charts/devlake/Chart.yaml)
if [[ "v$chart_version_text" == "$app_version_text" ]] ; then
echo version check for app and chart pass, chart:$chart_version_text and app:$app_version_text
echo version check for app and chart pass, chart:$chart_version_text and app:$app_version_text :green_heart: >> $GITHUB_STEP_SUMMARY
else
echo chart version: $chart_version_text not align with app version: $app_version_text
echo chart version: $chart_version_text not align with app version: $app_version_text :broken_heart: >> $GITHUB_STEP_SUMMARY
exit 1
fi
check_chart_version_should_be_increased:
name: char version should be increased
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.base_ref }}
- name: get base chart version
id: get-base-chart-version
run:
echo "CHART_VERSION=$(yq .version ${GITHUB_WORKSPACE}/charts/devlake/Chart.yaml)" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: chart version should be promoted
run: |
set -e
base_chart_version_text="${{ steps.get-base-chart-version.outputs.CHART_VERSION }}"
chart_version_text=$(yq .version ${GITHUB_WORKSPACE}/charts/devlake/Chart.yaml)
pip3 install semver
if python3 -c "from semver import VersionInfo as vi ; vi.parse('${chart_version_text}')" ; then
echo "version ${chart_version_text} is a valid version string" :green_heart: >> $GITHUB_STEP_SUMMARY
else
echo "version ${chart_version_text} is not a valid version string" :broken_heart: >> $GITHUB_STEP_SUMMARY
exit 1
fi
if python3 -c "from semver import VersionInfo as vi ; assert vi.parse('${chart_version_text}') > vi.parse('${base_chart_version_text}')" ; then
echo "version ${chart_version_text} > ${base_chart_version_text}" :green_heart: >> $GITHUB_STEP_SUMMARY
else
echo "version ${chart_version_text} <= ${base_chart_version_text}" :broken_heart: >> $GITHUB_STEP_SUMMARY
exit 1
fi
check_image_version_matches_app_version:
name: image vesion matches app version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install yq
run: echo yq should already in github ubuntu-latest
- name: chart version align with image version
run: |
set -e
app_version_text=$(yq .appVersion ${GITHUB_WORKSPACE}/charts/devlake/Chart.yaml)
image_version_text=$(yq .imageTag ${GITHUB_WORKSPACE}/charts/devlake/values.yaml)
if [[ $app_version_text != $image_version_text ]] ; then
echo chart version $app_version_text is not equal to image tag $image_version_text :broken_heart: >> $GITHUB_STEP_SUMMARY
exit 1
else
echo all images version are equal to app version :green_heart: >> $GITHUB_STEP_SUMMARY
fi
61 changes: 0 additions & 61 deletions .github/workflows/lint-chart-versions.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
paths:
- charts/**
- '!**.md'
jobs:
release:
runs-on: ubuntu-latest
Expand Down
Loading

0 comments on commit 31a76a4

Please sign in to comment.