Skip to content

Commit

Permalink
Windows Installer
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrass authored and ThomasBachran committed Dec 13, 2023
1 parent 61ddc77 commit 610ebf1
Show file tree
Hide file tree
Showing 27 changed files with 5,874 additions and 10 deletions.
62 changes: 54 additions & 8 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# https://gradle.org/
# https://github.com/gradle/gradle


image: svwsnrw/dockerrunner:21

# Disable the Gradle daemon for Continuous Integration servers as correctness
Expand All @@ -26,15 +27,12 @@ cache: &global_cache
- .gradle_user
- .gradle

before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle_user
- ./gradlew --version
- java --version

stages:
- build
- integration-tests
- analyze
- build_linux
- build_windows
- publish

publish:
Expand All @@ -45,7 +43,8 @@ publish:
variables:
SECURE_FILES_DOWNLOAD_PATH: '/'
needs:
- job: build
- job: build_linux
- job: build_windows
script:
- curl --silent "https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer" | bash
- cat gradle_secure.properties >> gradle.properties
Expand All @@ -54,15 +53,61 @@ publish:
- ./deployment/setupVersion.sh
- ./gradlew signJar publishReleaseAllAndCloseSonatype
- ./gradlew :deployment:docker:dockerPushAllDockerhub
- ./gradlew :deployment:linux-installer:buildLinuxInstaller
- ls -dlah $PWD/artifacts_windows
- ls -dlah $PWD/artifacts_linux/distributions
- ./gradlew :deployment:githubRelease

build_linux:
stage: build_linux
rules:
- if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?$/'
needs:
- job: build
script:
- chmod +x ./deployment/setupVersion.sh
- ./deployment/setupVersion.sh
- ./gradlew :deployment:linux-installer:buildLinuxInstaller
- mkdir artifacts_linux
- cp -r ./deployment/linux-installer/build/distributions/ ./artifacts_linux
artifacts:
paths:
- artifacts_linux/
when: on_success

build_windows:
stage: build_windows
rules:
- if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?$/'
needs:
- job: build
tags:
- windows
variables:
SECURE_FILES_DOWNLOAD_PATH: '/'
SVWS_SIGNTOOL_PATH: 'c:\tmp\signtool\signtool'
image: svwsnrw/dockerrunner-win
script:
- ./deployment/setupVersion.ps1
- c:/tmp/download-secure-files-windows-amd64.exe
- Add-Content -Path ".\gradle.properties" -Value (Get-Content -Path ".\gradle_secure.properties")
- dir /builds/svws/SVWS-Server/
- ./gradlew :deployment:windows-installer:doZip
- mkdir artifacts_windows
#- copy .\deployment\windows-installer\build\SVWS-Server-Installer-win.zip .\artifacts_windows\
- copy .\deployment\windows-installer\build\output\win64-installer* .\artifacts_windows\
artifacts:
paths:
- artifacts_windows/
when: on_success

integration-tests:
dependencies:
- build
stage: integration-tests
script: ./gradlew --build-cache testing:integrationTest --stacktrace -Penvironment=testing -PMDB_PASSWORD=$MDB_PASSWORD -PMariaDB_ROOT_PASSWORD=$MariaDB_ROOT_PASSWORD -PMariaDB_PASSWORD=$MariaDB_PASSWORD -PSVWS_TLS_KEYSTORE_PASSWORD=$SVWS_TLS_KEYSTORE_PASSWORD -PMariaDB_USER=$MariaDB_USER
script:
- chmod +x ./deployment/setupVersion.sh
- ./deployment/setupVersion.sh
- ./gradlew --build-cache testing:integrationTest --stacktrace -Penvironment=testing -PMDB_PASSWORD=$MDB_PASSWORD -PMariaDB_ROOT_PASSWORD=$MariaDB_ROOT_PASSWORD -PMariaDB_PASSWORD=$MariaDB_PASSWORD -PSVWS_TLS_KEYSTORE_PASSWORD=$SVWS_TLS_KEYSTORE_PASSWORD -PMariaDB_USER=$MariaDB_USER
cache:
<<: *global_cache
policy: pull
Expand Down Expand Up @@ -92,6 +137,7 @@ build:
- "./**/build/**"
expire_in: "1 days"


sonarqube_analysis:
stage: analyze
only:
Expand Down
4 changes: 2 additions & 2 deletions deployment/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ githubRelease {
repo "SVWS-Server"
tagName "v${project.version}"
targetCommitish "dev"
releaseName "v${project.version}"
releaseName "Release v${project.version}"
generateReleaseNotes false
body "v${project.version}"
draft true
prerelease true
releaseAssets "./linux-installer/build/distributions/install-${project.version}.sh", "./linux-installer/build/distributions/linux-installer-${project.version}.tar.gz"
releaseAssets "/builds/svws/SVWS-Server/artifacts_linux/distributions/install-${project.version}.sh", "/builds/svws/SVWS-Server/artifacts_linux/distributions/linux-installer-${project.version}.tar.gz", "/builds/svws/SVWS-Server/artifacts_windows/win64-installer-${project.version}.exe"
allowUploadToExisting.set true
overwrite true
dryRun false
Expand Down
12 changes: 12 additions & 0 deletions deployment/setupVersion.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
if ($env:CI_COMMIT_TAG -ne $null) {
# Update version in buildconfig.json
$version = $env:CI_COMMIT_TAG -replace '^v'
$jsonContent = Get-Content -Raw -Path "buildconfig.json" | ConvertFrom-Json
$jsonContent.project.version = $version
$jsonContent | ConvertTo-Json | Set-Content -Path "buildconfig.json"
}

# Display buildconfig.json
Get-Content -Path "buildconfig.json"


2 changes: 2 additions & 0 deletions deployment/windows-installer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SVWS-Installer
Repository mit dem Code zum Erstellen eines SVWS-Installers basierend auf SVWS-Artefakten aus anderen SVWS-Repositories
Loading

0 comments on commit 610ebf1

Please sign in to comment.