Skip to content

Commit 9feadbb

Browse files
Merge branch 'psl-raju-dev' of https://github.com/microsoft/content-processing-solution-accelerator into psl-raju-dev
2 parents 6ff86c3 + 0613a74 commit 9feadbb

41 files changed

Lines changed: 1414 additions & 70 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coverage

52 KB
Binary file not shown.

.flake8

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
max-line-length = 88
3+
extend-ignore = E501
4+
exclude = .venv, frontend
5+
ignore = E203, W503, G004, G200

.github/CODEOWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Lines starting with '#' are comments.
2+
# Each line is a file pattern followed by one or more owners.
3+
4+
# These owners will be the default owners for everything in the repo.
5+
* @Avijit-Microsoft @Roopan-Microsoft @Prajwal-Microsoft @Vinay-Microsoft @aniaroramsft

.github/dependabot.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
version: 2
2+
updates:
3+
# GitHub Actions dependencies
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "monthly"
8+
commit-message:
9+
prefix: "build"
10+
target-branch: "dependabotchanges"
11+
open-pull-requests-limit: 100
12+
13+
14+
- package-ecosystem: "pip"
15+
directory: "/src/ContentProcessorAPI"
16+
schedule:
17+
interval: "monthly"
18+
commit-message:
19+
prefix: "build"
20+
target-branch: "dependabotchanges"
21+
open-pull-requests-limit: 100
22+
23+
24+
25+
26+
- package-ecosystem: "npm"
27+
directory: "/src/ContentProcessorWeb"
28+
schedule:
29+
interval: "monthly"
30+
commit-message:
31+
prefix: "build"
32+
target-branch: "dependabotchanges"
33+
open-pull-requests-limit: 100

.github/workflows/build-docker-image.yml

Lines changed: 45 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -35,60 +35,54 @@ jobs:
3535
username: ${{ env.ACR_USERNAME }}
3636
password: ${{ env.ACR_PASSWORD }}
3737

38-
- name: Set Docker image tag with Date
38+
- name: Set Docker image tags
39+
id: tag
3940
run: |
40-
echo "Determining tag for branch: ${{ github.ref }}"
41-
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
42-
echo "TAG=latest-${{ steps.date.outputs.date }}" >> $GITHUB_ENV
43-
elif [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then
44-
echo "TAG=dev-${{ steps.date.outputs.date }}" >> $GITHUB_ENV
45-
elif [[ "${{ github.ref }}" == "refs/heads/demo" ]]; then
46-
echo "TAG=demo-${{ steps.date.outputs.date }}" >> $GITHUB_ENV
47-
elif [[ "${{ github.ref }}" == "refs/heads/hotfix" ]]; then
48-
echo "TAG=hotfix-${{ steps.date.outputs.date }}" >> $GITHUB_ENV
41+
BRANCH="${{ github.ref_name }}"
42+
DATE="${{ steps.date.outputs.date }}"
43+
GITHUB_RUN_NUMBER="${{ github.run_number }}"
44+
if [[ "$BRANCH" == "main" ]]; then
45+
BASE_TAG="latest"
46+
elif [[ "$BRANCH" == "dev" ]]; then
47+
BASE_TAG="dev"
48+
elif [[ "$BRANCH" == "demo" ]]; then
49+
BASE_TAG="demo"
50+
elif [[ "$BRANCH" == "hotfix" ]]; then
51+
BASE_TAG="hotfix"
4952
else
50-
echo "TAG=pullrequest-ignore-${{ steps.date.outputs.date }}" >> $GITHUB_ENV
53+
BASE_TAG="pullrequest-ignore"
5154
fi
52-
echo "Tag set to: $TAG"
55+
DATE_TAG="${BASE_TAG}_${DATE}_${GITHUB_RUN_NUMBER}"
56+
echo "BASE_TAG=${BASE_TAG}" >> $GITHUB_ENV
57+
echo "DATE_TAG=${DATE_TAG}" >> $GITHUB_ENV
58+
echo "Base tag: $BASE_TAG, Date tag: $DATE_TAG"
5359
54-
- name: Build and push ContentProcessor Docker image
55-
run: |
56-
cd src/ContentProcessor
57-
IMAGE_NAME="$ACR_LOGIN_SERVER/contentprocessor:${TAG}"
58-
echo "Using image name: ${IMAGE_NAME}"
59-
# Use the Dockerfile from the root folder of ContentProcessor
60-
docker build -t ${IMAGE_NAME} -f Dockerfile .
61-
if [[ "${TAG}" == latest-* || "${TAG}" == dev-* || "${TAG}" == demo-* || "${TAG}" == hotfix-* ]]; then
62-
docker push ${IMAGE_NAME}
63-
echo "ContentProcessor image built and pushed successfully."
64-
else
65-
echo "Skipping Docker push for ContentProcessor with tag: ${TAG}"
66-
fi
60+
- name: Build and Push ContentProcessor Docker image
61+
uses: docker/build-push-action@v6
62+
with:
63+
context: ./src/ContentProcessor
64+
file: ./src/ContentProcessor/Dockerfile
65+
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' }}
66+
tags: |
67+
${{ env.ACR_LOGIN_SERVER }}/contentprocessor:${{ env.BASE_TAG }}
68+
${{ env.ACR_LOGIN_SERVER }}/contentprocessor:${{ env.DATE_TAG }}
6769
68-
- name: Build and push ContentProcessorAPI Docker image
69-
run: |
70-
cd src/ContentProcessorAPI
71-
IMAGE_NAME="$ACR_LOGIN_SERVER/contentprocessorapi:${TAG}"
72-
echo "Using image name: ${IMAGE_NAME}"
73-
# Use the Dockerfile from the root folder of ContentProcessorAPI
74-
docker build -t ${IMAGE_NAME} -f Dockerfile .
75-
if [[ "${TAG}" == latest-* || "${TAG}" == dev-* || "${TAG}" == demo-* || "${TAG}" == hotfix-* ]]; then
76-
docker push ${IMAGE_NAME}
77-
echo "ContentProcessorAPI image built and pushed successfully."
78-
else
79-
echo "Skipping Docker push for ContentProcessorAPI with tag: ${TAG}"
80-
fi
70+
- name: Build and Push ContentProcessorAPI Docker image
71+
uses: docker/build-push-action@v6
72+
with:
73+
context: ./src/ContentProcessorAPI
74+
file: ./src/ContentProcessorAPI/Dockerfile
75+
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' }}
76+
tags: |
77+
${{ env.ACR_LOGIN_SERVER }}/contentprocessorapi:${{ env.BASE_TAG }}
78+
${{ env.ACR_LOGIN_SERVER }}/contentprocessorapi:${{ env.DATE_TAG }}
8179
82-
- name: Build and push ContentProcessorWeb Docker image
83-
run: |
84-
cd src/ContentProcessorWeb
85-
IMAGE_NAME="$ACR_LOGIN_SERVER/contentprocessorweb:${TAG}"
86-
echo "Using image name: ${IMAGE_NAME}"
87-
# Use the Dockerfile from the root folder of ContentProcessorWeb
88-
docker build -t ${IMAGE_NAME} -f Dockerfile .
89-
if [[ "${TAG}" == latest-* || "${TAG}" == dev-* || "${TAG}" == demo-* || "${TAG}" == hotfix-* ]]; then
90-
docker push ${IMAGE_NAME}
91-
echo "ContentProcessorWeb image built and pushed successfully."
92-
else
93-
echo "Skipping Docker push for ContentProcessorWeb with tag: ${TAG}"
94-
fi
80+
- name: Build and Push ContentProcessorWeb Docker image
81+
uses: docker/build-push-action@v6
82+
with:
83+
context: ./src/ContentProcessorWeb
84+
file: ./src/ContentProcessorWeb/Dockerfile
85+
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' }}
86+
tags: |
87+
${{ env.ACR_LOGIN_SERVER }}/contentprocessorweb:${{ env.BASE_TAG }}
88+
${{ env.ACR_LOGIN_SERVER }}/contentprocessorweb:${{ env.DATE_TAG }}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Create-Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
create-release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
ref: ${{ github.event.workflow_run.head_sha }}
20+
21+
- uses: codfish/semantic-release-action@v3
22+
id: semantic
23+
with:
24+
tag-format: 'v${version}'
25+
additional-packages: |
26+
['conventional-changelog-conventionalcommits@7']
27+
plugins: |
28+
[
29+
[
30+
"@semantic-release/commit-analyzer",
31+
{
32+
"preset": "conventionalcommits"
33+
}
34+
],
35+
[
36+
"@semantic-release/release-notes-generator",
37+
{
38+
"preset": "conventionalcommits",
39+
"presetConfig": {
40+
"types": [
41+
{ type: 'feat', section: 'Features', hidden: false },
42+
{ type: 'fix', section: 'Bug Fixes', hidden: false },
43+
{ type: 'perf', section: 'Performance Improvements', hidden: false },
44+
{ type: 'revert', section: 'Reverts', hidden: false },
45+
{ type: 'docs', section: 'Other Updates', hidden: false },
46+
{ type: 'style', section: 'Other Updates', hidden: false },
47+
{ type: 'chore', section: 'Other Updates', hidden: false },
48+
{ type: 'refactor', section: 'Other Updates', hidden: false },
49+
{ type: 'test', section: 'Other Updates', hidden: false },
50+
{ type: 'build', section: 'Other Updates', hidden: false },
51+
{ type: 'ci', section: 'Other Updates', hidden: false }
52+
]
53+
}
54+
}
55+
],
56+
'@semantic-release/github'
57+
]
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
- run: echo ${{ steps.semantic.outputs.release-version }}
61+
62+
- run: echo "$OUTPUTS"
63+
env:
64+
OUTPUTS: ${{ toJson(steps.semantic.outputs) }}

0 commit comments

Comments
 (0)