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

Add contrl plane to main #1777

Merged
merged 9 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
125 changes: 125 additions & 0 deletions .github/workflows/admin-domain-service-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: Release Admin-domain-service.
on:
workflow_call:
inputs:
aks_deployment:
required: true
type: boolean
description: "Deploy to AKS"
secrets:
WSO2_BOT_TOKEN:
required: true
WSO2_BOT_USER:
required: true
WSO2_BOT_EMAIL:
required: true
DOCKER_ORGANIZATION:
required: true
AZURE_ACR_NAME:
required: true
AZURE_CREDENTIALS:
required: true
workflow_dispatch:
inputs:
release_version:
required: true
type: string
description: "Release Version"
next_version:
type: string
description: "Next Development Version"
pull_request_target:
types:
- closed
- opened
- synchronize
paths:
- '**/admin/admin-domain-service/**'
- '**/common-bal-libs/**'
branches:
- 'main'
concurrency:
group: admin-domain-service-${{ github.event.number || github.run_id }}
cancel-in-progress: true
env:
GH_TOKEN: ${{ secrets.WSO2_BOT_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Cache Ballerina.
uses: actions/cache@v3
id: cache
with:
path: "ballerina-dist/*.deb"
key: "ballerina-2201.5.0"
- name: Download Ballerina distribution.
shell: sh
run: |
mkdir -p ballerina-dist
wget 'https://dist.ballerina.io/downloads/2201.5.0/ballerina-2201.5.0-swan-lake-linux-x64.deb' -P ballerina-dist
if: steps.cache.outputs.cache-hit != 'true'
- name: Install Ballerina distribution.
shell: sh
run: "sudo dpkg -i ballerina-dist/ballerina-2201.5.0-swan-lake-linux-x64.deb"
- name: Verify Ballerina Version
shell: sh
run: "bal -v"
- name: Checkout apk-repo
uses: actions/checkout@v3
with:
fetch-depth: "0"
path: apk-repo
token: ${{ secrets.WSO2_BOT_TOKEN }}
- name: Set release username and email
shell: sh
run: |
git config --global user.name ${{ secrets.WSO2_BOT_USER }}
git config --global user.email ${{ secrets.WSO2_BOT_EMAIL }}
- name: checkout pull request and merge.
shell: sh
if: github.event_name == 'pull_request_target' && github.event.action == 'opened' || github.event.action == 'synchronize'
run: |
cd apk-repo
gh pr checkout ${{ github.event.number }} -b pr-${{ github.event.number }}
git checkout pr-${{ github.event.number }}
git merge origin/main

- name: build common bal libs
run: |
cd apk-repo/common-bal-libs
./gradlew build
- name: Run Gradle build
if: github.event_name == 'workflow_dispatch' && github.event.inputs.release_version != '' && github.event.inputs.next_version != ''
run: |
cd apk-repo/admin/admin-domain-service
./gradlew release -Prelease.useAutomaticVersion=true -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -Prelease.releaseVersion=${{ github.event.inputs.release_version }} -Prelease.newVersion=${{ github.event.inputs.next_version }} -PmultiArch=true
./gradlew :ballerina:commit_toml_files
git push
- name: Run Gradle Build
run: |
cd apk-repo/admin/admin-domain-service
./gradlew build
- name: Run Gradle Build
if: github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request.merged == true
run: |
cd apk-repo/admin/admin-domain-service
./gradlew docker:docker_push -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -Pimage_version=latest -PmultiArch=true
./gradlew docker:docker_push -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -Pimage_version=${{ github.sha }} -PmultiArch=true
- name: Login to azure.
if: ${{inputs.aks_deployment}}
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Push Docker images to aks.
if: ${{inputs.aks_deployment}}
run: |
az acr login -n ${{ secrets.AZURE_ACR_NAME }}
cd apk-repo/admin/admin-domain-service
./gradlew docker:docker_push -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pimage_version=${{ github.sha }} -PmultiArch=true
- name: run codecov
uses: codecov/codecov-action@v3
with:
verbose: true # optional (default = false)
directory: apk-repo/admin/admin-domain-service
flags: admin-domain-service
126 changes: 126 additions & 0 deletions .github/workflows/backoffice-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: Release Backoffice-domain-service.
on:
workflow_call:
inputs:
aks_deployment:
required: true
type: boolean
description: "Deploy to AKS"
secrets:
WSO2_BOT_TOKEN:
required: true
WSO2_BOT_USER:
required: true
WSO2_BOT_EMAIL:
required: true
DOCKER_ORGANIZATION:
required: true
AZURE_ACR_NAME:
required: true
AZURE_CREDENTIALS:
required: true

workflow_dispatch:
inputs:
release_version:
required: true
type: string
description: "Release Version"
next_version:
type: string
description: "Next Development Version"
pull_request_target:
types:
- closed
- opened
- synchronize
paths:
- '**/backoffice/backoffice-domain-service/**'
- '**/common-bal-libs/**'
branches:
- 'main'
concurrency:
group: backoffice-${{ github.event.number || github.run_id }}
cancel-in-progress: true
env:
GH_TOKEN: ${{ secrets.WSO2_BOT_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Cache Ballerina.
uses: actions/cache@v3
id: cache
with:
path: "ballerina-dist/*.deb"
key: "ballerina-2201.5.0"
- name: Download Ballerina distribution.
shell: sh
run: |
mkdir -p ballerina-dist
wget 'https://dist.ballerina.io/downloads/2201.5.0/ballerina-2201.5.0-swan-lake-linux-x64.deb' -P ballerina-dist
if: steps.cache.outputs.cache-hit != 'true'
- name: Install Ballerina distribution.
shell: sh
run: "sudo dpkg -i ballerina-dist/ballerina-2201.5.0-swan-lake-linux-x64.deb"
- name: Verify Ballerina Version
shell: sh
run: "bal -v"
- name: Checkout apk-repo
uses: actions/checkout@v3
with:
fetch-depth: "0"
path: apk-repo
token: ${{ secrets.WSO2_BOT_TOKEN }}
- name: Set release username and email
shell: sh
run: |
git config --global user.name ${{ secrets.WSO2_BOT_USER }}
git config --global user.email ${{ secrets.WSO2_BOT_EMAIL }}
- name: checkout pull request and merge.
shell: sh
if: github.event_name == 'pull_request_target' && github.event.action == 'opened' || github.event.action == 'synchronize'
run: |
cd apk-repo
gh pr checkout ${{ github.event.number }} -b pr-${{ github.event.number }}
git checkout pr-${{ github.event.number }}
git merge origin/main
- name: build common bal libs
run: |
cd apk-repo/common-bal-libs
./gradlew build
- name: Run Gradle build
if: github.event_name == 'workflow_dispatch' && github.event.inputs.release_version != '' && github.event.inputs.next_version != ''
run: |
cd apk-repo/backoffice/backoffice-domain-service
./gradlew release -Prelease.useAutomaticVersion=true -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -Prelease.releaseVersion=${{ github.event.inputs.release_version }} -Prelease.newVersion=${{ github.event.inputs.next_version }} -PmultiArch=true
./gradlew :ballerina:commit_toml_files
git push
- name: Run Gradle Build
run: |
cd apk-repo/backoffice/backoffice-domain-service
./gradlew build
- name: Run Gradle Build
if: github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request.merged == true
run: |
cd apk-repo/backoffice/backoffice-domain-service
./gradlew docker:docker_push -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -Pimage_version=latest -PmultiArch=true
./gradlew docker:docker_push -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -Pimage_version=${{ github.sha }} -PmultiArch=true
- name: Login to azure.
if: ${{inputs.aks_deployment}}
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Push Docker images to aks.
if: ${{inputs.aks_deployment}}
run: |
az acr login -n ${{ secrets.AZURE_ACR_NAME }}
cd apk-repo/backoffice/backoffice-domain-service
./gradlew docker:docker_push -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pimage_version=${{ github.sha }} -PmultiArch=true
- name: run codecov
uses: codecov/codecov-action@v3
with:
verbose: true # optional (default = false)
directory: apk-repo/backoffice/backoffice-domain-service
flags: backoffice-domain-service

127 changes: 127 additions & 0 deletions .github/workflows/devportal-domain-service-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: Release Devportal-domain-service.
on:
workflow_call:
inputs:
aks_deployment:
required: true
type: boolean
description: "Deploy to AKS"
secrets:
WSO2_BOT_TOKEN:
required: true
WSO2_BOT_USER:
required: true
WSO2_BOT_EMAIL:
required: true
DOCKER_ORGANIZATION:
required: true
AZURE_ACR_NAME:
required: true
AZURE_CREDENTIALS:
required: true

workflow_dispatch:
inputs:
release_version:
required: true
type: string
description: "Release Version"
next_version:
type: string
description: "Next Development Version"
pull_request_target:
types:
- closed
- opened
- synchronize
paths:
- '**/devportal/devportal-domain-service/**'
- '**/common-bal-libs/**'
branches:
- 'main'
env:
GH_TOKEN: ${{ secrets.WSO2_BOT_TOKEN }}
concurrency:
group: devportal-domain-service-${{ github.event.number || github.run_id }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Cache Ballerina.
uses: actions/cache@v3
id: cache
with:
path: "ballerina-dist/*.deb"
key: "ballerina-2201.5.0"
- name: Download Ballerina distribution.
shell: sh
run: |
mkdir -p ballerina-dist
wget 'https://dist.ballerina.io/downloads/2201.5.0/ballerina-2201.5.0-swan-lake-linux-x64.deb' -P ballerina-dist
if: steps.cache.outputs.cache-hit != 'true'

- name: Install Ballerina distribution.
shell: sh
run: "sudo dpkg -i ballerina-dist/ballerina-2201.5.0-swan-lake-linux-x64.deb"
- name: Verify Ballerina Version
shell: sh
run: "bal -v"
- name: Checkout apk-repo
uses: actions/checkout@v3
with:
fetch-depth: "0"
path: apk-repo
token: ${{ secrets.WSO2_BOT_TOKEN }}
- name: Set release username and email
shell: sh
run: |
git config --global user.name ${{ secrets.WSO2_BOT_USER }}
git config --global user.email ${{ secrets.WSO2_BOT_EMAIL }}
- name: checkout pull request and merge.
shell: sh
if: github.event_name == 'pull_request_target' && github.event.action == 'opened' || github.event.action == 'synchronize'
run: |
cd apk-repo
gh pr checkout ${{ github.event.number }} -b pr-${{ github.event.number }}
git checkout pr-${{ github.event.number }}
git merge origin/main
- name: build common bal libs
run: |
cd apk-repo/common-bal-libs
./gradlew build
- name: Run Gradle build
if: github.event_name == 'workflow_dispatch' && github.event.inputs.release_version != '' && github.event.inputs.next_version != ''
run: |
cd apk-repo/devportal/devportal-domain-service
./gradlew release -Prelease.useAutomaticVersion=true -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -Prelease.releaseVersion=${{ github.event.inputs.release_version }} -Prelease.newVersion=${{ github.event.inputs.next_version }} -PmultiArch=true
./gradlew :ballerina:commit_toml_files
git push
- name: Run Gradle Build
run: |
cd apk-repo/devportal/devportal-domain-service
./gradlew build
- name: Run Gradle Build
if: github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request.merged == true
run: |
cd apk-repo/devportal/devportal-domain-service
./gradlew docker:docker_push -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -Pimage_version=latest -PmultiArch=true
./gradlew docker:docker_push -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pdocker_username=${{ secrets.DOCKER_USERNAME }} -Pdocker_password=${{ secrets.DOCKER_PASSWORD }} -Pimage_version=${{ github.sha }} -PmultiArch=true
- name: Login to azure.
if: ${{inputs.aks_deployment}}
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Push Docker images to aks.
if: ${{inputs.aks_deployment}}
run: |
az acr login -n ${{ secrets.AZURE_ACR_NAME }}
cd apk-repo/devportal/devportal-domain-service
./gradlew docker:docker_push -Pdocker_organization=${{ secrets.DOCKER_ORGANIZATION }} -Pimage_version=${{ github.sha }} -PmultiArch=true
- name: run codecov
uses: codecov/codecov-action@v3
with:
verbose: true # optional (default = false)
directory: apk-repo/devportal/devportal-domain-service
flags: devportal-domain-service

Loading