Skip to content

Commit 9975e05

Browse files
committed
Also capture ANNOUNCE from cygport into package metadata
TODO: Interaction with ';' delimiter used in the message format used by AppVeyor backend may need attention. Maybe we can use a null as a delimiter instead, or perhaps AppVeyor should generate JSON as well?
1 parent 2123ff0 commit 9975e05

File tree

6 files changed

+15
-4
lines changed

6 files changed

+15
-4
lines changed

analyze.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
class PackageKind:
32-
def __init__(self, kind=None, script='', depends=None, arches=None, tokens=None):
32+
def __init__(self, kind=None, script='', depends=None, arches=None, tokens=None, announce=''):
3333
if depends is None:
3434
depends = set()
3535
if arches is None:
@@ -42,6 +42,7 @@ def __init__(self, kind=None, script='', depends=None, arches=None, tokens=None)
4242
self.depends = depends
4343
self.arches = arches
4444
self.tokens = tokens
45+
self.announce = announce
4546

4647

4748
var_list = [
@@ -52,6 +53,7 @@ def __init__(self, kind=None, script='', depends=None, arches=None, tokens=None)
5253
'INHERITED',
5354
'RESTRICT',
5455
'SCALLYWAG',
56+
'ANNOUNCE',
5557
]
5658
var_values = {}
5759

@@ -224,7 +226,9 @@ def analyze(repodir, default_tokens):
224226

225227
depends.update(depends_from_inherits(inherited))
226228

227-
return PackageKind(kind='cygport', script=fn, depends=depends, arches=arches, tokens=tokens)
229+
announce = get_var('ANNOUNCE', '')
230+
231+
return PackageKind(kind='cygport', script=fn, depends=depends, arches=arches, tokens=tokens, announce=announce)
228232

229233
# if there's no cygport file, we look for a g-b-s style .sh file instead
230234
scripts = [m for m in files if re.search(r'\.sh$', m)]

carpetbag.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def update_metadata(u):
6363

6464
# sort, because it's important that 'arch' and 'artifacts' are in the same order!
6565
u.arch_list = ' '.join(sorted(u.artifacts.keys()))
66-
conn.execute("UPDATE jobs SET arches = ?, artifacts = ? WHERE id = ?", (u.arch_list, ' '.join([u.artifacts[a] for a in sorted(u.artifacts.keys())]), u.buildnumber))
66+
conn.execute("UPDATE jobs SET arches = ?, artifacts = ?, announce = ? WHERE id = ?", (u.arch_list, ' '.join([u.artifacts[a] for a in sorted(u.artifacts.keys())]), u.announce, u.buildnumber))
6767

6868
if not hasattr(u, 'status'):
6969
u.status = 'build succeeded'

gh.py

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def examine_run_artifacts(wfr_id, u):
6363
u.reference = mj['REFERENCE']
6464
u.maintainer = mj['MAINTAINER']
6565
u.tokens = mj['TOKENS']
66+
u.announce = mj['ANNOUNCE']
6667

6768
# remove tmpfile
6869
os.remove(tmpfile.name)

hook.cgi

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def hook():
6666
arch = evars['ARCH'].replace('i686', 'x86')
6767
maintainer = evars['MAINTAINER']
6868
tokens = evars['TOKENS']
69+
announce = evars['ANNOUNCE']
6970

7071
if arch != 'skip':
7172
if len(job['artifacts']):
@@ -83,6 +84,7 @@ def hook():
8384
u.reference = reference
8485
u.maintainer = maintainer
8586
u.tokens = tokens
87+
u.announce = announce
8688
u.artifacts = artifacts
8789

8890
carpetbag.update_status(u)

migrations.py

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
if 'tokens' not in cols:
2929
cursor.execute("ALTER TABLE jobs ADD COLUMN tokens TEXT NOT NULL DEFAULT ''")
3030

31+
if 'announce' not in cols:
32+
cursor.execute("ALTER TABLE jobs ADD COLUMN announce TEXT NOT NULL DEFAULT ''")
33+
3134
print(cols)
3235

3336
conn.execute("UPDATE jobs SET status = ? WHERE status = ?", ('build succeeded', 'succeeded'))

scallywag

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ args = parser.parse_args()
2222

2323
if args.inputs:
2424
args_dict = json.loads(args.inputs)
25+
logging.info('input args are %s' % (args_dict))
2526
else:
2627
args_dict = os.environ
2728

@@ -32,7 +33,6 @@ commit = args_dict['COMMIT']
3233
reference = args_dict['REFERENCE']
3334
default_tokens = args_dict.get('DEFAULT_TOKENS', '')
3435

35-
logging.info('input args are %s' % (args_dict))
3636
logging.info('package is %s' % (name))
3737

3838
# make a directory for working with the package repo
@@ -90,6 +90,7 @@ data_items = {
9090
'MAINTAINER': maintainer,
9191
'REFERENCE': reference,
9292
'TOKENS': (' '.join(package.tokens)),
93+
'ANNOUNCE': package.announce,
9394
}
9495

9596
if 'APPVEYOR' in os.environ:

0 commit comments

Comments
 (0)