This repository has been archived by the owner on May 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
decimate.cfg
69 lines (55 loc) · 3.27 KB
/
decimate.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
from __future__ import absolute_import
import glob
import os
import re
import xml.etree.ElementTree as ET
from decimate.projects import urlImport, CantRunHereException
from decimate.projects.git import GitTestConfiguration
from decimate.projects.java import JavaTestConfiguration
from decimate.projects.filespublishing import FilesPublishingTestConfiguration
from decimate.projects.statuspublishing import StatusPublishingProject, StatusPublishingTestConfiguration
from decimate.projects.otherbuilds import OtherBuildsTestConfiguration
from decimate.projects.emailnotify import EmailTestConfiguration
from decimate.status import Status
from decimate.util import processutil, tar
urlImport("https://svn-dev.int.corefiling.com/svn/devel/decimate/sharedConfigs/trunk/cfl.py", names = ["ExpiringArchiveTestConfiguration", "PublishedReleasesTestConfiguration", "TriggerHostingTestConfiguration"])
class NotLoggedInProject(StatusPublishingProject):
name = "Notloggedin JIRA Plugin"
category = "PD/Tools/JIRA"
def getTestConfigurations(self):
return [Build("Build", platform="linux2", jdk = "1.7"),
PublishedReleases("Published Releases")]
class Build(StatusPublishingTestConfiguration, GitTestConfiguration, EmailTestConfiguration, ExpiringArchiveTestConfiguration, JavaTestConfiguration, TriggerHostingTestConfiguration):
_checkoutDir = "notloggedin"
gitUrls = [{"repos":"https://github.com/CoreFiling/notloggedin-jira-plugin.git", "branch":"master", "to": _checkoutDir}]
emailAddresses = ["[email protected]"]
publishFilesBase = os.path.join(_checkoutDir, "target")
publishFiles = ["*.jar"]
triggerableBuilds = [("Notloggedin JIRA Plugin", "Published Releases")]
@staticmethod
def _findPomVersion(pomfile):
pomNamespace = "{http://maven.apache.org/POM/4.0.0}"
versionElement = ET.parse(pomfile).getroot().findall("./%sversion" % pomNamespace)
if not versionElement:
raise Exception("Can't find plugin version in %s" % pomfile)
return versionElement[0].text
def canRunHere(self, work):
if not processutil.findExecutable("mvn"):
raise CantRunHereException("Can't find 'mvn'. Install Maven")
return super(Build, self).canRunHere(work)
def runTests(self):
version = self._findPomVersion(os.path.join(self._checkoutDir, "pom.xml"))
tar.extractTar("/home/archive/apps/atlassian/atlassian-plugin-sdk-5.0.4.tar.gz")
processutil.doExec([os.path.join(os.getcwd(), "atlassian-plugin-sdk-5.0.4/bin/atlas-mvn"), "versions:set", "-DnewVersion=%s-%s" % (version, self.buildNumber)], cwd=self._checkoutDir, expectedReturnCode=0)
processutil.doExec([os.path.join(os.getcwd(), "atlassian-plugin-sdk-5.0.4/bin/atlas-mvn"), "package"], cwd=self._checkoutDir, expectedReturnCode=0)
return Status.OK
class PublishedReleases(PublishedReleasesTestConfiguration):
buildNumberProvider = "otherBuilds"
emailAddresses = ["[email protected]"]
def getVersionForTimestamp(self, timestamp):
versionRE = re.compile("notloggedin-([0-9\.]+)\.jar$")
for name in glob.glob(os.path.join(self.getPublishedDir(timestamp), "*.jar")):
m = versionRE.match(os.path.split(name)[1])
if m:
return m.group(1)
return ""