Skip to content

Commit

Permalink
Merge pull request #404 from outcobra/tryout/non_normaized!branch-name
Browse files Browse the repository at this point in the history
Tryout/non normaized!branch name
  • Loading branch information
jmesserli authored Feb 7, 2021
2 parents cbc402e + a20c80e commit efe8488
Show file tree
Hide file tree
Showing 11 changed files with 208 additions and 99 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/build-backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
on:
push:
paths:
- backend/**
- VERSION
- .github/workflows/**
pull_request:
paths:
- backend/**
- VERSION
- .github/workflows/**
env:
target_version: ''
branch_name: ''
full_version: ''

jobs:
prepareEnvironment:
name: Setup build job environment
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Determine artifact version
run: echo "target_version=$(cat VERSION)" >> $GITHUB_ENV
- name: Add version to artifact tag
run: echo "target_version=${{ env.target_version }}.${{ github.run_number }}" >> $GITHUB_ENV
- name: Add buildnumber to artifact tag
run: echo ${{ env.target_version }}
- name: Determine branch suffix [remove prefix]
uses: frabert/[email protected]
id: removeRefPrefix
with:
pattern: 'refs/(\w+)/(.*)'
string: ${{ github.ref }}
replace-with: '$2'
- name: Determine branch suffix [normalize name]
uses: frabert/[email protected]
id: normalizeBranchName
with:
pattern: '[^a-zA-Z\d]'
string: ${{ steps.removeRefPrefix.outputs.replaced }}
flags: g
replace-with: '-'
- name: Determine branch suffix [write to env]
run: echo "branch_name=${{ steps.normalizeBranchName.outputs.replaced }}" >> $GITHUB_ENV
- name: Set full version [Part 1]
run: echo "full_version=${{ env.target_version }}" >> $GITHUB_ENV
- name: Set full version [Part 2]
if: ${{ env.branch_name != 'master' }}
run: echo "full_version=${{ env.target_version }}-${{env.branch_name}}" >> $GITHUB_ENV
- name: Debug env
run: echo ${{ env.full_version }}
testAndBuild:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Execute Unittests
run: gradle :backend:test
- name: Build Jar
run: gradle :backend:assemble :backend:check -x test
- name: Upload jar
uses: actions/upload-artifact@v2
with:
name: oc-server-jar
path: backend/build/libs/.jar

buildContainerImage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Checkout
- name: Build and tag Docker image
run: docker build ./backend -t diniMueter

30 changes: 30 additions & 0 deletions .github/workflows/build-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on:
push:
paths:
- frontend/**
- VERSION
- .github/workflows/**
pull_request:
paths:
- frontend/**
- VERSION
- .github/workflows/**
env:
TARGET_VERSION: ''
ARTIFACT_VERSION_TAG: ''
jobs:
prepareEnvironment:
name: Setup build job environment
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: This is going to do stuff eventually
run: cat ./VERSION
testAndBuild:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: This is going to do stuff eventually
run: echo "Hello Angular 5 my old friend"
23 changes: 14 additions & 9 deletions backend/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
buildscript {
ext {
outcobraVersion = "dini mueter"
kotlinVersion = "1.4.10"
springBootVersion = '1.5.10.RELEASE'
outstandingCobraVersion = outcobraVersion
ehcacheVersion = '3.4.0'
Expand All @@ -18,19 +20,22 @@ buildscript {
}
}
repositories {
maven { url 'https://pkg.pegnu.cloud/repository/m2/' }
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath($/org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion/$)
classpath($/org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion/$)
classpath($/gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:1.4.17/$)
classpath($/gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:2.2.4/$)
classpath($/org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion/$)
classpath($/org.ehcache:ehcache:$ehcacheVersion/$)
classpath($/javax.cache:cache-api:$javaxCacheApiVersion/$)
}
}


apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'kotlin'
Expand Down Expand Up @@ -62,13 +67,13 @@ jar {
version = outstandingCobraVersion
}

gitProperties {
dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ"
dateFormatTimeZone = "UTC+2"
gitRepositoryRoot = new File("${project.rootDir}/")
gitPropertiesDir = new File("${project.rootDir}/backend/src/main/resources")
keys = ['git.branch', 'git.commit.id', 'git.commit.id.abbrev', 'git.commit.user.name', 'git.commit.user.email', 'git.commit.message.short', 'git.commit.time']
}
//gitProperties {
// dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ"
// dateFormatTimeZone = "UTC+2"
// gitRepositoryRoot = new File("${project.rootDir}/")
// gitPropertiesDir = new File("${project.rootDir}/backend/src/main/resources")
// keys = ['git.branch', 'git.commit.id', 'git.commit.id.abbrev', 'git.commit.user.name', 'git.commit.user.email', 'git.commit.message.short', 'git.commit.time']
//}

springBoot {
buildInfo()
Expand Down
28 changes: 0 additions & 28 deletions build.gradle

This file was deleted.

21 changes: 21 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//buildscript {
// configurations {
// compile
// extra
// }
//}

plugins {
id("org.jetbrains.dokka") version "1.4.20"
}

//tasks.withType<DokkaTask>().configureEach {
//
//}
//
//dokka {
// moduleName = 'outcobra-server'
// outputFormat = 'javadoc'
// outputDirectory = "$buildDir/javadoc"
// sourceDirs = files('backend/src/main/kotlin/outcobra')
//}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Thu Oct 19 13:07:14 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
53 changes: 33 additions & 20 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
##
## Gradle start up script for UN*X
Expand Down Expand Up @@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down Expand Up @@ -66,6 +82,7 @@ esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar


# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
Expand Down Expand Up @@ -109,10 +126,11 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand All @@ -138,19 +156,19 @@ if $cygwin ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

Expand All @@ -159,14 +177,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
APP_ARGS=`save "$@"`

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
Loading

0 comments on commit efe8488

Please sign in to comment.