Skip to content

Commit

Permalink
switch gradle to maven
Browse files Browse the repository at this point in the history
  • Loading branch information
tokarls committed Oct 24, 2024
1 parent d95bd68 commit f79b12c
Show file tree
Hide file tree
Showing 24 changed files with 767 additions and 753 deletions.
56 changes: 14 additions & 42 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,14 @@ jobs:
npm run prettier
CI=true npm run test
npm run build
- uses: gradle/actions/wrapper-validation@v3
- uses: gradle/actions/setup-gradle@v3
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew clean build
run: mvn clean install -B -Dbranch=$GITHUB_REF_NAME -Drevision=$GITHUB_SHA -DbuildNumber=$GITHUB_RUN_NUMBER/$GITHUB_RUN_ATTEMPT
- uses: actions/upload-artifact@v4
with:
name: organisaatio-service-jar
path: organisaatio-service/build/libs/organisaatio-service.jar
path: organisaatio-service/target/organisaatio-service.jar
cypress:
runs-on: ubuntu-latest
services:
Expand Down Expand Up @@ -92,17 +90,15 @@ jobs:
PGPASSWORD=postgres psql -c 'CREATE DATABASE organisaatio;' -h localhost -U postgres
cd mock-api && npm install && cd -
cd organisaatio-ui && npm ci --force && cd -
- uses: gradle/actions/wrapper-validation@v3
- uses: gradle/actions/setup-gradle@v3
- name: Build backend with no tests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew clean build -x test
run: mvn clean install -DskipTests=true
- name: Run Cypress
run: |
cd mock-api && npm run mock-api &
cd organisaatio-ui && npm run start &
java -jar -Xms2g -Xmx2g -Dspring.config.location=classpath:application.properties,classpath:application-test-envs.properties -Dspring.profiles.active=dev -Dspring.flyway.enabled=true -Durl-virkailija=http://localhost:9000 -Dhost.virkailija=localhost:9000 -Durl-ytj=http://localhost:9000/ytj -Durl-oidservice=http://localhost:9000/oidservice -Dcas.service.organisaatio-service=http://localhost:8080/organisaatio-service-not-available organisaatio-service/build/libs/organisaatio-service.jar &
java -jar -Xms2g -Xmx2g -Dspring.config.location=classpath:application.properties,classpath:application-test-envs.properties -Dspring.profiles.active=dev -Dspring.flyway.enabled=true -Durl-virkailija=http://localhost:9000 -Dhost.virkailija=localhost:9000 -Durl-ytj=http://localhost:9000/ytj -Durl-oidservice=http://localhost:9000/oidservice -Dcas.service.organisaatio-service=http://localhost:8080/organisaatio-service-not-available organisaatio-service/target/organisaatio-service.jar &
cd organisaatio-ui && npm run cypress:ci
kill $(jobs -p) || true
playwright:
Expand Down Expand Up @@ -138,17 +134,15 @@ jobs:
cd mock-api && npm ci && cd -
cd organisaatio-ui && npm ci --force && cd -
cd playwright && npm ci && npx playwright install --with-deps && cd -
- uses: gradle/actions/wrapper-validation@v3
- uses: gradle/actions/setup-gradle@v3
- name: Build backend with no tests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew clean build -x test
run: mvn clean install -DskipTests=true
- name:
run: |
cd mock-api && npm run mock-api &
cd organisaatio-ui && npm run start &
java -jar -Xms2g -Xmx2g -Dspring.config.location=classpath:application.properties,classpath:application-test-envs.properties -Dspring.profiles.active=dev -Dspring.flyway.enabled=true -Durl-virkailija=http://localhost:9000 -Dhost.virkailija=localhost:9000 -Durl-ytj=http://localhost:9000/ytj -Durl-oidservice=http://localhost:9000/oidservice -Dcas.service.organisaatio-service=http://localhost:8080/organisaatio-service-not-available organisaatio-service/build/libs/organisaatio-service.jar &
java -jar -Xms2g -Xmx2g -Dspring.config.location=classpath:application.properties,classpath:application-test-envs.properties -Dspring.profiles.active=dev -Dspring.flyway.enabled=true -Durl-virkailija=http://localhost:9000 -Dhost.virkailija=localhost:9000 -Durl-ytj=http://localhost:9000/ytj -Durl-oidservice=http://localhost:9000/oidservice -Dcas.service.organisaatio-service=http://localhost:8080/organisaatio-service-not-available organisaatio-service/target/organisaatio-service.jar &
while ! nc -z localhost 3003; do
sleep 1; echo "Sleeping 3003"
done
Expand Down Expand Up @@ -206,17 +200,11 @@ jobs:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build sonarqube
run: mvn clean verify sonar:sonar -Dsonar.projectKey=Opetushallitus_organisaatio
deploy-container:
needs: [cypress, build, playwright]
runs-on: ubuntu-latest
Expand All @@ -241,24 +229,6 @@ jobs:
./ci-tools/common/pull-image.sh
./ci-tools/github-build/build-fatjar.sh $ARTIFACT_NAME
./ci-tools/github-build/upload-image.sh $ARTIFACT_NAME
deploy-artifacts:
needs: [build, cypress, playwright]
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "corretto"
- uses: gradle/actions/wrapper-validation@v3
- uses: gradle/actions/setup-gradle@v3
- name: Publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_sadeRepositoryUsername: ${{ secrets.ARTIFACTORY_USERNAME }}
ORG_GRADLE_PROJECT_sadeRepositoryPassword: ${{ secrets.ARTIFACTORY_PASSWORD }}
run: ./gradlew publish -PversionSuffix=.RELEASE
deploy-artifacts-snapshot:
needs: [build, cypress, playwright]
if: github.ref != 'refs/heads/master'
Expand All @@ -269,11 +239,13 @@ jobs:
with:
java-version: "21"
distribution: "corretto"
- uses: gradle/actions/wrapper-validation@v3
- uses: gradle/actions/setup-gradle@v3
cache: "maven"
- name: Publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_sadeRepositoryUsername: ${{ secrets.ARTIFACTORY_USERNAME }}
ORG_GRADLE_PROJECT_sadeRepositoryPassword: ${{ secrets.ARTIFACTORY_PASSWORD }}
run: ./gradlew publish
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
run: |
git clone https://github.com/Opetushallitus/ci-tools.git
source ci-tools/common/setup-tools.sh
mvn deploy -pl organisaatio-api -am -DskipTests --settings ci-tools/common/maven-settings.xml
67 changes: 0 additions & 67 deletions build.gradle

This file was deleted.

7 changes: 0 additions & 7 deletions gradle.properties

This file was deleted.

Binary file removed gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 0 additions & 7 deletions gradle/wrapper/gradle-wrapper.properties

This file was deleted.

Loading

0 comments on commit f79b12c

Please sign in to comment.