3
0

Migrate to gitlab ci 7.12

This commit is contained in:
Prototik 2015-06-28 04:35:19 +07:00
parent 495e0435d5
commit 831c8733cc
3 changed files with 93 additions and 6 deletions

82
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,82 @@
Compile:
script:
- git submodule update --init --recursive
- ./gradlew clean setupCauldron jar
tags:
- test
only:
- master
- backport-1388
- backport-1370
- backport-1291
- backport-1240
Deploy:
script:
- git submodule update --init --recursive
- ./gradlew -PofficialBuild clean setupCauldron publish
type: deploy
tags:
- deploy
only:
- master
- backport-1388
- backport-1370
- backport-1291
- backport-1240
Merge master to backport-1388:
script:
- git remote set-url origin gitlab@prok.pw:Prototik/KCauldron.git
- git fetch origin
- git checkout backport-1388
- git reset --hard origin/backport-1388
- git merge origin/master
- git push origin backport-1388
type: deploy
tags:
- merge-backport
only:
- master
Merge backport-1388 to backport-1370:
script:
- git remote set-url origin gitlab@prok.pw:Prototik/KCauldron.git
- git fetch origin
- git checkout backport-1370
- git reset --hard origin/backport-1370
- git merge origin/backport-1388
- git push origin backport-1370
type: deploy
tags:
- merge-backport
only:
- backport-1388
Merge backport-1370 to backport-1291:
script:
- git remote set-url origin gitlab@prok.pw:Prototik/KCauldron.git
- git fetch origin
- git checkout backport-1291
- git reset --hard origin/backport-1291
- git merge origin/backport-1370
- git push origin backport-1291
type: deploy
tags:
- merge-backport
only:
- backport-1370
Merge backport-1291 to backport-1240:
script:
- git remote set-url origin gitlab@prok.pw:Prototik/KCauldron.git
- git fetch origin
- git checkout backport-1240
- git reset --hard origin/backport-1240
- git merge origin/backport-1291
- git push origin backport-1240
type: deploy
tags:
- merge-backport
only:
- backport-1291

View File

@ -97,7 +97,7 @@ def gitInfo(String key) {
} }
ext.mcVersion = "1.7.10" ext.mcVersion = "1.7.10"
ext.forgeVersion = "1481" ext.forgeVersion = VersionParser.parseForgeRevision(file('src/main/resources/fmlversion.properties'))
ext.revision = project.hasProperty('revision') ? project.getProperty('revision') : buildInfo('nextBuildNumber') ext.revision = project.hasProperty('revision') ? project.getProperty('revision') : buildInfo('nextBuildNumber')
version = "${mcVersion}-${forgeVersion}.${revision}" version = "${mcVersion}-${forgeVersion}.${revision}"
if (project.hasProperty('officialBuild')) println "Updated KCauldron version: ${version}" if (project.hasProperty('officialBuild')) println "Updated KCauldron version: ${version}"
@ -179,7 +179,7 @@ def generateManifest(boolean legacy = false) {
'Specification-Vendor' : 'Bukkit Team', 'Specification-Vendor' : 'Bukkit Team',
'Specification-Title' : 'Bukkit', 'Specification-Title' : 'Bukkit',
'Specification-Version' : '1.7.10-R0.1-SNAPSHOT', 'Specification-Version' : '1.7.10-R0.1-SNAPSHOT',
'Forge-Version' : VersionParser.parseForgeRevision(file('forge/src/main/java/net/minecraftforge/common/ForgeVersion.java'), file('src/main/resources/fmlversion.properties')), 'Forge-Version' : VersionParser.parseForgeVersion(file('forge/src/main/java/net/minecraftforge/common/ForgeVersion.java'), file('src/main/resources/fmlversion.properties')),
'TweakClass' : 'cpw.mods.fml.common.launcher.FMLTweaker', 'TweakClass' : 'cpw.mods.fml.common.launcher.FMLTweaker',
'Main-Class' : 'cpw.mods.fml.relauncher.ServerLaunchWrapper', 'Main-Class' : 'cpw.mods.fml.relauncher.ServerLaunchWrapper',
'Class-Path' : generateClasspath(legacy) 'Class-Path' : generateClasspath(legacy)

View File

@ -3,17 +3,22 @@ package kcauldron
import java.util.regex.Matcher import java.util.regex.Matcher
class VersionParser { class VersionParser {
public static String parseForgeRevision(File forgeFile, File propsFile) { public static String parseForgeVersion(File forgeFile, File propsFile) {
def forgeVersion = forgeFile.text def forgeVersion = forgeFile.text
def int majorVersion = v(forgeVersion =~ /.+int majorVersion\s+=\s+(\d+);/) def int majorVersion = v(forgeVersion =~ /.+int majorVersion\s+=\s+(\d+);/)
def int minorVersion = v(forgeVersion =~ /.+int minorVersion\s+=\s+(\d+);/) def int minorVersion = v(forgeVersion =~ /.+int minorVersion\s+=\s+(\d+);/)
def int revisionVersion = v(forgeVersion =~ /.+int revisionVersion\s+=\s+(\d+);/) def int revisionVersion = v(forgeVersion =~ /.+int revisionVersion\s+=\s+(\d+);/)
def props = new Properties(); def int buildVersion = parseForgeRevision propsFile
propsFile.withInputStream { props.load(it) }
def int buildVersion = props['fmlbuild.build.number'] as int
return "${majorVersion}.${minorVersion}.${revisionVersion}.${buildVersion}" return "${majorVersion}.${minorVersion}.${revisionVersion}.${buildVersion}"
} }
def static int parseForgeRevision(File propsFile) {
def props = new Properties();
propsFile.withInputStream { props.load(it) }
props['fmlbuild.build.number'] as int
}
static int v(Matcher matcher) { static int v(Matcher matcher) {
matcher.find() matcher.find()
matcher.group(1) as int matcher.group(1) as int