Skip to content

Commit e4bc6eb

Browse files
[PILOT-5250] Added CODEOWNERS and modified arranger admin ui and server filter services
1 parent cb54645 commit e4bc6eb

File tree

6 files changed

+220
-36
lines changed

6 files changed

+220
-36
lines changed

.github/CODEOWNERS

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Code owners for the .github directory
2+
/.github/ @PilotDataPlatform/indoc-devops

.github/workflows/pilot-pipeline-admin-server.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI pipeline admin server
33
on:
44
push:
55
branches:
6-
- PILOT-5250
6+
- patched-version
77
paths:
88
- 'modules/admin/**'
99
pull_request:
@@ -40,7 +40,7 @@ jobs:
4040
4141
build-and-push-docker-image:
4242
needs: [extract-branch-name, get-version]
43-
if: ${{ needs.extract-branch-name.outputs.branch == 'PILOT-5250'}}
43+
if: ${{ needs.extract-branch-name.outputs.branch == 'patched-version'}}
4444
name: Build admin server Docker image and push to repositories
4545
runs-on: ubuntu-20.04
4646
steps:

.github/workflows/pilot-pipeline-admin-ui.yml

+106-16
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI pipeline admin ui
33
on:
44
push:
55
branches:
6-
- patched-version
6+
- PILOT-5250
77
paths:
88
- 'modules/admin-ui/**'
99
pull_request:
@@ -14,18 +14,108 @@ on:
1414

1515
jobs:
1616

17-
build_and_publish:
18-
uses: PilotDataPlatform/shared-ci-tools/.github/workflows/reusable_build_and_publish_pilot.yml@main
19-
with:
20-
matrix_config: '["arranger-admin-ui"]'
21-
docker_registry: 'pilotdataplatform.azurecr.io'
22-
service_name: 'arranger-admin-ui'
23-
secrets: inherit
24-
25-
trigger_deployment:
26-
needs: [build_and_publish]
27-
uses: PilotDataPlatform/shared-ci-tools/.github/workflows/reusable_trigger_deployment_pilot.yml@main
28-
with:
29-
service_name: 'arranger-admin-ui'
30-
app_version: "${{needs.build_and_publish.outputs.app_version}}"
31-
secrets: inherit
17+
extract-branch-name:
18+
runs-on: ubuntu-20.04
19+
outputs:
20+
branch: ${{steps.extract_branch.outputs.branch}}
21+
steps:
22+
- name: Extract Branch Name
23+
id: extract_branch
24+
shell: bash
25+
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
26+
get-version:
27+
runs-on: ubuntu-20.04
28+
outputs:
29+
app_version: ${{steps.get-version.outputs.app_version}}
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v3
33+
- name: Get Version
34+
id: get-version
35+
shell: bash
36+
run: |
37+
BRANCH=${GITHUB_REF#refs/heads/}
38+
BASE_VERSION=`sed -n 's/^ *"version":.*"\([^"]*\)".*/\1/p' package.json`
39+
echo "app_version=$BASE_VERSION" >> $GITHUB_OUTPUT
40+
41+
build-and-push-docker-image:
42+
needs: [extract-branch-name, get-version]
43+
if: ${{ needs.extract-branch-name.outputs.branch == 'patched-version'}}
44+
name: Build admin ui Docker image and push to repositories
45+
runs-on: ubuntu-20.04
46+
steps:
47+
- name: Checkout code
48+
uses: actions/checkout@v3
49+
- name: Set up Docker Buildx
50+
id: buildx
51+
uses: docker/setup-buildx-action@v2
52+
- name: Login to Github Packages
53+
uses: docker/login-action@v2
54+
with:
55+
registry: pilotdataplatform.azurecr.io
56+
username: ${{ secrets.ACR_CLIENT }}
57+
password: ${{ secrets.ACR_SECRET }}
58+
- name: Docker metadata
59+
id: meta
60+
uses: docker/metadata-action@v4
61+
with:
62+
# list of Docker images to use as base name for tags
63+
images: |
64+
pilotdataplatform.azurecr.io/arranger/arranger-admin-ui
65+
# generate Docker tags based on the following events/attributes
66+
sep-tags: ','
67+
tags: |
68+
type=raw,prefix=arranger-admin-ui-,suffix=,value=${{needs.get-version.outputs.app_version}}
69+
# - name: Image digest
70+
# run: echo ${{ steps.meta.outputs.tags }}
71+
- name: Image digest
72+
run: echo ${{ steps.meta.outputs.tags }}
73+
- name: Check if Docker image tags exist
74+
shell: bash
75+
run: |
76+
image_tag=$(echo "${{ steps.meta.outputs.tags }}")
77+
if docker manifest inspect $image_tag >/dev/null; then
78+
echo "Docker image with tag already exists. Please update the version."
79+
exit 1
80+
else
81+
echo "Image tags do not exist, proceeding..."
82+
fi
83+
- name: Build image and push to GitHub Container Registry
84+
uses: docker/build-push-action@v4
85+
with:
86+
# relative path to the place where source code with Dockerfile is located
87+
context: .
88+
# Note: tags has to be all lower-case
89+
tags: ${{ steps.meta.outputs.tags }}
90+
# build on feature branches, push only on main branch
91+
push: ${{ github.event_name != 'pull_request' }}
92+
# Sets the target stage to build
93+
target: arranger-admin-ui
94+
95+
trigger_pilot_dev_deployment:
96+
needs: [build-and-push-docker-image, get-version]
97+
runs-on: ubuntu-20.04
98+
if: github.event_name != 'pull_request'
99+
steps:
100+
- name: Checkout helmfile repo
101+
uses: actions/checkout@v2
102+
with:
103+
repository: PilotDataPlatform/pilot-helmfile
104+
ref: 'main' #always checkout main branch
105+
ssh-key: ${{ secrets.PILOT_HELMFILE_REPO_DEPLOYMENT_KEY }}
106+
107+
- name: Update service version
108+
run: |
109+
git config user.name "GitHub Actions"
110+
git config user.email "[email protected]"
111+
BASE_FILE='./helmfile.d/values/shared/lab/shared-services-values.yaml'
112+
113+
pattern="arranger_admin_ui"
114+
115+
current_version=$(grep -m 1 $pattern $BASE_FILE)
116+
echo "current version is $current_version"
117+
118+
sed -i "/$pattern/,/charts/ s/$current_version/ $pattern: ${{needs.get-version.outputs.app_version}}/" $BASE_FILE
119+
git add $BASE_FILE
120+
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}}]"
121+
git push origin main

.github/workflows/pilot-pipeline-server-filter.yml

+110-16
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI pipeline server filter
33
on:
44
push:
55
branches:
6-
- patched-version
6+
- PILOT-5250
77
paths:
88
- 'modules/server-filter/**'
99
pull_request:
@@ -14,18 +14,112 @@ on:
1414

1515
jobs:
1616

17-
build_and_publish:
18-
uses: PilotDataPlatform/shared-ci-tools/.github/workflows/reusable_build_and_publish_pilot.yml@main
19-
with:
20-
matrix_config: '["arranger-server-filter"]'
21-
docker_registry: 'pilotdataplatform.azurecr.io'
22-
service_name: 'arranger-server'
23-
secrets: inherit
24-
25-
trigger_deployment:
26-
needs: [build_and_publish]
27-
uses: PilotDataPlatform/shared-ci-tools/.github/workflows/reusable_trigger_deployment_pilot.yml@main
28-
with:
29-
service_name: 'arranger-server-filter'
30-
app_version: "${{needs.build_and_publish.outputs.app_version}}"
31-
secrets: inherit
17+
extract-branch-name:
18+
runs-on: ubuntu-20.04
19+
outputs:
20+
branch: ${{steps.extract_branch.outputs.branch}}
21+
steps:
22+
- name: Extract Branch Name
23+
id: extract_branch
24+
shell: bash
25+
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
26+
get-version:
27+
runs-on: ubuntu-20.04
28+
outputs:
29+
app_version: ${{steps.get-version.outputs.app_version}}
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v3
33+
- name: Get Version
34+
id: get-version
35+
shell: bash
36+
run: |
37+
BRANCH=${GITHUB_REF#refs/heads/}
38+
BASE_VERSION=`sed -n 's/^ *"version":.*"\([^"]*\)".*/\1/p' package.json`
39+
if [ $BRANCH == "patched-version" ]; then
40+
echo "app_version=$BASE_VERSION-`git rev-parse --short HEAD`" >> $GITHUB_OUTPUT
41+
else
42+
echo "app_version=$BASE_VERSION" >> $GITHUB_OUTPUT
43+
fi
44+
45+
build-and-push-docker-image:
46+
needs: [extract-branch-name, get-version]
47+
if: ${{ needs.extract-branch-name.outputs.branch == 'patched-version'}}
48+
name: Build server filter Docker image and push to repositories
49+
runs-on: ubuntu-20.04
50+
steps:
51+
- name: Checkout code
52+
uses: actions/checkout@v3
53+
- name: Set up Docker Buildx
54+
id: buildx
55+
uses: docker/setup-buildx-action@v2
56+
- name: Login to Github Packages
57+
uses: docker/login-action@v2
58+
with:
59+
registry: pilotdataplatform.azurecr.io
60+
username: ${{ secrets.ACR_CLIENT }}
61+
password: ${{ secrets.ACR_SECRET }}
62+
- name: Docker metadata
63+
id: meta
64+
uses: docker/metadata-action@v4
65+
with:
66+
# list of Docker images to use as base name for tags
67+
images: |
68+
pilotdataplatform.azurecr.io/arranger/arranger-server
69+
# generate Docker tags based on the following events/attributes
70+
sep-tags: ','
71+
tags: |
72+
type=raw,prefix=arranger-server-filter-,suffix=,value=${{needs.get-version.outputs.app_version}}
73+
# - name: Image digest
74+
# run: echo ${{ steps.meta.outputs.tags }}
75+
- name: Image digest
76+
run: echo ${{ steps.meta.outputs.tags }}
77+
- name: Check if Docker image tags exist
78+
shell: bash
79+
run: |
80+
image_tag=$(echo "${{ steps.meta.outputs.tags }}")
81+
if docker manifest inspect $image_tag >/dev/null; then
82+
echo "Docker image with tag already exists. Please update the version."
83+
exit 1
84+
else
85+
echo "Image tags do not exist, proceeding..."
86+
fi
87+
- name: Build image and push to GitHub Container Registry
88+
uses: docker/build-push-action@v4
89+
with:
90+
# relative path to the place where source code with Dockerfile is located
91+
context: .
92+
# Note: tags has to be all lower-case
93+
tags: ${{ steps.meta.outputs.tags }}
94+
# build on feature branches, push only on main branch
95+
push: ${{ github.event_name != 'pull_request' }}
96+
# Sets the target stage to build
97+
target: arranger-server
98+
99+
trigger_pilot_dev_deployment:
100+
needs: [build-and-push-docker-image, get-version]
101+
runs-on: ubuntu-20.04
102+
if: github.event_name != 'pull_request'
103+
steps:
104+
- name: Checkout helmfile repo
105+
uses: actions/checkout@v2
106+
with:
107+
repository: PilotDataPlatform/pilot-helmfile
108+
ref: 'main' #always checkout main branch
109+
ssh-key: ${{ secrets.PILOT_HELMFILE_REPO_DEPLOYMENT_KEY }}
110+
111+
- name: Update service version
112+
run: |
113+
git config user.name "GitHub Actions"
114+
git config user.email "[email protected]"
115+
BASE_FILE='./helmfile.d/values/development/dev/pilot-versions-values.yaml'
116+
117+
pattern="arranger_server_filter_service"
118+
119+
current_version=$(grep -m 1 $pattern $BASE_FILE)
120+
echo "current version is $current_version"
121+
122+
sed -i "/$pattern/,/service/ s/$current_version/ $pattern: ${{needs.get-version.outputs.app_version}}/" $BASE_FILE
123+
git add $BASE_FILE
124+
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}}]"
125+
git push origin main

modules/admin-ui/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -2470,4 +2470,3 @@ In the future, we might start automatically compiling incompatible third-party m
24702470
24712471
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)
24722472
2473-

modules/server-filter/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,3 @@ NodeJs version: `v14.21.0`; NPM version: `6.14.17`. Recommended to use node vers
2323
3. Export file logic exists under `/export`.
2424

2525

26-

0 commit comments

Comments
 (0)