Skip to content

Commit

Permalink
[PILOT-5250] Added CODEOWNERS and modified arranger admin ui and serv…
Browse files Browse the repository at this point in the history
…er filter services
  • Loading branch information
vbezbakh-indocsystems committed Jun 5, 2024
1 parent cb54645 commit e4bc6eb
Show file tree
Hide file tree
Showing 6 changed files with 220 additions and 36 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Code owners for the .github directory
/.github/ @PilotDataPlatform/indoc-devops
4 changes: 2 additions & 2 deletions .github/workflows/pilot-pipeline-admin-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI pipeline admin server
on:
push:
branches:
- PILOT-5250
- patched-version
paths:
- 'modules/admin/**'
pull_request:
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
build-and-push-docker-image:
needs: [extract-branch-name, get-version]
if: ${{ needs.extract-branch-name.outputs.branch == 'PILOT-5250'}}
if: ${{ needs.extract-branch-name.outputs.branch == 'patched-version'}}
name: Build admin server Docker image and push to repositories
runs-on: ubuntu-20.04
steps:
Expand Down
122 changes: 106 additions & 16 deletions .github/workflows/pilot-pipeline-admin-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI pipeline admin ui
on:
push:
branches:
- patched-version
- PILOT-5250
paths:
- 'modules/admin-ui/**'
pull_request:
Expand All @@ -14,18 +14,108 @@ on:

jobs:

build_and_publish:
uses: PilotDataPlatform/shared-ci-tools/.github/workflows/reusable_build_and_publish_pilot.yml@main
with:
matrix_config: '["arranger-admin-ui"]'
docker_registry: 'pilotdataplatform.azurecr.io'
service_name: 'arranger-admin-ui'
secrets: inherit

trigger_deployment:
needs: [build_and_publish]
uses: PilotDataPlatform/shared-ci-tools/.github/workflows/reusable_trigger_deployment_pilot.yml@main
with:
service_name: 'arranger-admin-ui'
app_version: "${{needs.build_and_publish.outputs.app_version}}"
secrets: inherit
extract-branch-name:
runs-on: ubuntu-20.04
outputs:
branch: ${{steps.extract_branch.outputs.branch}}
steps:
- name: Extract Branch Name
id: extract_branch
shell: bash
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
get-version:
runs-on: ubuntu-20.04
outputs:
app_version: ${{steps.get-version.outputs.app_version}}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get Version
id: get-version
shell: bash
run: |
BRANCH=${GITHUB_REF#refs/heads/}
BASE_VERSION=`sed -n 's/^ *"version":.*"\([^"]*\)".*/\1/p' package.json`
echo "app_version=$BASE_VERSION" >> $GITHUB_OUTPUT
build-and-push-docker-image:
needs: [extract-branch-name, get-version]
if: ${{ needs.extract-branch-name.outputs.branch == 'patched-version'}}
name: Build admin ui Docker image and push to repositories
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to Github Packages
uses: docker/login-action@v2
with:
registry: pilotdataplatform.azurecr.io
username: ${{ secrets.ACR_CLIENT }}
password: ${{ secrets.ACR_SECRET }}
- name: Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
pilotdataplatform.azurecr.io/arranger/arranger-admin-ui
# generate Docker tags based on the following events/attributes
sep-tags: ','
tags: |
type=raw,prefix=arranger-admin-ui-,suffix=,value=${{needs.get-version.outputs.app_version}}
# - name: Image digest
# run: echo ${{ steps.meta.outputs.tags }}
- name: Image digest
run: echo ${{ steps.meta.outputs.tags }}
- name: Check if Docker image tags exist
shell: bash
run: |
image_tag=$(echo "${{ steps.meta.outputs.tags }}")
if docker manifest inspect $image_tag >/dev/null; then
echo "Docker image with tag already exists. Please update the version."
exit 1
else
echo "Image tags do not exist, proceeding..."
fi
- name: Build image and push to GitHub Container Registry
uses: docker/build-push-action@v4
with:
# relative path to the place where source code with Dockerfile is located
context: .
# Note: tags has to be all lower-case
tags: ${{ steps.meta.outputs.tags }}
# build on feature branches, push only on main branch
push: ${{ github.event_name != 'pull_request' }}
# Sets the target stage to build
target: arranger-admin-ui

trigger_pilot_dev_deployment:
needs: [build-and-push-docker-image, get-version]
runs-on: ubuntu-20.04
if: github.event_name != 'pull_request'
steps:
- name: Checkout helmfile repo
uses: actions/checkout@v2
with:
repository: PilotDataPlatform/pilot-helmfile
ref: 'main' #always checkout main branch
ssh-key: ${{ secrets.PILOT_HELMFILE_REPO_DEPLOYMENT_KEY }}

- name: Update service version
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
BASE_FILE='./helmfile.d/values/shared/lab/shared-services-values.yaml'
pattern="arranger_admin_ui"
current_version=$(grep -m 1 $pattern $BASE_FILE)
echo "current version is $current_version"
sed -i "/$pattern/,/charts/ s/$current_version/ $pattern: ${{needs.get-version.outputs.app_version}}/" $BASE_FILE
git add $BASE_FILE
git commit -m "Deploy arranger-admin-server ${{needs.get-version.outputs.app_version}} [app_name:arranger-admin-server, app_version:${{needs.get-version.outputs.app_version}}]"
git push origin main
126 changes: 110 additions & 16 deletions .github/workflows/pilot-pipeline-server-filter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI pipeline server filter
on:
push:
branches:
- patched-version
- PILOT-5250
paths:
- 'modules/server-filter/**'
pull_request:
Expand All @@ -14,18 +14,112 @@ on:

jobs:

build_and_publish:
uses: PilotDataPlatform/shared-ci-tools/.github/workflows/reusable_build_and_publish_pilot.yml@main
with:
matrix_config: '["arranger-server-filter"]'
docker_registry: 'pilotdataplatform.azurecr.io'
service_name: 'arranger-server'
secrets: inherit

trigger_deployment:
needs: [build_and_publish]
uses: PilotDataPlatform/shared-ci-tools/.github/workflows/reusable_trigger_deployment_pilot.yml@main
with:
service_name: 'arranger-server-filter'
app_version: "${{needs.build_and_publish.outputs.app_version}}"
secrets: inherit
extract-branch-name:
runs-on: ubuntu-20.04
outputs:
branch: ${{steps.extract_branch.outputs.branch}}
steps:
- name: Extract Branch Name
id: extract_branch
shell: bash
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
get-version:
runs-on: ubuntu-20.04
outputs:
app_version: ${{steps.get-version.outputs.app_version}}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get Version
id: get-version
shell: bash
run: |
BRANCH=${GITHUB_REF#refs/heads/}
BASE_VERSION=`sed -n 's/^ *"version":.*"\([^"]*\)".*/\1/p' package.json`
if [ $BRANCH == "patched-version" ]; then
echo "app_version=$BASE_VERSION-`git rev-parse --short HEAD`" >> $GITHUB_OUTPUT
else
echo "app_version=$BASE_VERSION" >> $GITHUB_OUTPUT
fi
build-and-push-docker-image:
needs: [extract-branch-name, get-version]
if: ${{ needs.extract-branch-name.outputs.branch == 'patched-version'}}
name: Build server filter Docker image and push to repositories
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to Github Packages
uses: docker/login-action@v2
with:
registry: pilotdataplatform.azurecr.io
username: ${{ secrets.ACR_CLIENT }}
password: ${{ secrets.ACR_SECRET }}
- name: Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
pilotdataplatform.azurecr.io/arranger/arranger-server
# generate Docker tags based on the following events/attributes
sep-tags: ','
tags: |
type=raw,prefix=arranger-server-filter-,suffix=,value=${{needs.get-version.outputs.app_version}}
# - name: Image digest
# run: echo ${{ steps.meta.outputs.tags }}
- name: Image digest
run: echo ${{ steps.meta.outputs.tags }}
- name: Check if Docker image tags exist
shell: bash
run: |
image_tag=$(echo "${{ steps.meta.outputs.tags }}")
if docker manifest inspect $image_tag >/dev/null; then
echo "Docker image with tag already exists. Please update the version."
exit 1
else
echo "Image tags do not exist, proceeding..."
fi
- name: Build image and push to GitHub Container Registry
uses: docker/build-push-action@v4
with:
# relative path to the place where source code with Dockerfile is located
context: .
# Note: tags has to be all lower-case
tags: ${{ steps.meta.outputs.tags }}
# build on feature branches, push only on main branch
push: ${{ github.event_name != 'pull_request' }}
# Sets the target stage to build
target: arranger-server

trigger_pilot_dev_deployment:
needs: [build-and-push-docker-image, get-version]
runs-on: ubuntu-20.04
if: github.event_name != 'pull_request'
steps:
- name: Checkout helmfile repo
uses: actions/checkout@v2
with:
repository: PilotDataPlatform/pilot-helmfile
ref: 'main' #always checkout main branch
ssh-key: ${{ secrets.PILOT_HELMFILE_REPO_DEPLOYMENT_KEY }}

- name: Update service version
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
BASE_FILE='./helmfile.d/values/development/dev/pilot-versions-values.yaml'
pattern="arranger_server_filter_service"
current_version=$(grep -m 1 $pattern $BASE_FILE)
echo "current version is $current_version"
sed -i "/$pattern/,/service/ s/$current_version/ $pattern: ${{needs.get-version.outputs.app_version}}/" $BASE_FILE
git add $BASE_FILE
git commit -m "Deploy arranger-admin-server ${{needs.get-version.outputs.app_version}} [app_name:arranger-admin-server, app_version:${{needs.get-version.outputs.app_version}}]"
git push origin main
1 change: 0 additions & 1 deletion modules/admin-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2470,4 +2470,3 @@ In the future, we might start automatically compiling incompatible third-party m
If you have ideas for more “How To” recipes that should be on this page, [let us know](https://github.com/facebookincubator/create-react-app/issues) or [contribute some!](https://github.com/facebookincubator/create-react-app/edit/master/packages/react-scripts/template/README.md)
1 change: 0 additions & 1 deletion modules/server-filter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ NodeJs version: `v14.21.0`; NPM version: `6.14.17`. Recommended to use node vers
3. Export file logic exists under `/export`.



0 comments on commit e4bc6eb

Please sign in to comment.