-
Notifications
You must be signed in to change notification settings - Fork 104
/
zproject_obs.gsl
145 lines (139 loc) · 5.66 KB
/
zproject_obs.gsl
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Generate Open Build Service recipes for project
#
# This is a code generator built using the iMatix GSL code generation
# language. See https://github.com/zeromq/gsl for details.
#
# Copyright (c) the Contributors as noted in the AUTHORS file.
# This file is part of zproject.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
register_target ("obs", "service for Open Build Service")
.macro target_obs
.if defined (project.repository)
.directory.create ('packaging/obs')
.output "packaging/obs/_service"
<services>
<service name="obs_scm">
<param name="url">$(project.repository)</param>
<param name="scm">git</param>
<!-- delete to build from latest master on each refresh -->
<param name="revision">@PARENT_TAG@</param>
<param name="versionformat">@PARENT_TAG@+git%cd</param>
<param name="versionrewrite-pattern">v(.*)</param>
<param name="versionrewrite-replacement">\1</param>
<!-- extract redhat packaging -->
<param name="exclude">.git</param>
<param name="changesgenerate">enable</param>
<param name="filename">$(string.replace (project.name, "_|-"):lower)</param>
<param name="extract">packaging/debian/$(project.name).dsc</param>
<param name="extract">packaging/redhat/$(project.name).spec</param>
</service>
<service name="tar" mode="buildtime"/>
<!-- extract debian packaging -->
<service name="extract_file" mode="buildtime">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/changelog</param>
<param name="outfilename">debian.changelog</param>
</service>
<service name="extract_file" mode="buildtime">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/compat</param>
<param name="outfilename">debian.compat</param>
</service>
<service name="extract_file" mode="buildtime">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/control</param>
<param name="outfilename">debian.control</param>
</service>
<service name="extract_file" mode="buildtime">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/copyright</param>
<param name="outfilename">debian.copyright</param>
</service>
. if project.has_main | project.has_bin
<service name="extract_file" mode="buildtime">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/$(string.replace (project.name, "_|-"):lower).install</param>
<param name="outfilename">debian.$(string.replace (project.name, "_|-"):lower).install</param>
</service>
<service name="extract_file" mode="buildtime">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/$(string.replace (project.name, "_|-"):lower).manpages</param>
<param name="outfilename">debian.$(string.replace (project.name, "_|-"):lower).manpages</param>
</service>
. endif
<service name="extract_file" mode="buildtime">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/format</param>
<param name="outfilename">debian.format</param>
</service>
. if project.exports_classes
<service name="extract_file" mode="buildtime">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/$(string.replace (project.libname, "_|-"))$(project->version.major).install</param>
<param name="outfilename">debian.$(string.replace (project.libname, "_|-"))$(project->version.major).install</param>
</service>
<service name="extract_file" mode="buildtime">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/$(string.replace (project.libname, "_|-"))-dev.install</param>
<param name="outfilename">debian.$(string.replace (project.libname, "_|-"))-dev.install</param>
</service>
<service name="extract_file" mode="buildtime">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/$(string.replace (project.libname, "_|-"))-dev.manpages</param>
<param name="outfilename">debian.$(string.replace (project.libname, "_|-"))-dev.manpages</param>
</service>
. endif
<service name="extract_file" mode="buildtime">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/rules</param>
<param name="outfilename">debian.rules</param>
</service>
<service name="set_version" mode="buildtime">
<param name="basename">$(string.replace (project.name, "_|-"):lower)</param>
</service>
<service name="recompress" mode="buildtime">
<param name="file">*.tar</param>
<param name="compression">gz</param>
</service>
</services>
.close
.directory.create ('.obs')
.if !file.exists (".obs/workflows.yml")
. echo "Generating skeleton .obs/workflows.yml configuration"
. echo "See: https://openbuildservice.org/help/manuals/obs-user-guide/cha.obs.scm_ci_workflow_integration.html"
. output ".obs/workflows.yml"
pull_request:
steps:
- branch_package:
source_project: network:messaging:zeromq:git-draft
source_package: $(project.name)
target_project: network:messaging:zeromq:ci
filters:
event: pull_request
merge:
steps:
- trigger_services:
project: network:messaging:zeromq:git-stable
package: $(project.name)
filters:
event: push
branches:
only:
- master
release:
steps:
- trigger_services:
project: network:messaging:zeromq:release-stable
package: $(project.name)
- trigger_services:
project: network:messaging:zeromq:release-draft
package: $(project.name)
filters:
event: tag_push
.close
.endif
.endif
.endmacro