OY-4962 Päivitetty JVM versioon 21 #335
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
name: Sijoittelu-service | |
on: | |
workflow_dispatch: | |
push: | |
paths-ignore: | |
- '**.md' | |
jobs: | |
test-and-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: main | |
- uses: actions/checkout@v4 | |
with: | |
repository: Opetushallitus/valintalaskenta | |
ref: refs/heads/master | |
path: valintalaskenta | |
- name: Cache local Maven repository | |
uses: actions/cache@v2 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- uses: szenius/[email protected] | |
with: | |
timezoneLinux: "Europe/Helsinki" | |
- name: Build with Maven | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
GITHUB_TOKEN: ${{ github.token }} | |
run: | | |
cd main | |
mvn clean verify -Pit -Dit.usePhantomJs=true -B -Dbranch=${GITHUB_REF_NAME} -Drevision=${GITHUB_SHA} -DbuildNumber=${GITHUB_RUN_NUMBER} | |
- uses: actions/cache@v2 | |
id: restore-build | |
with: | |
path: | | |
main/target | |
main/sijoittelu-algoritmi-batch/target | |
main/sijoittelu-algoritmi-domain/target | |
main/sijoittelu-service/target | |
main/sijoittelu-tulos-api/target | |
main/sijoittelu-tulos-service/target | |
key: ${{ github.sha }} | |
deploy-container: | |
needs: test-and-build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: main | |
- uses: actions/cache@v2 | |
id: restore-build | |
with: | |
path: | | |
main/target | |
main/sijoittelu-algoritmi-batch/target | |
main/sijoittelu-algoritmi-domain/target | |
main/sijoittelu-service/target | |
main/sijoittelu-tulos-api/target | |
main/sijoittelu-tulos-service/target | |
key: ${{ github.sha }} | |
- name: Build and deploy Docker container | |
shell: bash | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
run: | | |
cd main | |
git clone https://github.com/Opetushallitus/ci-tools.git | |
source ci-tools/common/setup-tools.sh | |
export ARTIFACT_NAME="sijoittelu-service" | |
mv sijoittelu-service/target/sijoittelu-service.jar $DOCKER_BUILD_DIR/artifact/${ARTIFACT_NAME}.jar | |
cp -vr src/main/resources/oph-configuration $DOCKER_BUILD_DIR/config/ | |
export BASE_IMAGE="baseimage-fatjar-openjdk21:master" | |
./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-jar-library: | |
needs: test-and-build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: main | |
- uses: actions/cache@v2 | |
id: restore-build | |
with: | |
path: | | |
main/target | |
main/sijoittelu-algoritmi-batch/target | |
main/sijoittelu-algoritmi-domain/target | |
main/sijoittelu-service/target | |
main/sijoittelu-tulos-api/target | |
main/sijoittelu-tulos-service/target | |
key: ${{ github.sha }} | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- name: Deploy jar library | |
#if: github.ref == 'refs/heads/master' | |
shell: bash | |
env: | |
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} | |
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} | |
run: | | |
cd main | |
git clone https://github.com/Opetushallitus/ci-tools.git | |
source ci-tools/common/setup-tools.sh | |
mvn deploy -B -pl fi.vm.sade.sijoittelu:sijoittelu,sijoittelu-tulos-api,sijoittelu-algoritmi-domain,sijoittelu-algoritmi-batch,sijoittelu-tulos-service -DskipTests --settings ci-tools/common/maven-settings.xml |