Skip to content

Commit

Permalink
Merge pull request #18 from avirshup/pushtest
Browse files Browse the repository at this point in the history
Test the '--push' flag
  • Loading branch information
avirshup authored Jun 2, 2017
2 parents 572e6f4 + d616096 commit 762a2df
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: python
python:
- '2.7'
- '3.5'
- '3.6'
- '2.7'
- '3.5'
- '3.6'
sudo: required
services:
- docker
Expand All @@ -19,3 +19,7 @@ deploy:
on:
tags: true
repo: avirshup/DockerMake
env:
global:
- secure: nErzhf1a/OX7wn7ecFtP+amy99THp0SSkm7qT6Tz4UyFyT1wTC0T/Py4N/Wv/U+azY4WArapRhszdvCMx2t8LfpfPIOCpxsPG6juRqhCpSk8lW3tYPD5+899Anwd2CPql4Sbq+BFNT67P4J9OcmQnHPXZ57lE+0CLZ5VoXJuV5OFhrPaPg/vA2AV0KbtK8tz/vZ6ElwP1sv9Yqra2tau2VfEe1SYZER/eAPQTOVLmO1iXz54cAJrVNz1nfwvGouwWeopXIKCI43IUs2q6UaWvfTOLvsx8vodEO9k520s1IbVPYUaMal5L2hkJremBSIjjGfCCRCDVZE64w8gA2Q3fgQwcUJfpycbwP9VlX+3dkQi83/WXJnawhxnXaCG0Ut7dutGfiTH8LOBSZsaS9umOW1Zk9U6Oqxgg8bSX+12tpNW3swphWxhRqMWlh8PEuKfL08FhEVew0M+++f3Hk+rzFIoH1kbNl4s9TU1P0RjNyZoAfp/Hx+/4c07RJ72eRxgq5pd+mIY5Efw5PTDWPXiXhmDtYkZ9PLNolmMMZFT8Ty/kEHjQao9fsLp4NrVtxInNz/OPkNHtj9kSkZLk60MZcCW9E+hCsMYqUO7+MDJdKh35xuqaY9AhS2MGTxs7YVfJ4fBKkMxzAwMVLxzkeT8D/ivRqfVQnT2EevQdbH8mHs=
- secure: cMay8VLpap0udyZL7xwmKQsen3W7K4fD34GaC1sG+39Kb4vXD9GoMSaGjRz3kd5pQt1TNuVSui2HA9Py0iJWadZghABHgHAdNGoVSI+cdtIDQLLE4DWGcHD/UBpLxEYHMiDdtZ8bgb4sZL5UG43ZZZhf2nQH3VCBmxGIm4h6406rtCzlj7Q4DK7riguwCplaNKUBOwf1vy337W19MDJGkAqTpKmTMXCvjko70xd4RGN+GAhB+1pWxahli+2l8UBhaUnqbGKAq/o0Fqo0UtCcDMxo/MfyBU7OY1L9+SQjZw98aeQOlIyreLmTbhASyy4lCr3VM5ta2rWdv/KYXhi0gkJn7j31jUEhxsV4W44+uX646TKuh0V+VKI6OIUicJjRHrNU1LcDti260VHoihk/A1sF0WTfJ90zRudADm5DJ6KZClBeUmNg1MXSlNDvTOVi3H1IFA7lztpioaahPgMm8NuVx1e+ojNrzHEdeI+WLyk62iAlOaghw/Uj7TY8bFhuu4ZPqMOYZFq9FgYAK2toTPKZeWS2w//9VPeOm/2ucgjavqyzLSkrURanDCV7mrMH9JMEG5mw6IN+vmHCqXz0WvK/dAkzlMFP/WAzJAfCKDO61GMeqVV5TxxaWSSCqjZS4DAD0QRECGUik/1riGv0IMk9xEzfyLUsLiyZYH7VrXg=
2 changes: 1 addition & 1 deletion dockermake/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def build_targets(args, defs, targets):
b.write_dockerfile(args.dockerfile_dir)

built.append(b.targetname)
if args.push_to_registry and not args.nobuild:
if args.push_to_registry and not args.no_build:
success, w = push(client, b.targetname)
warnings.extend(w)
if not success:
Expand Down
4 changes: 4 additions & 0 deletions test/DockerMake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
testimage:
FROM: alpine:3.6
build: |
RUN mkdir /opt && touch /opt/helloworld
18 changes: 18 additions & 0 deletions test/test_example.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import os
import uuid
import subprocess
import pytest

EXAMPLEDIR = os.path.join('../example')
THISDIR = os.path.dirname(__file__)


def test_executable_in_path():
Expand Down Expand Up @@ -33,6 +35,22 @@ def test_list():
assert len(expected) == 0


def test_push():
customtag = str(uuid.uuid1())
if 'QUAYUSER' in os.environ and 'QUAYTOKEN' in os.environ:
subprocess.check_call(['docker','login',
'-u',os.environ['QUAYUSER'],
'-p',os.environ['QUAYTOKEN'],
'quay.io'])
subprocess.check_call(['docker-make','testimage','--repo',
'quay.io/avirshup/docker-make-test-push-target:',
'--tag', customtag, '--push'],
cwd=THISDIR)

subprocess.check_call(['docker','pull',
'quay.io/avirshup/docker-make-test-push-target:testimage-%s' % customtag
])

def test_example_build():
subprocess.check_call(
"docker-make final --repo myrepo --tag mytag".split(),
Expand Down

0 comments on commit 762a2df

Please sign in to comment.