Merge branch 'gitlabCi' into 'master'

Gitlab ci

See merge request pheerai/kotlin-native-app-bom!1
This commit is contained in:
Oliver Rümpelein 2021-03-06 19:32:09 +01:00
commit dbd34c8078
4 changed files with 44 additions and 2 deletions

1
.gitignore vendored
View file

@ -65,4 +65,3 @@ hs_err_pid*
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

30
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,30 @@
# Based on https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Gradle.gitlab-ci.yml
image: gradle:jdk11
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
build:
stage: build
script: gradle --build-cache assemble
cache:
key: "$CI_COMMIT_REF_NAME"
policy: push
paths:
- build
- .gradle
artifact:
stage: deploy
script: gradle publish
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
cache:
key: "$CI_COMMIT_REF_NAME"
policy: pull-push
paths:
- build
- .gradle

View file

@ -53,6 +53,19 @@ publishing {
from(components["javaPlatform"])
}
}
repositories {
maven {
url = uri("https://git.f3l.de/api/v4/projects/160/packages/maven")
name = "GitLab"
credentials(HttpHeaderCredentials::class.java) {
name = "Job-Token"
value = System.getenv("CI_JOB_TOKEN")
}
authentication {
create<HttpHeaderAuthentication>("header")
}
}
}
}
inline fun <reified T> getFromProperties(name: String): T = project.properties[name] as T

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists