Skip to content

Commit c4bd64f

Browse files
Clara HilleClara Hille
authored andcommitted
[DEN-5047] Enable Develocity access
1 parent aebf1b2 commit c4bd64f

File tree

5 files changed

+47
-0
lines changed

5 files changed

+47
-0
lines changed

.github/workflows/check.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@ jobs:
2121
- name: Checkstyle
2222
uses: gradle/gradle-build-action@v2
2323
with:
24+
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
2425
arguments: checkstyleMain checkstyleTest
2526
- name: PMD
2627
uses: gradle/gradle-build-action@v2
2728
with:
29+
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
2830
arguments: pmdMain pmdTest
2931
- name: Test
3032
uses: gradle/gradle-build-action@v2
3133
with:
34+
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
3235
arguments: test

.github/workflows/publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ jobs:
2323
- name: Build sourcesJar and javadocJar
2424
uses: gradle/gradle-build-action@v2
2525
with:
26+
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
2627
arguments: sourcesJar javadocJar
2728
- name: Publish to MavenCentral
2829
uses: gradle/gradle-build-action@v2
2930
with:
31+
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
3032
arguments: publishMavenPublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository
3133
env:
3234
OSSRH_USERNAME: ${{ secrets.MAVEN_USERNAME }}

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
org.gradle.caching=true
2+
org.gradle.parallel=true

gradle/token-utils.gradle

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
def fetchToken() {
2+
String token = System.getenv("CODEARTIFACT_AUTH_TOKEN")
3+
if (token == null || System.getenv("CI") == null) {
4+
token = """aws codeartifact get-authorization-token
5+
--profile production/developer
6+
--domain getyourguide
7+
--domain-owner 130607246975
8+
--query authorizationToken
9+
--output text""".execute().onExit().get().text
10+
}
11+
if (token == null || token.isEmpty()) {
12+
throw new RuntimeException("Error getting codeartifact token. Please call `gygauth setup` in cli and try again.")
13+
}
14+
println("Use codeartifact token: " + token.substring(0, 10) + "...")
15+
return token
16+
}
17+
18+
ext {
19+
fetchToken = this.&fetchToken
20+
}

settings.gradle

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
pluginManagement {
2+
apply from: "$rootDir/gradle/token-utils.gradle"
3+
def token = fetchToken()
4+
repositories {
5+
maven {
6+
name "codeartifact"
7+
url "https://getyourguide-130607246975.d.codeartifact.eu-central-1.amazonaws.com/maven/private/"
8+
credentials {
9+
username "aws"
10+
password "$token"
11+
}
12+
}
13+
gradlePluginPortal()
14+
}
15+
}
16+
17+
plugins {
18+
id 'com.getyourguide.libs.gradle.develocity.configuration' version '4.9.2'
19+
}
20+
121
rootProject.name = 'openapi-validation'
222

323
include('openapi-validation-api')

0 commit comments

Comments
 (0)