diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fd83efcbe..db3878d6f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,8 +38,12 @@ jobs: run: docker build -t $WEBUI_TAG:$IMAGE_VERSION webui - name: Run Server Tests run: server/gradlew --no-daemon -p server check + env: + DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_API_TOKEN }} - name: Build Server Image - run: docker build -t $SERVER_TAG:$IMAGE_VERSION server + run: docker build -t $SERVER_TAG:$IMAGE_VERSION server --secret id=dv-key,env=DEVELOCITY_ACCESS_KEY + env: + DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_API_TOKEN }} - name: Push Docker Images run: | echo ${{ secrets.BOT_ACCESS_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 26f343d14..77e711b30 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,9 @@ jobs: - name: Build Web UI Image run: docker build -t $WEBUI_TAG:$IMAGE_VERSION webui - name: Build Server Image - run: docker build -t $SERVER_TAG:$IMAGE_VERSION server + run: docker build -t $SERVER_TAG:$IMAGE_VERSION server --secret id=dv-key,env=DEVELOCITY_ACCESS_KEY + env: + DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_API_TOKEN }} - name: Push Docker Images run: | echo ${{ secrets.BOT_ACCESS_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin diff --git a/README.md b/README.md index e155b3a32..55cab0393 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ [![Slack workspace](https://img.shields.io/badge/Slack-Join%20workspace-4A154B?logo=slack&logoColor=white)](https://join.slack.com/t/openvsxworkinggroup/shared_invite/zt-2y07y1ggy-ct3IfJljjGI6xWUQ9llv6A) [![License](https://img.shields.io/github/license/eclipse/openvsx)](https://github.com/eclipse/openvsx/blob/master/LICENSE) [![CI](https://github.com/eclipse/openvsx/workflows/CI/badge.svg)](https://github.com/eclipse/openvsx/actions?query=workflow%3ACI) +[![Revved up by Develocity](https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?logo=Gradle&labelColor=02303A)](https://develocity-staging.eclipse.org/) Open VSX is a [vendor-neutral](https://projects.eclipse.org/projects/ecd.openvsx) open-source alternative to the [Visual Studio Marketplace](https://marketplace.visualstudio.com/vscode). It provides a server application that manages [VS Code extensions](https://code.visualstudio.com/api) in a database, a web application similar to the VS Code Marketplace, and a command-line tool for publishing extensions similar to [vsce](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#vsce). diff --git a/server/Dockerfile b/server/Dockerfile index 36762f23b..55a2ddb69 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -6,9 +6,11 @@ COPY --chown=gradle:gradle gradlew *.gradle ./ COPY --chown=gradle:gradle gradle ./gradle/ COPY --chown=gradle:gradle src ./src/ -# Build the server application -RUN ./gradlew --no-daemon assemble +ENV CI=true +# Build the server application +RUN --mount=type=secret,id=dv-key,env=DEVELOCITY_ACCESS_KEY \ + ./gradlew --no-daemon assemble -Ddevelocity.url=https://ge.solutions-team.gradle.com/ FROM eclipse-temurin:17.0.7_7-jdk diff --git a/server/settings.gradle b/server/settings.gradle index 1999fb519..2c08101c3 100644 --- a/server/settings.gradle +++ b/server/settings.gradle @@ -1 +1,28 @@ +plugins { + id 'com.gradle.develocity' version '3.19.1' + id 'com.gradle.common-custom-user-data-gradle-plugin' version '2.1' +} + +def isCI = System.getenv('CI') != null // adjust to your CI provider + +develocity { + server = "https://develocity-staging.eclipse.org" + projectId = "openvsx" // adjust to your project identifier / descriptor + buildScan { + uploadInBackground = !isCI + publishing.onlyIf { it.isAuthenticated() } + obfuscation { + ipAddresses { addresses -> addresses.collect { address -> "0.0.0.0" } } + } + } +} + +buildCache { + remote(develocity.buildCache) { + enabled = true + push = isCI + } +} + + rootProject.name = 'openvsx-server'