-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodebuddies.config.xml
More file actions
57 lines (55 loc) · 2.37 KB
/
codebuddies.config.xml
File metadata and controls
57 lines (55 loc) · 2.37 KB
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
<?xml version='1.1' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties>
<hudson.model.ParametersDefinitionProperty>
<parameterDefinitions>
<hudson.model.StringParameterDefinition>
<name>PR</name>
<description></description>
<defaultValue></defaultValue>
<trim>false</trim>
</hudson.model.StringParameterDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
</properties>
<scm class="hudson.scm.NullSCM"/>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers/>
<concurrentBuild>false</concurrentBuild>
<builders>
<hudson.tasks.Shell>
<command>cat > Dockerfile << EOF
FROM codebuddiesdotorg/codebuddies:PR_$PR
EOF
hasTag=$(curl https://hub.docker.com/v2/repositories/codebuddiesdotorg/codebuddies/tags/?page_size=9000 | jq ".results[] | select(.name == \"PR_$PR\")")
if [ -z "$hasTag" ]; then echo "There is no corresponding Docker Image for that PR."; exit 1; fi
now --token $NOW_TOKEN --name codebuddies-$PR -e MONGO_URL=@mongo_url -e METEOR_SETTINGS=@meteor_settings -e ROOT_URL=https://codebuddies-$PR.now.sh --public
URL=$(now ls --token $NOW_TOKEN | grep $PR)
RESULT=$(echo "$URL" | sed "s/.*\(codebuddies-$PR-.*\.sh\)\s.*/\1/")
now alias --token $NOW_TOKEN $RESULT codebuddies-$PR
</command>
</hudson.tasks.Shell>
</builders>
<publishers/>
<buildWrappers>
<hudson.plugins.ws__cleanup.PreBuildCleanup plugin="ws-cleanup@0.34">
<deleteDirs>false</deleteDirs>
<cleanupParameter></cleanupParameter>
<externalDelete></externalDelete>
</hudson.plugins.ws__cleanup.PreBuildCleanup>
<org.jenkinsci.plugins.credentialsbinding.impl.SecretBuildWrapper plugin="credentials-binding@1.16">
<bindings>
<org.jenkinsci.plugins.credentialsbinding.impl.StringBinding>
<credentialsId>NOW_TOKEN</credentialsId>
<variable>NOW_TOKEN</variable>
</org.jenkinsci.plugins.credentialsbinding.impl.StringBinding>
</bindings>
</org.jenkinsci.plugins.credentialsbinding.impl.SecretBuildWrapper>
</buildWrappers>
</project>