-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cae7b7b
commit 8883604
Showing
5 changed files
with
148 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Service CI Build | ||
run-name: Build Service on branch ${{github.ref_name}} triggered by ${{github.actor}} | ||
|
||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Executes Tests | ||
runs-on: self-hosted | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: maven | ||
- name: Tests with Maven | ||
run: mvn clean install --file ./marketplace-service/pom.xml | ||
analysis: | ||
name: Sonarqube analysis | ||
needs: build | ||
runs-on: self-hosted | ||
env: | ||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
SONAR_PROJECT_KEY : ${{ secrets.SONAR_PROJECT_KEY }} | ||
steps: | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
- name: Run SonarQube Scanner | ||
run: | | ||
mvn -B verify sonar:sonar --file ./marketplace-service/pom.xml \ | ||
-Dsonar.host.url=${{ env.SONAR_HOST_URL }} \ | ||
-Dsonar.projectKey=${{ env.SONAR_PROJECT_KEY }} \ | ||
-Dsonar.projectName="AxonIvy Market Service" \ | ||
-Dsonar.token=${{ env.SONAR_TOKEN }} \ | ||
- name: SonarQube Quality Gate check | ||
id: sonarqube-quality-gate-check | ||
uses: sonarsource/sonarqube-quality-gate-action@master | ||
timeout-minutes: 5 | ||
with: | ||
scanMetadataReportFile: ./marketplace-service/target/sonar/report-task.txt | ||
args: -Dsonar.projectKey=${{ env.SONAR_PROJECT_KEY }} |
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,42 @@ | ||
name: Service DEV Build | ||
run-name: Build and Deploy Marketplace-Service on branch ${{github.ref_name}} by ${{github.actor}} | ||
|
||
on: | ||
push: | ||
branches: [ "develop" ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Packge project and deploy to tomcat | ||
runs-on: self-hosted | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: maven | ||
- name: Update configuration | ||
env: | ||
APP_PROPERTIES_FILE: './marketplace-service/src/main/resources/application.properties' | ||
GITHUB_TOKEN_FILE: './marketplace-service/src/main/resources/github.token' | ||
MONGODB_HOST: ${{ secrets.MONGODB_HOST }} | ||
MONGODB_DATABASE: ${{ secrets.MONGODB_DATABASE }} | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
run: | | ||
sed -i "s/^spring.data.mongodb.host=.*$/spring.data.mongodb.host=$MONGODB_HOST/" $APP_PROPERTIES_FILE | ||
sed -i "s/^spring.data.mongodb.database=.*$/spring.data.mongodb.database=$MONGODB_DATABASE/" $APP_PROPERTIES_FILE | ||
sed -i '1d;$d' $GITHUB_TOKEN_FILE && echo $GH_TOKEN > $GITHUB_TOKEN_FILE | ||
- name: Build with Maven | ||
run: mvn clean package -DskipTests --file ./marketplace-service/pom.xml | ||
- name: Prepare deployment directory | ||
run: mkdir -p deployment && cp target/*.war deployment/ | ||
- name: Copy WAR to Tomcat server | ||
run: sudo cp deployment/*.war /opt/tomcat/webapps/marketplace-service.war | ||
- name: Restart Tomcat server | ||
run: | | ||
sudo systemctl stop tomcat | ||
sudo systemctl start tomcat |
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,28 @@ | ||
name: UI Dev Build | ||
run-name: Build and Deploy Marketplace-UI on branch ${{github.ref_name}} by ${{github.actor}} | ||
|
||
on: | ||
push: | ||
branches: [ "develop" ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Build and deploy new code to Deployment directory | ||
runs-on: self-hosted | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
cache: 'npm' | ||
- name: Install Dependencies | ||
run: npm install | ||
- name: Build Angular app | ||
run: npm run build -- --configuration production --output-path=dist | ||
- name: Execute Tests | ||
run: npm run test | ||
- name: Copy files to Deployment directory | ||
if: success() | ||
run: sudo cp -r dist/* /var/www/marketplace-ui |