commit da9199f7da3062c3f41f9b18733a76beacadb37a
parent 4a8d40ab337c448837df6c5ed6b72a38e402a504
Author: parazyd <parazyd@dyne.org>
Date: Mon, 24 Jul 2017 18:32:13 +0200
safer template variables
Diffstat:
4 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/funcs.py b/funcs.py
@@ -41,14 +41,14 @@ def fill_template(pkgname, jobtype, arches=None, desc=None,
for lab in jlabels:
jlablist += ' <string>%s</string>\n' % lab
- tmpl = tmpl.replace('[PKGNAME]', pkgname)
- tmpl = tmpl.replace('[GIT_URI]', git_uri)
- tmpl = tmpl.replace('[GIT_CREDENTIALS]', vcs_credentials)
- tmpl = tmpl.replace('[DESCRIPTION]', desc)
- tmpl = tmpl.replace('[ARCHITECTURES]', archlist)
- tmpl = tmpl.replace('[LABELS]', jlablist)
- tmpl = tmpl.replace('[BUILD_ADDVAR]', buildvar)
- tmpl = tmpl.replace('[RUNSEQUENTIAL]', sequential)
+ tmpl = tmpl.replace('{{{PKGNAME}}}', pkgname)
+ tmpl = tmpl.replace('{{{GIT_URI}}}', git_uri)
+ tmpl = tmpl.replace('{{{GIT_CREDENTIALS}}}', vcs_credentials)
+ tmpl = tmpl.replace('{{{DESCRIPTION}}}', desc)
+ tmpl = tmpl.replace('{{{ARCHITECTURES}}}', archlist)
+ tmpl = tmpl.replace('{{{LABELS}}}', jlablist)
+ tmpl = tmpl.replace('{{{BUILD_ADDVAR}}}', buildvar)
+ tmpl = tmpl.replace('{{{RUNSEQUENTIAL}}}', sequential)
return tmpl
return None
diff --git a/templates/binaries-config.xml b/templates/binaries-config.xml
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<matrix-project plugin="matrix-project@1.4">
<actions/>
- <description>[DESCRIPTION]</description>
+ <description>{{{DESCRIPTION}}}</description>
<logRotator class="hudson.tasks.LogRotator">
<daysToKeep>-1</daysToKeep>
<numToKeep>5</numToKeep>
@@ -36,20 +36,20 @@
<hudson.matrix.TextAxis>
<name>architecture</name>
<values>
-[ARCHITECTURES]
+{{{ARCHITECTURES}}}
</values>
</hudson.matrix.TextAxis>
<hudson.matrix.LabelAxis>
<name>label</name>
<values>
-[LABELS]
+{{{LABELS}}}
</values>
</hudson.matrix.LabelAxis>
</axes>
<combinationFilter>(label=="all").implies(architecture=="all") && (label=="amd64").implies(architecture=="amd64") && (label=="i386").implies(architecture=="i386") && (label=="armel").implies(architecture=="armel") && (label=="armhf").implies(architecture=="armhf") && (label=="sparc64").implies(architecture=="sparc64") && (label=="s390x").implies(architecture=="s390x") && (label=="ppc64el").implies(architecture=="ppc64el") && (label=="powerpc").implies(architecture=="powerpc") && (label=="or1k").implies(architecture=="or1k") && (label=="mipsel").implies(architecture=="mipsel") && (label=="mips").implies(architecture=="mips") && (label=="m68k").implies(architecture=="m68k") && (label=="m32").implies(architecture=="m32") && (label=="ia64").implies(architecture=="ia64") && (label=="hppa").implies(architecture=="hppa") && (label=="alpha").implies(architecture=="alpha") && (label=="arm64").implies(architecture=="arm64") && (label=="sparc").implies(architecture=="sparc") && (label=="armhf_qemusys").implies(architecture=="armhf") && (label=="arm64_qemusys").implies(architecture=="arm64") && (label=="armel_qemusys").implies(architecture=="armel")</combinationFilter>
<builders>
<hudson.plugins.copyartifact.CopyArtifact plugin="copyartifact@1.34">
- <project>[PKGNAME]-source</project>
+ <project>{{{PKGNAME}}}-source</project>
<parameters>codename=$codename</parameters>
<filter>*</filter>
<target></target>
@@ -72,7 +72,7 @@ if [ "$codename" = "experimental" ] ; then
else
export distribution=$codename
fi
-[BUILD_ADDVAR]
+{{{BUILD_ADDVAR}}}
export FORCE_BINARY_ONLY=$label
/usr/bin/build-and-provide-package
# when using subversion:
@@ -113,7 +113,7 @@ env</command>
<configs>
<hudson.plugins.parameterizedtrigger.CurrentBuildParameters/>
</configs>
- <projects>[PKGNAME]-repos</projects>
+ <projects>{{{PKGNAME}}}-repos</projects>
<condition>ALWAYS</condition>
<triggerWithNoParameters>false</triggerWithNoParameters>
</hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
@@ -129,6 +129,6 @@ env</command>
<hudson.plugins.timestamper.TimestamperBuildWrapper plugin="timestamper@1.5.15"/>
</buildWrappers>
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
- <runSequentially>[RUNSEQUENTIAL]</runSequentially>
+ <runSequentially>{{{RUNSEQUENTIAL}}}</runSequentially>
</executionStrategy>
</matrix-project>
diff --git a/templates/repos-config.xml b/templates/repos-config.xml
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
- <description>[DESCRIPTION]</description>
+ <description>{{{DESCRIPTION}}}</description>
<logRotator class="hudson.tasks.LogRotator">
<daysToKeep>-1</daysToKeep>
<numToKeep>3</numToKeep>
@@ -35,7 +35,7 @@
<concurrentBuild>false</concurrentBuild>
<builders>
<hudson.plugins.copyartifact.CopyArtifact plugin="copyartifact@1.34">
- <project>[PKGNAME]-binaries</project>
+ <project>{{{PKGNAME}}}-binaries</project>
<parameters>codename=$codename</parameters>
<filter>*</filter>
<target></target>
@@ -47,7 +47,7 @@
<doNotFingerprintArtifacts>false</doNotFingerprintArtifacts>
</hudson.plugins.copyartifact.CopyArtifact>
<hudson.plugins.copyartifact.CopyArtifact plugin="copyartifact@1.34">
- <project>[PKGNAME]-source</project>
+ <project>{{{PKGNAME}}}-source</project>
<parameters>codename=$codename</parameters>
<filter>*</filter>
<target>architecture=source,label=source</target>
diff --git a/templates/source-config.xml b/templates/source-config.xml
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
- <description>[DESCRIPTION]</description>
+ <description>{{{DESCRIPTION}}}</description>
<logRotator class="hudson.tasks.LogRotator">
<daysToKeep>-1</daysToKeep>
<numToKeep>5</numToKeep>
@@ -29,8 +29,8 @@
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
- <url>[GIT_URI]</url>
- <credentialsId>[GIT_CREDENTIALS]</credentialsId>
+ <url>{{{GIT_URI}}}</url>
+ <credentialsId>{{{GIT_CREDENTIALS}}}</credentialsId>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
@@ -101,7 +101,7 @@ env</command>
<configs>
<hudson.plugins.parameterizedtrigger.CurrentBuildParameters/>
</configs>
- <projects>[PKGNAME]-binaries</projects>
+ <projects>{{{PKGNAME}}}-binaries</projects>
<condition>SUCCESS</condition>
<triggerWithNoParameters>false</triggerWithNoParameters>
</hudson.plugins.parameterizedtrigger.BuildTriggerConfig>