def rm_and_build(folder, name): shell_call('docker rm %s' % name, terminal=True) if folder == 'centos6': shell_call( 'cp packages/requirements-old-gevent docker/%s/requirements' % folder) else: shell_call('cp packages/requirements docker/%s/requirements' % folder) shell_call('docker build -t %s docker/%s' % (name, folder), terminal=True) shell_call('rm docker/%s/requirements' % folder)
def rebuild(folder, name): if folder == 'centos6': shell_call( 'cat packages/*/requirements-old-gevent >> docker/%s/requirements' % folder) else: shell_call('cat packages/*/requirements >> docker/%s/requirements' % folder) shell_call('docker build -t %s docker/%s' % (name, folder), terminal=True) shell_call('rm docker/%s/requirements' % folder)
def rebuild(folder, name, build_args): add_build_args = '' if len(build_args) > 0: for build_arg in build_args: add_build_args += (' --build-arg %s' % build_arg) if folder == 'centos6': shell_call( 'cat packages/*/requirements-old-gevent.txt >> docker/%s/requirements.txt' % folder) else: shell_call( 'cat packages/*/requirements.txt >> docker/%s/requirements.txt' % folder) if folder == 'ubuntu1604-controller': shell_call('docker build -t %s -f docker/%s/Dockerfile .' % (name, folder), terminal=True) else: shell_call('docker build %s -t %s docker/%s' % (add_build_args, name, folder), terminal=True) shell_call('rm docker/%s/requirements.txt' % folder)
type='string', help='OS from %s. Default is %s' % (supported_os, supported_os[0]), default=supported_os[0], ), Option('--all', action='store_true', dest='all', help='Runs all agent images! Watch for CPU!', default=False), ) parser = OptionParser(usage, option_list=option_list) (options, args) = parser.parse_args() if __name__ == '__main__': shell_call('find . -name "*.pyc" -type f -delete') if options.drop: shell_call('docker stop $(docker ps -a -q)') shell_call('docker rm $(docker ps -a -q)') if options.all: shell_call('docker-compose -f docker/agents.yml stop', terminal=True) if options.rebuild: for osname in supported_os: rm_and_build('%s' % osname, 'amplify-agent-%s' % osname) runcmd = 'docker-compose -f docker/agents.yml up' else: shell_call('docker-compose -f docker/%s.yml stop' % options.os,
def rm_and_build(folder, name): shell_call('docker rm %s' % name, terminal=True) shell_call('docker build -t %s docker/%s' % (name, folder), terminal=True)
dest='vanilla', help='Run plain Ubuntu', default=False, ), ) parser = OptionParser(usage, option_list=option_list) (options, args) = parser.parse_args() if __name__ == '__main__': if options.plus: yml, image, path = 'docker/test-plus.yml', 'amplify-agent-test-plus', 'docker/test-plus' elif options.vanilla: yml, image, path = 'docker/test-vanilla.yml', 'amplify-agent-test-vanilla', 'docker/test-vanilla' else: yml, image, path = 'docker/test.yml', 'amplify-agent-test', 'docker/test' shell_call('find . -name "*.pyc" -type f -delete', terminal=True) shell_call('cat packages/*/requirements.txt >> %s/requirements.txt' % path) shell_call('cp -pf %s/.dockerignore .' % path) shell_call('docker build -t %s -f %s/Dockerfile .' % (image, path), terminal=True) shell_call('rm %s/requirements.txt' % path) shell_call('rm .dockerignore') rows, columns = os.popen('stty size', 'r').read().split() color_print("\n= RUN TESTS =" + "=" * (int(columns) - 13)) color_print("py.test test/", color="yellow") color_print("=" * int(columns) + "\n") shell_call('docker-compose -f %s run test bash' % yml, terminal=True)
__maintainer__ = "Mike Belov" __email__ = "*****@*****.**" usage = "usage: %prog -h" option_list = (Option( '--plus', action='store_true', dest='plus', help='Run with nginx+ (false by default)', default=False, ), ) parser = OptionParser(usage, option_list=option_list) (options, args) = parser.parse_args() if __name__ == '__main__': if options.plus: yml, image, path = 'docker/test-plus.yml', 'amplify-agent-test-plus', 'docker/test-plus' else: yml, image, path = 'docker/test.yml', 'amplify-agent-test', 'docker/test' shell_call('find . -name "*.pyc" -type f -delete', terminal=True) shell_call('docker build -t %s %s' % (image, path), terminal=True) rows, columns = os.popen('stty size', 'r').read().split() color_print("\n= RUN TESTS =" + "=" * (int(columns) - 13)) color_print("py.test test/", color="yellow") color_print("=" * int(columns) + "\n") shell_call('docker-compose -f %s run test bash' % yml, terminal=True)
#!/usr/bin/python # -*- coding: utf-8 -*- from builders.util import shell_call __author__ = "Mike Belov" __copyright__ = "Copyright (C) 2015, Nginx Inc. All rights reserved." __credits__ = ["Mike Belov", "Andrei Belov", "Ivan Poluyanov", "Oleg Mamontov", "Andrew Alexeev"] __license__ = "" __maintainer__ = "Mike Belov" __email__ = "*****@*****.**" if __name__ == '__main__': shell_call('find . -name "*.pyc" -type f -delete', terminal=True) shell_call('docker build -t amplify-agent-test docker/test', terminal=True) shell_call('docker-compose -f docker/test.yml run test bash', terminal=True)
usage = "usage: %prog -h" option_list = (Option( '--plus', action='store_true', dest='plus', help='Run with nginx+ (false by default)', default=False, ), ) parser = OptionParser(usage, option_list=option_list) (options, args) = parser.parse_args() if __name__ == '__main__': if options.plus: yml, image, path = 'docker/test-plus.yml', 'amplify-agent-test-plus', 'docker/test-plus' else: yml, image, path = 'docker/test.yml', 'amplify-agent-test', 'docker/test' shell_call('find . -name "*.pyc" -type f -delete', terminal=True) shell_call('cp packages/requirements %s/requirements' % path) shell_call('docker build -t %s %s' % (image, path), terminal=True) shell_call('rm %s/requirements' % path) rows, columns = os.popen('stty size', 'r').read().split() color_print("\n= RUN TESTS =" + "=" * (int(columns) - 13)) color_print("py.test test/", color="yellow") color_print("=" * int(columns) + "\n") shell_call('docker-compose -f %s run test bash' % yml, terminal=True)
#!/usr/bin/python # -*- coding: utf-8 -*- import os from builders import deb, rpm, amazon from builders.util import shell_call __author__ = "Mike Belov" __copyright__ = "Copyright (C) Nginx, Inc. All rights reserved." __credits__ = [ "Mike Belov", "Andrei Belov", "Ivan Poluyanov", "Oleg Mamontov", "Andrew Alexeev", "Grant Hulegaard" ] __license__ = "" __maintainer__ = "Mike Belov" __email__ = "*****@*****.**" if __name__ == '__main__': if os.path.isfile('/etc/debian_version'): deb.build() elif os.path.isfile('/etc/redhat-release'): rpm.build() else: os_release = shell_call('cat /etc/os-release', important=False) if 'amazon linux ami' in os_release.lower(): amazon.build() else: print("sorry, it will be done later\n")
option_list = ( Option( '--plus', action='store_true', dest='plus', help='Run with nginx+ (false by default)', default=False, ), ) parser = OptionParser(usage, option_list=option_list) (options, args) = parser.parse_args() if __name__ == '__main__': if options.plus: yml, image, path = 'docker/test-plus.yml', 'amplify-agent-test-plus', 'docker/test-plus' else: yml, image, path = 'docker/test.yml', 'amplify-agent-test', 'docker/test' shell_call('find . -name "*.pyc" -type f -delete', terminal=True) shell_call('docker build -t %s %s' % (image, path), terminal=True) rows, columns = os.popen('stty size', 'r').read().split() color_print("\n= RUN TESTS =" + "="*(int(columns)-13)) color_print("py.test test/", color="yellow") color_print("="*int(columns)+"\n") shell_call('docker-compose -f %s run test bash' % yml, terminal=True)
#!/usr/bin/python # -*- coding: utf-8 -*- import os from builders import deb, rpm, amazon from builders.util import shell_call __author__ = "Mike Belov" __copyright__ = "Copyright (C) Nginx, Inc. All rights reserved." __credits__ = ["Mike Belov", "Andrei Belov", "Ivan Poluyanov", "Oleg Mamontov", "Andrew Alexeev", "Grant Hulegaard"] __license__ = "" __maintainer__ = "Mike Belov" __email__ = "*****@*****.**" if __name__ == '__main__': if os.path.isfile('/etc/debian_version'): deb.build() elif os.path.isfile('/etc/redhat-release'): rpm.build() else: os_release = shell_call('cat /etc/os-release', important=False) if 'amazon linux ami' in os_release.lower(): amazon.build() else: print("sorry, it will be done later\n")
def rm_and_build(folder, name): shell_call("docker rm %s" % name, terminal=True) shell_call("docker build -t %s docker/%s" % (name, folder), terminal=True)
Option( "--os", action="store", dest="os", type="string", help="OS from %s. Default is %s" % (supported_os, supported_os[0]), default=supported_os[0], ), Option("--all", action="store_true", dest="all", help="Runs all agent images! Watch for CPU!", default=False), ) parser = OptionParser(usage, option_list=option_list) (options, args) = parser.parse_args() if __name__ == "__main__": shell_call('find . -name "*.pyc" -type f -delete') if options.drop: shell_call("docker stop $(docker ps -a -q)") shell_call("docker rm $(docker ps -a -q)") if options.all: shell_call("docker-compose -f docker/agents.yml stop", terminal=True) if options.rebuild: for osname in supported_os: rm_and_build("%s" % osname, "amplify-agent-%s" % osname) runcmd = "docker-compose -f docker/agents.yml up" else: shell_call("docker-compose -f docker/%s.yml stop" % options.os, terminal=True)