From 64bc123e52c17dfc18fd74f7119c162738e5df9a Mon Sep 17 00:00:00 2001 From: Taylor Smock Date: Thu, 17 Oct 2019 09:32:24 -0600 Subject: [PATCH] Modify gitlab ci for more generic files Signed-off-by: Taylor Smock --- .gitlab-ci.yml | 27 +++++++++++++++++---------- build.gradle | 10 +++++++--- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 78c519a..5b6a5b5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -142,18 +142,18 @@ build with java 13: # dependencies: # - build # only: -# - master@gokaart/JOSM_MapWithAI +# - master release: stage: deploy environment: name: pages branch / dist directory - url: https://gitlab.com/gokaart/JOSM_MapWithAI/tree/pages/public/dist + url: ${CI_PAGES_URL}/${CI_PROJECT_NAME} script: - &clone_pages_branch | echo "$SSH_PRIVATE_DEPLOY_KEY" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa - git clone --depth 1 --branch pages git@gitlab.com:gokaart/JOSM_MapWithAI.git pages + git clone --depth 1 --branch pages ${CI_REPOSITORY_URL} pages - | version=`git describe --always --dirty` longVersion=`git describe --always --long --dirty` @@ -166,20 +166,23 @@ release: - &push_pages_branch | cd pages/ git config user.name "Deploy with GitLab CI" - git config user.email "gokaart/JOSM_MapWithAI@gitlab.com" + git config user.email "${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}@${CI_SERVER_HOST}" git stage . git commit -a -m "$commitMessage" git push origin pages dependencies: - build only: - - tags@gokaart/JOSM_MapWithAI + refs: + - tags + variables: + - $SSH_PRIVATE_DEPLOY_KEY publish master update site: stage: deploy environment: name: pages branch / snapshot update site - url: https://gitlab.com/gokaart/JOSM_MapWithAI/tree/pages + url: ${CI_PAGES_URL}/${CI_PROJECT_NAME}/snapshot/master/update-site script: - *clone_pages_branch - | @@ -194,17 +197,21 @@ publish master update site: dependencies: - build only: - - master@gokaart/JOSM_MapWithAI + refs: + - master + variables: + - $SSH_PRIVATE_DEPLOY_KEY publish to / GitLab.com packages: stage: deploy environment: - name: GitLab.com / JOSM-MapWithAI packages - url: https://gitlab.com/gokaart/JOSM_MapWithAI/-/packages + name: GitLab.com / ${CI_PROJECT_NAME} packages + url: ${CI_PROJECT_URL}/-/packages script: - ./gradlew publishAllPublicationsToGitlabRepository - ./gradlew releaseToGitlab dependencies: - build only: - - tags@gokaart/JOSM_MapWithAI + refs: + - tags diff --git a/build.gradle b/build.gradle index 03a499e..0f8eaa5 100644 --- a/build.gradle +++ b/build.gradle @@ -38,6 +38,11 @@ tasks.withType(JavaCompile).configureEach { } } +archivesBaseName = "mapwithai" +def gitlabGroup = "gokaart" +def gitlabRepositoryName = "JOSM_lane-connectivity" + + def versions = [ awaitility: "4.0.1", errorprone: "2.3.3", @@ -103,10 +108,9 @@ tasks.processResources { from("$projectDir/src/resources") } -archivesBaseName = "mapwithai" josm { i18n { - pathTransformer = getPathTransformer("gitlab.com/gokaart/JOSM_MapWithAI/blob") + pathTransformer = getPathTransformer("gitlab.com/${gitlabGroup}/${gitlabRepositoryName}/blob") } } @@ -159,7 +163,7 @@ task generateSnapshotUpdateSite(type: GeneratePluginList) { outputFile = new File(project.buildDir, "snapshot-update-site") versionSuffix = {a -> ""} doFirst { - def pluginDownloadUrl = "https://gokaart.gitlab.io/JOSM_MapWithAI/snapshot/master/${archivesBaseName}.jar" + def pluginDownloadUrl = "https://${gitlabGroup}.gitlab.io/${gitlabRepositoryName}/snapshot/master/${archivesBaseName}.jar" it.iconBase64Provider = { def file = new File(sourceSets.main.resources.srcDirs[0], it) if (file.exists()) {