Newer
Older
variables:
MAVEN_OPTS: "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN
-Dorg.slf4j.simpleLogger.showDateTime=true
-Djava.awt.headless=true
-Dmaven.repo.local=.m2/repository"
# Cache downloaded dependencies and plugins between builds.
cache:
paths:
- .m2/repository
stages:
- build
- deploy
# Install requirements to build.
before_script:
# Get version
- export REVISION="$(curl -L https://gitlab.com/ikus-soft/maven-scm-version/-/raw/master/version.sh | bash -)"
- echo "REVISION=$REVISION"
# Setup ssh
- eval $(ssh-agent -s)
- echo "$KALO_WWWDATA_PRIVATEKEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
test:
- apt-get update && apt-get -qq install osslsigncode nsis cron gettext xvfb libgtk-3-0
- xvfb-run mvn -B -Drevision=${REVISION} clean verify
- apt-get update && apt-get -qq install osslsigncode nsis cron gettext xvfb libgtk-3-0
- xvfb-run mvn -B -Drevision=${REVISION} -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_TOKEN clean verify sonar:sonar
- apt-get update && apt-get -qq install osslsigncode nsis cron gettext curl
# Setup authenticode
- apt-get update && apt-get -qq install libssl-dev libcurl4-gnutls-dev autoconf osslsigncode
- echo "$AUTHENTICODE_CERT" | tr -d '\r' > /tmp/authenticode-certs.pem
- echo "$AUTHENTICODE_KEY" | tr -d '\r' > /tmp/authenticode.pem
- mvn -B -Drevision=${REVISION} -DskipTests -Dsign.certs.path=/tmp/authenticode-certs.pem -Dsign.key.path=/tmp/authenticode.pem -Dsign.passphrase=$AUTHENTICODE_PASSPHRASE clean install
artifacts:
paths:
- com.patrikdufresne.planimod-installation-package/target/planimod-*-install.exe
- com.patrikdufresne.planimod-installation-package/target/planimod-*-linux.tar.gz
deploy:
stage: deploy
script:
# Publish to kalo
- scp -o StrictHostKeyChecking=no com.patrikdufresne.planimod-installation-package/target/planimod-${REVISION}-install.exe www-data@kalo.patrikdufresne.com:/var/www/patrikdufresne/archive/planimod/
- scp -o StrictHostKeyChecking=no com.patrikdufresne.planimod-installation-package/target/planimod-${REVISION}-linux.tar.gz www-data@kalo.patrikdufresne.com:/var/www/patrikdufresne/archive/planimod/
dependencies: []
- ssh -o StrictHostKeyChecking=no www-data@kalo.patrikdufresne.com ln -fs /var/www/patrikdufresne/archive/planimod/planimod-${REVISION}-install.exe /var/www/patrikdufresne/archive/planimod/planimod-latest-install.exe
- ssh -o StrictHostKeyChecking=no www-data@kalo.patrikdufresne.com ln -fs /var/www/patrikdufresne/archive/planimod/planimod-${REVISION}-linux.tar.gz /var/www/patrikdufresne/archive/planimod/planimod-latest-linux.tar.gz