Skip to content

Commit

Permalink
Add GitLab CI build
Browse files Browse the repository at this point in the history
  • Loading branch information
floscher committed Sep 26, 2018
1 parent dfc02c3 commit 985e13b
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 2 deletions.
123 changes: 123 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
image: registry.gitlab.com/josm/docker-library/openjdk-8-josmplugin:latest

before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle

cache:
paths:
- .gradle/wrapper
- .gradle/caches


###############
# Build stage #
###############

assemble:
stage: build
script:
- ./gradlew assemble --stacktrace
artifacts:
paths:
- build/

assemble with java 10:
stage: build
image: registry.gitlab.com/josm/docker-library/openjdk-10-josmplugin:latest
script:
- ./gradlew assemble --stacktrace
artifacts:
paths:
- build/


##############
# Test stage #
##############

build:
stage: test
script:
- ./gradlew build generatePot --stacktrace
artifacts:
paths:
- build
dependencies:
- assemble

compile against min JOSM:
stage: test
script:
- ./gradlew compileJava_minJosm --stacktrace
dependencies:
- assemble

compile against latest JOSM:
stage: test
script:
- ./gradlew compileJava_latestJosm --stacktrace
dependencies:
- assemble

build with java 10:
stage: test
image: registry.gitlab.com/josm/docker-library/openjdk-10-josmplugin:latest
script:
- ./gradlew build --stacktrace
dependencies:
- assemble with java 10


################
# Deploy stage #
################

upload to transifex:
image: registry.gitlab.com/josm/docker-library/python-transifex:latest
stage: deploy
environment:
name: transifex
url: https://www.transifex.com/josm/josm/josm-plugin_Mapillary/
script:
- TX_TOKEN="$TRANSIFEX_TOKEN" tx push -s --no-interactive
dependencies:
- build
only:
refs:
- master@JOSM/Mapillary
variables:
- $TRANSIFEX_TOKEN

release:
stage: deploy
environment:
name: pages branch / dist directory
url: https://gitlab.com/JOSM/Mapillary/tree/pages/dist
script:
- |
echo "$SSH_PRIVATE_DEPLOY_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
git clone --depth 1 --branch pages git@gitlab.com:JOSM/Mapillary.git pages
- |
version=`git describe --always --dirty`
longVersion=`git describe --always --long --dirty`
commitMessage="Release version $longVersion"
- |
mkdir -pv "pages/dist/$version"
cp -v build/dist/* build/tmp/jar/MANIFEST.MF "pages/dist/$version"
rm -fv "pages/dist/latest"
ln -s "./$version" "pages/dist/latest"
- |
cd pages/
git config user.name "GitLab CI for JOSM/Mapillary"
git config user.email "incoming+JOSM/Mapillary@incoming.gitlab.com"
git stage .
git commit -a -m "$commitMessage"
git push origin pages
dependencies:
- build
only:
refs:
- tags@JOSM/Mapillary
variables:
- $SSH_PRIVATE_DEPLOY_KEY
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ josm {
oldVersionDownloadLink 10824, 'v1.5.3', new URL('https://github.com/JOSM/Mapillary/releases/download/v1.5.3/Mapillary.jar')
}
i18n {
pathTransformer = getPathTransformer("github.com/JOSM/Mapillary/blob")
pathTransformer = getPathTransformer("gitlab.com/JOSM/Mapillary/blob")
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
plugin.author=nokutu <nokutu@openmailbox.org>
plugin.author=nokutu, floscher <incoming+JOSM/Mapillary@incoming.gitlab.com>
plugin.canloadatruntime=true
plugin.class=org.openstreetmap.josm.plugins.mapillary.MapillaryPlugin
plugin.description=Allows the user to work with pictures hosted at mapillary.com
Expand Down

0 comments on commit 985e13b

Please sign in to comment.