From b90ba7977e57214565678cd1e528bacf64f1a26d Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Sun, 15 May 2022 15:14:46 +0200 Subject: ci: Build Docker images for build pipeline This change updates the CI build pipeline to also build the Docker images in order to catch any regressions in the deployment process via Docker. --- .github/workflows/build.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3a4dc27e..9cde7fbe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,3 +56,17 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} files: ./build/reports/jacoco/codeCoverageReport/codeCoverageReport.xml + build-docker: + name: Build Docker Images + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Build Runner + uses: docker/build-push-action@v3 + with: + file: opendc-web/opendc-web-runner/Dockerfile + - name: Build API + uses: docker/build-push-action@v3 + with: + file: opendc-web/opendc-web-api/Dockerfile -- cgit v1.2.3 From cbff4835536f4f1418880ac0ddae75beb0009875 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Sun, 15 May 2022 15:15:43 +0200 Subject: build(web/runner): Reduce build steps for Docker image This change updates the Dockerfile for the web runner to reduce the number of build steps necessary to build the web runner. Previously, the build would also include/build the web API which is not used in the image. --- opendc-web/opendc-web-runner/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendc-web/opendc-web-runner/Dockerfile b/opendc-web/opendc-web-runner/Dockerfile index 771ed2ed..b72f8a7f 100644 --- a/opendc-web/opendc-web-runner/Dockerfile +++ b/opendc-web/opendc-web-runner/Dockerfile @@ -9,10 +9,10 @@ RUN ./gradlew --version # Build project COPY ./ /app/ -RUN ./gradlew --no-daemon :installDist +RUN ./gradlew --no-daemon :opendc-web:opendc-web-runner:installDist FROM openjdk:17-slim -COPY --from=0 /app/build/install /opt/ +COPY --from=0 /app/opendc-web/opendc-web-runner/build/install /opt/ COPY --from=0 /app/traces /opt/opendc/traces WORKDIR /opt/opendc CMD bin/opendc-web-runner -- cgit v1.2.3 From 3908391fd67da33df2d43c1b01a9e1709dd73c05 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Sun, 15 May 2022 16:18:59 +0200 Subject: build(web/api): Ensure Node.js is downloaded This change updates the build configuration in order to ensure that Node.js is downloaded onto the build system. This drops an explicit dependency on a system installation of Node.js and allows us to ensure that the project is built against the correct Node.js version. --- gradle/libs.versions.toml | 2 +- opendc-web/opendc-web-ui/build.gradle.kts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a7956ce3..a6eac3ed 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ clikt = "3.4.1" config = "1.4.2" commons-math3 = "3.6.1" dokka = "1.6.10" -gradle-node = "3.2.1" +gradle-node = "3.3.0" hadoop = "3.3.1" jackson = "2.13.2" jandex-gradle = "0.12.0" diff --git a/opendc-web/opendc-web-ui/build.gradle.kts b/opendc-web/opendc-web-ui/build.gradle.kts index c0e3fcf6..f8c0a45b 100644 --- a/opendc-web/opendc-web-ui/build.gradle.kts +++ b/opendc-web/opendc-web-ui/build.gradle.kts @@ -38,6 +38,10 @@ sourceSets { } } +node { + download.set(true) +} + val formatTask = tasks.register("format") { args.set(listOf("run", "format")) dependsOn(tasks.npmInstall) -- cgit v1.2.3