Skip to content

Commit a154b7b

Browse files
authored
Merge pull request #863 from moreati/release-v0.2.10
Release v0.2.10
2 parents 9d404e0 + d7d1279 commit a154b7b

15 files changed

+42
-187
lines changed

.ci/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
# `.ci`
33

4-
This directory contains scripts for Travis CI and (more or less) Azure
5-
Pipelines, but they will also happily run on any Debian-like machine.
4+
This directory contains scripts for Continuous Integration platforms. Currently
5+
Azure Pipelines, but they will also happily run on any Debian-like machine.
66

77
The scripts are usually split into `_install` and `_test` steps. The `_install`
88
step will damage your machine, the `_test` step will just run the tests the way

.ci/ansible_install.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@
1212
'-r tests/requirements.txt '
1313
'-r tests/ansible/requirements.txt',
1414
'pip install -q ansible=={0}'.format(ci_lib.ANSIBLE_VERSION)
15+
],
16+
[
17+
'aws ecr-public get-login-password | docker login --username AWS --password-stdin public.ecr.aws',
1518
]
1619
]
1720

18-
batches.extend(
19-
['docker pull %s' % (ci_lib.image_for_distro(distro),), 'sleep 1']
21+
batches[-1].extend([
22+
'docker pull %s' % (ci_lib.image_for_distro(distro),)
2023
for distro in ci_lib.DISTROS
21-
)
24+
])
2225

2326
ci_lib.run_batches(batches)

.ci/azure-pipelines-steps.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ steps:
3737
3838
displayName: activate venv
3939

40-
- script: .ci/spawn_reverse_shell.py
41-
displayName: "Spawn reverse shell"
42-
4340
- script: .ci/$(MODE)_install.py
4441
displayName: "Run $(MODE)_install.py"
42+
env:
43+
AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID)
44+
AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
45+
AWS_DEFAULT_REGION: $(AWS_DEFAULT_REGION)
4546

4647
- script: .ci/$(MODE)_tests.py
4748
displayName: "Run $(MODE)_tests.py"

.ci/ci_lib.py

Lines changed: 17 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,6 @@ def have_docker():
6060
# Force line buffering on stdout.
6161
sys.stdout = os.fdopen(1, 'w', 1)
6262

63-
# Force stdout FD 1 to be a pipe, so tools like pip don't spam progress bars.
64-
if 'TRAVIS_HOME' in os.environ:
65-
proc = subprocess.Popen(
66-
args=['stdbuf', '-oL', 'cat'],
67-
stdin=subprocess.PIPE
68-
)
69-
70-
os.dup2(proc.stdin.fileno(), 1)
71-
os.dup2(proc.stdin.fileno(), 2)
72-
73-
def cleanup_travis_junk(stdout=sys.stdout, stderr=sys.stderr, proc=proc):
74-
stdout.close()
75-
stderr.close()
76-
proc.terminate()
77-
78-
atexit.register(cleanup_travis_junk)
79-
80-
# -----------------
8163

8264
def _argv(s, *args):
8365
"""Interpolate a command line using *args, return an argv style list.
@@ -125,6 +107,20 @@ def combine(batch):
125107
))
126108

127109

110+
def throttle(batch, pause=1):
111+
"""
112+
Add pauses between commands in a batch
113+
114+
>>> throttle(['echo foo', 'echo bar', 'echo baz'])
115+
['echo foo', 'sleep 1', 'echo bar', 'sleep 1', 'echo baz']
116+
"""
117+
def _with_pause(batch, pause):
118+
for cmd in batch:
119+
yield cmd
120+
yield 'sleep %i' % (pause,)
121+
return list(_with_pause(batch, pause))[:-1]
122+
123+
128124
def run_batches(batches):
129125
""" Run shell commands grouped into batches, showing an execution trace.
130126
@@ -188,27 +184,9 @@ def destroy(self, rmtree=shutil.rmtree):
188184

189185

190186
class Fold(object):
191-
"""
192-
Bracket a section of stdout with travis_fold markers.
193-
194-
This allows the section to be collapsed or expanded in Travis CI web UI.
195-
196-
>>> with Fold('stage 1'):
197-
... print('Frobnicate the frobnitz')
198-
...
199-
travis_fold:start:stage 1
200-
Frobnicate the frobnitz
201-
travis_fold:end:stage 1
202-
"""
203-
def __init__(self, name):
204-
self.name = name
205-
206-
def __enter__(self):
207-
print('travis_fold:start:%s' % (self.name))
208-
209-
def __exit__(self, _1, _2, _3):
210-
print('')
211-
print('travis_fold:end:%s' % (self.name))
187+
def __init__(self, name): pass
188+
def __enter__(self): pass
189+
def __exit__(self, _1, _2, _3): pass
212190

213191

214192
os.environ.setdefault('ANSIBLE_STRATEGY',

.ci/debops_common_install.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
'pip install -qqqU debops==0.7.2 ansible==%s' % ci_lib.ANSIBLE_VERSION,
1414
],
1515
[
16+
'aws ecr-public get-login-password | docker login --username AWS --password-stdin public.ecr.aws',
1617
'docker pull %s' % (ci_lib.image_for_distro('debian'),),
1718
],
1819
])

.ci/mitogen_install.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
if ci_lib.have_docker():
1313
batches.append([
14+
'aws ecr-public get-login-password | docker login --username AWS --password-stdin public.ecr.aws',
1415
'docker pull %s' % (ci_lib.image_for_distro(ci_lib.DISTRO),),
1516
])
1617

.ci/mitogen_py24_install.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
batches = [
66
[
7+
'aws ecr-public get-login-password | docker login --username AWS --password-stdin public.ecr.aws',
78
'docker pull %s' % (ci_lib.image_for_distro(ci_lib.DISTRO),),
89
],
910
[

.ci/spawn_reverse_shell.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 95 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
# Mitogen
22

3-
<!-- [![Build Status](https://travis-ci.org/dw/mitogen.png?branch=master)](https://travis-ci.org/dw/mitogen}) -->
43
<a href="https://mitogen.networkgenomics.com/">Please see the documentation</a>.
54

65
![](https://i.imgur.com/eBM6LhJ.gif)
76

87
[![Total alerts](https://img.shields.io/lgtm/alerts/g/mitogen-hq/mitogen.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/mitogen-hq/mitogen/alerts/)
98

10-
[![Build Status](https://api.travis-ci.com/mitogen-hq/mitogen.svg?branch=master)](https://api.travis-ci.com/mitogen-hq/mitogen)
11-
12-
[![Pipelines Status](https://dev.azure.com/mitogen-hq/mitogen/_apis/build/status/mitogen-hq.mitogen?branchName=master)](https://dev.azure.com/mitogen-hq/mitogen/_build/latest?definitionId=1&branchName=master)
9+
[![Build Status](https://dev.azure.com/mitogen-hq/mitogen/_apis/build/status/mitogen-hq.mitogen?branchName=master)](https://dev.azure.com/mitogen-hq/mitogen/_build/latest?definitionId=1&branchName=master)

0 commit comments

Comments
 (0)