forked from ShouraySolanki/knowlg-search
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Sunbird-Knowlg#2 from Sunbird-Knowlg/release-5.7.0
Issue KN-000 merge: Merge Release 5.7.0 into Master
- Loading branch information
Showing
1,045 changed files
with
42,950 additions
and
98,711 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
name: search api workflow | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: 14 | ||
distribution: 'adopt' | ||
architecture: x64 | ||
|
||
- name: Cache Maven dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2 | ||
key: kp-dependency-build-cache-${{ hashFiles('pom.xml') }} | ||
|
||
- name: Build the project | ||
run: | | ||
cd search-api/ | ||
ls | ||
mvn clean install -DskipTests | ||
- name: Login to docker hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ vars.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build docker image and push | ||
run: | | ||
docker images | ||
cd search-api/ | ||
sh knowlg-docker-image.sh ${{ github.ref_name }} | ||
docker images | ||
docker tag search-service:${{ github.ref_name }} ${{ vars.DOCKERHUB_USERNAME }}/search-service:${{ github.ref_name }} | ||
docker push ${{ vars.DOCKERHUB_USERNAME }}/search-service:${{ github.ref_name }} | ||
- name: Store Maven dependencies cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2 | ||
key: kp-dependency-build-cache-${{ hashFiles('pom.xml') }} | ||
|
||
unit-tests: | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: 14 | ||
distribution: 'adopt' | ||
architecture: x64 | ||
|
||
- name: Cache Maven dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2 | ||
key: kp-dependency-test-cache-${{ hashFiles('pom.xml') }} | ||
|
||
- name: Setup environment and run tests | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
run: | | ||
cd search-api/ | ||
bash vmsetup.sh | ||
- name: Save test results | ||
run: | | ||
mkdir -p ~/test-results/junit/ | ||
find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/test-results/junit/ \; | ||
if: always() | ||
|
||
- name: Store Maven dependencies cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2 | ||
key: kp-dependency-test-cache-${{ hashFiles('pom.xml') }} | ||
|
||
- name: Upload test results | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: test-results | ||
path: ~/test-results | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: search job workflow | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
docker-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to docker hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ vars.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build docker image and push | ||
run: | | ||
cd search-job/ | ||
mvn clean install -DskipTests | ||
docker build -t ${{ vars.DOCKERHUB_USERNAME }}/search-indexer:${{ github.ref_name }} . | ||
docker images | ||
docker push ${{ vars.DOCKERHUB_USERNAME }}/search-indexer:${{ github.ref_name }} | ||
unit-tests: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./search-job/ | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Java | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: 14 | ||
distribution: 'adopt' | ||
architecture: x64 | ||
|
||
- name: Install imagemagick | ||
run: | | ||
sudo apt-get update --allow-releaseinfo-change || sudo apt-get update --allow-releaseinfo-change | ||
sudo apt-get install -y imagemagick | ||
- name: Execute coverage report | ||
run: | | ||
mvn clean scoverage:report | ||
- name: Save test results | ||
run: | | ||
mkdir -p ~/test-results/junit/ | ||
find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/test-results/junit/ \; | ||
if: always() | ||
- name: Save Maven cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2 | ||
key: kp-jobs-dependency-cache-${{ hashFiles('pom.xml') }} | ||
- name: Upload test results | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: test-results | ||
path: ~/test-results | ||
- name: Run SonarQube analysis | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
run: | | ||
mvn -X sonar:sonar -Dlog4j.configuration=./logs sonar:sonar -Dsonar.projectKey=Sunbird-Knowlg_knowlg-search -Dsonar.organization=sunbird-knowlg-1 -Dsonar.host.url=https://sonarcloud.io -Dsonar.exclusions=**/cert-processor/** -Dsonar.scala.coverage.reportPaths=/home/runner/work/knowlg-search/knowlg-search/search-job/target/scoverage.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
knowlg-search/.metals/metals.lock.db | ||
project | ||
.DS_Store | ||
**/target/** | ||
**/.idea/** | ||
**/*.iml | ||
.idea | ||
*.class |
Oops, something went wrong.