Skip to content

Commit

Permalink
Merge branch 'main' into admin-ui-issue-94
Browse files Browse the repository at this point in the history
  • Loading branch information
mjatin-dev committed Mar 23, 2022
2 parents 5da263e + fe01bcb commit 6c586fb
Show file tree
Hide file tree
Showing 175 changed files with 3,299 additions and 4,353 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
31 changes: 22 additions & 9 deletions .github/workflows/central_code_quality_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- 'docker-**/version.txt'
- '**.md'

# TODO: Optimize so that workflow is only triggered for `opened` and `synchronize` actions
pull_request:
branches:
- main
Expand Down Expand Up @@ -39,40 +40,52 @@ jobs:
steps:
- name: check out code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of sonarqube analysis

- name: find changed directories
run: |
if [ $GITHUB_BASE_REF ]; then
# Pull Request
echo "Triggerring event: pull request"
echo Pull request base ref: $GITHUB_BASE_REF
git fetch origin $GITHUB_BASE_REF --depth=1
echo "CHANGED_DIR=$( git diff --name-only ${{ github.event.before }} ${{ github.event.pull_request.head.sha }} | cut -d/ -f1 | sort -u | sed -z 's/\n/,/g;s/^/[/;s/,$/]/;s/$/\n/')" >> ${GITHUB_ENV}
if [ ${{ github.event.action }} = "opened" ]; then
echo "Triggerring action: opened"
echo "CHANGED_DIR=$( git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | cut -d/ -f1 | sort -u | sed -z 's/\n/,/g;s/^/[/;s/,$/]/;s/$/\n/')" >> ${GITHUB_ENV}
fi
if [ ${{ github.event.action }} = "synchronize" ]; then
echo "Triggerring action: synchronize"
echo "CHANGED_DIR=$( git diff --name-only ${{ github.event.before }} ${{ github.event.pull_request.head.sha }} | cut -d/ -f1 | sort -u | sed -z 's/\n/,/g;s/^/[/;s/,$/]/;s/$/\n/')" >>${GITHUB_ENV}
fi
else
# Push
echo "Triggerring event: push"
git fetch origin ${{ github.event.before }} --depth=1
echo "CHANGED_DIR=$( git diff --name-only ${{ github.event.before }} $GITHUB_SHA | cut -d/ -f1 | sort -u | sed -z 's/\n/,/g;s/^/[/;s/,$/]/;s/$/\n/')" >> ${GITHUB_ENV}
fi
- name: check env
run: |
echo ${{ env.CHANGED_DIR }}
echo ${{ matrix.module }}
echo ${{ github.event.before }}
echo ${{ github.event.pull_request.head.sha }}
echo $GITHUB_SHA
echo changed dir list: ${{ env.CHANGED_DIR }}
echo Matrix module: ${{ matrix.module }}
echo GH event action: ${{ github.event.action }}
echo PR base sha: ${{ github.event.pull_request.base.sha }}
echo PR head sha: ${{ github.event.pull_request.head.sha }}
echo event before: ${{ github.event.before }}
echo GH sha: $GITHUB_SHA
- name: Set up JDK 11
if: contains(env.CHANGED_DIR, matrix.module) && contains(env.JVM_PROJECTS, matrix.module)
uses: actions/setup-java@v2.5.0
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'

- name: Cache SonarCloud packages for JVM based project
if: contains(env.CHANGED_DIR, matrix.module) && contains(env.JVM_PROJECTS, matrix.module)
uses: actions/cache@v2.1.7
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
language: [ 'javascript', 'python', 'java' ]
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/commit-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
# We need to fetch with a depth of 2 for pull_request so we can do HEAD^2
fetch-depth: 2

- uses: actions/setup-node@v2.4.1
- uses: actions/setup-node@v3
with:
node-version: 14
- run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docker_build_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
docker-images: ["casa", "admin-ui"]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
# UPDATE BUILD DATES INSIDE THE DOCKERFILE BEFORE BUILDING THE DEV IMAGES TRIGGERED BY JENKINS
- name: Setup Python 3.7
if: github.event_name == 'workflow_dispatch'
uses: actions/setup-python@v2.3.1
uses: actions/setup-python@v3
with:
python-version: 3.7

Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:

- name: Cache Docker layers
if: steps.build_docker_image.outputs.build && steps.prep.outputs.build
uses: actions/cache@v2.1.7
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/post-to-rancher-partner-charts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: rancher-partner-charts
# This posts the latest chart to rancher/partner-charts
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
publish:
name: Publish on rancher partner charts
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.8

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.MOAUTO_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.MOAUTO_GPG_PRIVATE_KEY_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true

- name: Get latest tag
id: previoustag
run: |
echo "::set-output name=tag::$(curl https://api.github.com/repos/${{ github.repository }}/releases -s | grep "tag_name" | cut -d '"' -f 4 | grep -o '^\v.*' | head -n 1)"
echo "::set-output name=version::$(curl https://api.github.com/repos/${{ github.repository }}/releases -s | grep "tag_name" | cut -d '"' -f 4 | grep -o '^\v.*' | head -n 1 | cut -d 'v' -f 2)"
- name: Configure Git
run: |
git clone https://mo-auto:${{ secrets.MOWORKFLOWTOKEN }}@github.com/mo-auto/partner-charts.git
git config --global user.name "mo-auto"
git config --global user.email "54212639+mo-auto@users.noreply.github.com"
git config --global user.signingkey "${{ steps.import_gpg.outputs.keyid }}"
cd partner-charts
git remote add upstream https://github.com/rancher/partner-charts.git
git fetch upstream
# ensures current branch is main-source
git checkout main-source
# pulls all new commits made to upstream/main-source
git pull upstream main-source
# this will delete all local changes to main-source
git reset --hard upstream/main-source
# take care, this will delete all changes on the forked main-source
git push origin main-source --force
cp ../automation/rancher-partner-charts/package.yaml ./packages/gluu/package.yaml
export PACKAGE=gluu
make prepare
cp ../automation/rancher-partner-charts/app-readme.md ./packages/gluu/charts/app-readme.md
cp ../automation/rancher-partner-charts/questions.yaml ./packages/gluu/charts/questions.yaml
make patch
make clean
git add -A
git commit -S -s -m "feat(gluu): patch helm package"
make charts
git add -A
git commit -S -s -m "feat(gluu): chart helm package"
git push origin
MESSAGE="feat(gluu): update Gluu helm partner chart"
BODY=$(<../automation/rancher-partner-charts/pull_request_body.md)
echo "${{ secrets.MOWORKFLOWTOKEN }}" > token.txt
gh auth login --with-token < token.txt
PR=$(gh pr create --base "main-source" --body "${BODY}" --title "${MESSAGE}")
#TODO: Add docker test before opening a PR in rancher-partner charts.
38 changes: 34 additions & 4 deletions .github/workflows/releaseplease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
simple: [ "docker-casa", "docker-admin-ui", "casa"]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
python-projects: ["flex-cn-setup", "flex-linux-setup"]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
node-projects: ["admin-ui"]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand All @@ -113,4 +113,34 @@ jobs:
token: ${{ secrets.MOWORKFLOWTOKEN }}
release-type: node
package-name: ${{ matrix.node-projects }}
monorepo-tags: true
monorepo-tags: true
mega-release-pr:
needs: release-node-pr
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.MOAUTO_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.MOAUTO_GPG_PRIVATE_KEY_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true

- name: Configure Git
run: |
git config user.name "mo-auto"
git config user.email "54212639+mo-auto@users.noreply.github.com"
git config --global user.signingkey "${{ steps.import_gpg.outputs.keyid }}"
- uses: google-github-actions/release-please-action@v3.1
id: release-please
with:
token: ${{ secrets.MOWORKFLOWTOKEN }}
release-type: simple
6 changes: 3 additions & 3 deletions .github/workflows/testcases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
matrix:
python-version: [3.7]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -35,7 +35,7 @@ jobs:
run: |
tox
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v2.1.0
with:
file: ./coverage.xml
files: ./coverage1.xml,./coverage2.xml
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/update_janssen_helm_chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
HELM_DOCS_VERSION: "1.7.0"
steps:
- name: Checkout code
uses: actions/checkout@master
uses: actions/checkout@v3

- name: Set up Python 3.7
uses: actions/setup-python@v2.3.1
uses: actions/setup-python@v3
with:
python-version: 3.7

Expand Down Expand Up @@ -64,9 +64,9 @@ jobs:
git commit -S -s -m "chore(charts): update helm package"
git push --set-upstream origin cn-autoupdate-helm-charts
MESSAGE="chore(charts): update helm package"
ASSIGNEES="@moabu"
ASSIGNEES="moabu"
BODY="This is an automated message propagated by a change in the parent Gluu chart. It will be automerged. Don't think about touching me before reaching out to @moabu."
LABELS="ci,comp-charts-jans"
LABELS="area-CI,comp-charts-jans"
echo "${{ secrets.MOAUTO4_WORKFLOW_TOKEN }}" > token.txt
gh auth login --with-token < token.txt
PR=$(gh pr create --assignee "${ASSIGNEES}" --base "main" --body "${BODY}" --label "${LABELS}" --reviewer "${ASSIGNEES}" --title "${MESSAGE}")
Expand Down
Loading

0 comments on commit 6c586fb

Please sign in to comment.