Skip to content

Commit a3b0410

Browse files
author
Steven Noonan
committed
travis-run-local: add architecture prefix to image
Oops, I forgot that on Travis these are running natively on the architectures in question, so the architecture prefix isn't needed there. It is locally, though. Signed-off-by: Steven Noonan <[email protected]>
1 parent cfe781c commit a3b0410

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.travis-run-local.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ def env_parse(env, arch=None):
2020
kv = { k: v for k, v in [ s.split('=') for s in kv_str ] }
2121

2222
# Ugly trick to prepare for running commands for this image
23+
try:
24+
del os.environ['IMAGE_PREFIX']
25+
except KeyError:
26+
pass
2327
os.environ.update(kv)
2428

2529
if 'IMAGE' not in kv or 'IMAGE_TAG' not in kv:
@@ -29,7 +33,9 @@ def env_parse(env, arch=None):
2933
image = '%s:%s' % (kv['IMAGE'], kv['IMAGE_TAG'])
3034

3135
if arch is not None:
32-
return docker_arch(arch) + '/' + image
36+
image_prefix = docker_arch(arch) + '/'
37+
os.environ['IMAGE_PREFIX'] = image_prefix
38+
return image_prefix + image
3339

3440
return image
3541

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
env: IMAGE=ubuntu IMAGE_TAG=rolling
3232

3333
before_install:
34-
- docker run -d --rm --cap-add SYS_PTRACE --name $CONTAINER_NAME -e LC_ALL="C" -e LANG="C" -v $(pwd):/travis -w /travis $IMAGE:$IMAGE_TAG tail -f /dev/null
34+
- docker run -d --rm --cap-add SYS_PTRACE --name $CONTAINER_NAME -e LC_ALL="C" -e LANG="C" -v $(pwd):/travis -w /travis $IMAGE_PREFIX$IMAGE:$IMAGE_TAG tail -f /dev/null
3535
- docker ps
3636
- docker exec -e TRAVIS_BUILD=1 -e IMAGE=$IMAGE -e IMAGE_TAG=$IMAGE_TAG -t $CONTAINER_NAME sh .travis/preinstall.sh
3737

0 commit comments

Comments
 (0)