Skip to content

Commit

Permalink
OK-591 Build ovara-valintaperusteet image
Browse files Browse the repository at this point in the history
  • Loading branch information
msiukola committed Oct 2, 2024
1 parent 6335ba6 commit 751ee55
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Cache local Maven repository
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
Expand All @@ -37,7 +37,7 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
run: mvn clean spotless:check package sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=opetushallitus -Dsonar.projectKey=Opetushallitus_valintaperusteet -B -Dbranch=${GITHUB_REF_NAME} -Drevision=${GITHUB_SHA} -DbuildNumber=${GITHUB_RUN_NUMBER}

- uses: actions/cache@v2
- uses: actions/cache@v4
id: restore-build
with:
path: |
Expand All @@ -46,16 +46,17 @@ jobs:
valintaperusteet-domain/target
valintaperusteet-laskenta/target
valintaperusteet-service/target
ovara-valintaperusteet/target
key: ${{ github.sha }}

deploy-container:
needs: test-and-build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/cache@v2
- uses: actions/cache@v4
id: restore-build
with:
path: |
Expand All @@ -74,22 +75,33 @@ jobs:
run: |
git clone https://github.com/Opetushallitus/ci-tools.git
source ci-tools/common/setup-tools.sh
export ARTIFACT_NAME="valintaperusteet-service"
mv valintaperusteet-service/target/valintaperusteet-service.jar $DOCKER_BUILD_DIR/artifact/${ARTIFACT_NAME}.jar
mv valintaperusteet-service/target/valintaperusteet-service-exec.jar $DOCKER_BUILD_DIR/artifact/${ARTIFACT_NAME}.jar
cp -vr src/main/resources/oph-configuration $DOCKER_BUILD_DIR/config/
export BASE_IMAGE="baseimage-fatjar-openjdk17: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
./ci-tools/common/clean-docker-build-dir.sh
export ARTIFACT_NAME="ovara-valintaperusteet"
mv ovara-valintaperusteet/target/ovara-valintaperusteet.jar $DOCKER_BUILD_DIR/artifact/${ARTIFACT_NAME}.jar
cp -vr ovara-valintaperusteet/src/main/resources/oph-configuration $DOCKER_BUILD_DIR/config/
export BASE_IMAGE="baseimage-fatjar-openjdk17:OK-568b"
./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@v2
- uses: actions/checkout@v4

- uses: actions/cache@v2
- uses: actions/cache@v4
id: restore-build
with:
path: |
Expand All @@ -101,7 +113,7 @@ jobs:
key: ${{ github.sha }}

- name: Set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
Expand Down

0 comments on commit 751ee55

Please sign in to comment.