Commit 5f6260b3 authored by Drahomír Karchňák's avatar Drahomír Karchňák

Changed build flow. Release and debug release is being built only on tags....

Changed build flow. Release and debug release is being built only on tags. Added Dev Debug, which is built on every single commit. All debug builds use development tablexia server. Only release build uses production server.
parent 2e5cb64a
......@@ -15,28 +15,19 @@
before_script:
- ./gradlew unlockIOSKeyChain
- git submodule update --init --recursive
stages:
- build
- unitTest
- iTest-desktop
pre-release:
stage: build
only:
- master
- devel
script:
- ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true -PTABLEXIA_HD_ASSETS=true
artifacts:
paths:
- android/build/outputs/apk/*debug*.apk
- ios/build/robovm/*debug*.ipa
- desktop/build/libs/*debug*.deb
- desktop/build/outputs/*debug*.exe
debug:
# Development build
# Runs for every commit
# Connects to development server
dev_debug:
stage: build
except:
- master
- devel
- tags
script:
- ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true
artifacts:
......@@ -47,10 +38,45 @@ debug:
- ios/build/robovm/*debug*.ipa
- ios/build/robovm/*iTest*.ipa
- desktop/build/libs/*debug*.jar
# Release debug build
# Runs only on tags
# Connects to development server
release_debug:
stage: build
only:
- tags
script:
- ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true -PTABLEXIA_HD_ASSETS=true
artifacts:
paths:
- android/build/outputs/apk/*debug*.apk
- ios/build/robovm/*debug*.ipa
- desktop/build/libs/*debug*.deb
- desktop/build/outputs/*debug*.exe
# Actual release build
# Runs only on tags
# Connects to production server
# -PTABLEXIA_RELEASE_BUILD=true - Tells Tablexia to use production server
release:
stage: build
only:
- tags
script:
- ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true -PTABLEXIA_HD_ASSETS=true -PTABLEXIA_RELEASE_BUILD=true
artifacts:
paths:
- android/build/outputs/apk/*release*.apk
- ios/build/robovm/*release*.ipa
- desktop/build/libs/*release*.deb
- desktop/build/outputs/*release*.exe
unitTest:
stage: unitTest
script:
- ./gradlew test -x prepareAssets -x prepareGraphicAssets -x prepareSoundAssets -x prepareJsonAssets -x processAssets -x runChecksum
iTest-desktop:
stage: iTest-desktop
script:
......@@ -60,16 +86,4 @@ iTest-desktop:
expire_in: 3 days
paths:
- desktop/build/libs/iTest_results/*.log
- desktop/build/libs/iTest_results/*error.png
release:
stage: build
only:
- tags
script:
- ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true -PTABLEXIA_HD_ASSETS=true
artifacts:
paths:
- android/build/outputs/apk/*release*.apk
- ios/build/robovm/*release*.ipa
- desktop/build/libs/*release*.deb
- desktop/build/outputs/*release*.exe
\ No newline at end of file
- desktop/build/libs/iTest_results/*error.png
\ No newline at end of file
......@@ -72,13 +72,13 @@ allprojects {
masterBranch = 'master'
applicationBaseId = 'cz.nic.tablexia'
tablexiaAppName = getTablexiaAppName()
assetsDebugURLPart = onMaster() ? '' : 'debug/'
assetsDebugURLPart = isReleaseBuild() ? '' : 'debug/'
assetsDownloadUrl = project.hasProperty("TABLEXIA_ASSETS_DOWNLOAD_URL") ? ("${TABLEXIA_ASSETS_DOWNLOAD_URL}/${assetsDebugURLPart}") : "<NO_URL_CONFIGURED>/"
assetsUploadURL = (project.hasProperty("TABLEXIA_ASSETS_UPLOAD_USER") && project.hasProperty("TABLEXIA_ASSETS_UPLOAD_URL")) ? "${TABLEXIA_ASSETS_UPLOAD_USER}@${TABLEXIA_ASSETS_UPLOAD_URL}/${assetsDebugURLPart}" : "<NO_URL_CONFIGURED>/"
serverFallbackHost = "<NO_SERVER_HOST>"
serverHost = onMaster() ? getPropertyValueOrFallbackValue("TABLEXIA_SERVER_HOST_PRODUCTION", serverFallbackHost) : getPropertyValueOrFallbackValue("TABLEXIA_SERVER_HOST_DEBUG", serverFallbackHost)
serverSecretFallback = "";
serverSecret = onMaster() ? getPropertyValueOrFallbackValue("TABLEXIA_SERVER_SECRET_PRODUCTION", serverSecretFallback) : getPropertyValueOrFallbackValue("TABLEXIA_SERVER_SECRET_DEBUG", serverSecretFallback);
serverHost = isReleaseBuild() ? getPropertyValueOrFallbackValue("TABLEXIA_SERVER_HOST_PRODUCTION", serverFallbackHost) : getPropertyValueOrFallbackValue("TABLEXIA_SERVER_HOST_DEBUG", serverFallbackHost)
serverSecretFallback = ""
serverSecret = isReleaseBuild() ? getPropertyValueOrFallbackValue("TABLEXIA_SERVER_SECRET_PRODUCTION", serverSecretFallback) : getPropertyValueOrFallbackValue("TABLEXIA_SERVER_SECRET_DEBUG", serverSecretFallback);
tablexiaVersionName = getVersionNameFromGit(TABLEXIA_GIT_PATH)
tablexiaVersionCode = getVersionCodeFromGit(TABLEXIA_GIT_PATH)
tablexiaModelVersionName = getVersionNameFromGit(MODEL_GIT_PATH)
......@@ -94,7 +94,7 @@ allprojects {
//Fallback value if sentry DSN is not defined (gradle parameter SENTRY_DSN_DEBUG or SENTRY_DSN_RELEASE)
sentryDSNFallbackValue = "None"
sentryDSN = onMaster() ? getPropertyValueOrFallbackValue("TABLEXIA_SENTRY_DSN_RELEASE", sentryDSNFallbackValue) : getPropertyValueOrFallbackValue("TABLEXIA_SENTRY_DSN_DEBUG", sentryDSNFallbackValue)
sentryDSN = isReleaseBuild() ? getPropertyValueOrFallbackValue("TABLEXIA_SENTRY_DSN_RELEASE", sentryDSNFallbackValue) : getPropertyValueOrFallbackValue("TABLEXIA_SENTRY_DSN_DEBUG", sentryDSNFallbackValue)
gdxVersion = '1.9.6'
gdxUtilsVersion = '0.13.2'
......@@ -495,7 +495,7 @@ def getPropertyValueOrFallbackValue(String key, String fallbackValue) {
}
def getTablexiaAppName() {
if (onMaster()) {
if (isReleaseBuild()) {
return "${project.appName}"
} else {
return "${project.appName} (${getBranchNameFromGit()})"
......@@ -503,7 +503,7 @@ def getTablexiaAppName() {
}
def getTablexiaAppId() {
if (onMaster()) {
if (isReleaseBuild()) {
return ""
} else {
return ".${getBranchNameFromGit().trim().replaceAll('-', '').replaceAll('\\.', '').toLowerCase()}"
......@@ -522,7 +522,7 @@ def getVersionNameFromGit(String relativePath) {
String result = stdout.toString().trim();
// for non release branches add number of commits and branch name
if (!onMaster()) {
if (!isReleaseBuild()) {
stdout = new ByteArrayOutputStream()
exec {
workingDir relativePath
......@@ -559,8 +559,8 @@ def getBranchNameFromGit() {
return branchString.contains("/") ? branchString.substring(branchString.lastIndexOf("/") + 1) : branchString
}
boolean onMaster() {
return project.masterBranch.equals(getBranchNameFromGit());
boolean isReleaseBuild() {
return project.hasProperty('TABLEXIA_RELEASE_BUILD') && project.property('TABLEXIA_RELEASE_BUILD').asBoolean()
}
def getMapConvertedToString(Map map) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment