2017-06-14 16:28:39 +03:00
PYTHON ?= python
2017-05-16 17:58:28 +03:00
PYTHON_VERSION = $( shell $( PYTHON) -c "from distutils.sysconfig import get_python_version; print(get_python_version())" )
SITELIB = $( shell $( PYTHON) -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())" )
2014-04-29 19:19:14 +04:00
OFFICIAL ?= no
2014-01-07 23:14:07 +04:00
PACKER ?= packer
2015-11-06 23:19:35 +03:00
PACKER_BUILD_OPTS ?= -var 'official=$(OFFICIAL)' -var 'aw_repo_url=$(AW_REPO_URL)'
2015-02-09 22:29:48 +03:00
NODE ?= node
2015-09-11 02:03:41 +03:00
NPM_BIN ?= npm
2015-09-04 21:08:35 +03:00
DEPS_SCRIPT ?= packaging/bundle/deps.py
2015-11-06 23:19:35 +03:00
GIT_BRANCH ?= $( shell git rev-parse --abbrev-ref HEAD)
2016-08-25 18:57:31 +03:00
GCLOUD_AUTH ?= $( shell gcloud auth print-access-token)
# NOTE: This defaults the container image version to the branch that's active
2016-12-06 21:32:33 +03:00
COMPOSE_TAG ?= $( GIT_BRANCH)
2013-06-24 21:03:33 +04:00
2016-09-08 20:37:53 +03:00
COMPOSE_HOST ?= $( shell hostname)
2016-08-24 23:23:47 +03:00
VENV_BASE ?= /venv
2016-03-11 00:44:31 +03:00
SCL_PREFIX ?=
2016-05-09 18:35:54 +03:00
CELERY_SCHEDULE_FILE ?= /celerybeat-schedule
2016-03-09 22:33:42 +03:00
2016-07-05 18:44:27 +03:00
# Python packages to install only from source (not from binary wheels)
# Comma separated list
2017-05-09 15:41:57 +03:00
SRC_ONLY_PKGS ?= cffi,pycparser,psycopg2,twilio
2016-07-05 18:44:27 +03:00
2015-09-04 04:33:55 +03:00
# Determine appropriate shasum command
UNAME_S := $( shell uname -s)
i f e q ( $( UNAME_S ) , L i n u x )
SHASUM_BIN ?= sha256sum
e n d i f
i f e q ( $( UNAME_S ) , D a r w i n )
SHASUM_BIN ?= shasum -a 256
e n d i f
2013-06-24 21:03:33 +04:00
# Get the branch information from git
GIT_DATE := $( shell git log -n 1 --format= "%ai" )
2013-06-26 03:46:12 +04:00
DATE := $( shell date -u +%Y%m%d%H%M)
2013-06-24 21:03:33 +04:00
2017-06-23 15:48:39 +03:00
NAME ?= ansible-tower
2014-10-17 17:01:45 +04:00
VERSION = $( shell $( PYTHON) -c "from awx import __version__; print(__version__.split('-')[0])" )
GIT_REMOTE_URL = $( shell git config --get remote.origin.url)
2014-10-28 22:20:33 +03:00
BUILD = 0.git$( DATE)
i f e q ( $( OFFICIAL ) , y e s )
RELEASE ?= 1
2015-11-06 23:19:35 +03:00
AW_REPO_URL ?= http://releases.ansible.com/ansible-tower
2014-10-28 22:20:33 +03:00
e l s e
RELEASE ?= $( BUILD)
2017-01-31 18:43:20 +03:00
AW_REPO_URL ?= http://jenkins.testing.ansible.com/ansible-tower_nightlies_f8b8c5588b2505970227a7b0900ef69040ad5a00/$( GIT_BRANCH)
2014-10-28 22:20:33 +03:00
e n d i f
2014-01-28 18:58:44 +04:00
2014-02-03 22:22:58 +04:00
# Allow AMI license customization
2015-04-24 17:44:22 +03:00
AWS_INSTANCE_COUNT ?= 0
2014-01-28 18:58:44 +04:00
2015-05-26 18:03:36 +03:00
# GPG signature parameters (BETA key not yet used)
2015-09-04 04:33:55 +03:00
GPG_BIN ?= gpg
2015-05-26 18:03:36 +03:00
GPG_RELEASE = 442667A9
2015-09-10 23:26:59 +03:00
GPG_RELEASE_FILE = GPG-KEY-ansible-release
2015-05-26 18:03:36 +03:00
GPG_BETA = D7B00447
2015-09-10 23:26:59 +03:00
GPG_BETA_FILE = GPG-KEY-ansible-beta
2015-05-26 18:03:36 +03:00
2015-09-08 20:02:15 +03:00
# Determine GPG key for package signing
2015-05-26 18:03:36 +03:00
i f e q ( $( OFFICIAL ) , y e s )
GPG_KEY = $( GPG_RELEASE)
GPG_FILE = $( GPG_RELEASE_FILE)
e n d i f
2014-10-17 17:01:45 +04:00
# TAR build parameters
2015-05-26 18:03:36 +03:00
i f e q ( $( OFFICIAL ) , y e s )
2014-10-17 17:01:45 +04:00
SETUP_TAR_NAME = $( NAME) -setup-$( VERSION)
SDIST_TAR_NAME = $( NAME) -$( VERSION)
2015-05-26 18:03:36 +03:00
e l s e
2015-09-04 04:33:55 +03:00
SETUP_TAR_NAME = $( NAME) -setup-$( VERSION) -$( RELEASE)
SDIST_TAR_NAME = $( NAME) -$( VERSION) -$( RELEASE)
2013-06-24 21:03:33 +04:00
e n d i f
2017-06-30 23:21:03 +03:00
2017-06-23 15:48:39 +03:00
SDIST_COMMAND ?= sdist
2017-06-14 16:28:39 +03:00
SDIST_TAR_FILE ?= $( SDIST_TAR_NAME) .tar.gz
2017-06-30 23:21:03 +03:00
2014-10-28 22:20:33 +03:00
SETUP_TAR_FILE = $( SETUP_TAR_NAME) .tar.gz
2014-11-18 17:31:43 +03:00
SETUP_TAR_LINK = $( NAME) -setup-latest.tar.gz
2015-09-04 04:33:55 +03:00
SETUP_TAR_CHECKSUM = $( NAME) -setup-CHECKSUM
2014-10-17 17:01:45 +04:00
# DEB build parameters
DEBUILD_BIN ?= debuild
2016-10-07 12:43:33 +03:00
DEBUILD_OPTS =
2014-10-17 17:01:45 +04:00
DPUT_BIN ?= dput
2015-09-13 22:40:32 +03:00
DPUT_OPTS ?= -c .dput.cf -u
2015-09-24 23:30:27 +03:00
REPREPRO_BIN ?= reprepro
2016-04-20 17:13:26 +03:00
REPREPRO_OPTS ?= -b reprepro --export= changed
2015-09-24 23:30:27 +03:00
DEB_DIST ?=
2014-10-17 17:01:45 +04:00
i f e q ( $( OFFICIAL ) , y e s )
2015-09-08 20:02:15 +03:00
# Sign official builds
2015-09-10 23:26:59 +03:00
DEBUILD_OPTS += -k$( GPG_KEY)
2015-09-24 23:30:27 +03:00
REPREPRO_OPTS += --ask-passphrase
2014-10-17 17:01:45 +04:00
e l s e
# Do not sign development builds
DEBUILD_OPTS += -uc -us
e n d i f
DEBUILD = $( DEBUILD_BIN) $( DEBUILD_OPTS)
2015-09-13 22:40:32 +03:00
DEB_PPA ?= mini_dinstall
2015-08-26 18:49:09 +03:00
DEB_ARCH ?= amd64
2015-09-13 22:40:32 +03:00
DEB_NVR = $( NAME) _$( VERSION) -$( RELEASE) ~$( DEB_DIST)
DEB_NVRA = $( DEB_NVR) _$( DEB_ARCH)
DEB_NVRS = $( DEB_NVR) _source
DEB_TAR_NAME = $( NAME) -$( VERSION)
DEB_TAR_FILE = $( NAME) _$( VERSION) .orig.tar.gz
# pbuilder parameters
PBUILDER_CACHE_DIR = /var/cache/pbuilder
PBUILDER_BIN ?= pbuilder
PBUILDER_OPTS ?= --debootstrapopts --variant= buildd --distribution $( DEB_DIST) --architecture $( DEB_ARCH) --basetgz $( PBUILDER_CACHE_DIR) /$( DEB_DIST) -$( DEB_ARCH) -base.tgz --buildresult $( PWD) /deb-build
2014-10-17 17:01:45 +04:00
# RPM build parameters
2015-09-04 04:33:55 +03:00
MOCK_BIN ?= mock
MOCK_CFG ?=
2014-10-17 17:01:45 +04:00
RPM_SPECDIR = packaging/rpm
RPM_SPEC = $( RPM_SPECDIR) /$( NAME) .spec
2014-10-21 23:50:24 +04:00
RPM_DIST ?= $( shell rpm --eval '%{?dist}' 2>/dev/null)
2016-03-11 00:44:31 +03:00
2015-09-24 23:30:27 +03:00
# Provide a fallback value for RPM_DIST
2015-09-04 03:42:43 +03:00
i f e q ( $( RPM_DIST ) , )
2015-09-24 23:30:27 +03:00
RPM_DIST = .el6
2015-09-04 03:42:43 +03:00
e n d i f
2015-08-26 18:49:09 +03:00
RPM_ARCH ?= $( shell rpm --eval '%{_arch}' 2>/dev/null)
2015-09-24 23:30:27 +03:00
# Provide a fallback value for RPM_ARCH
2015-09-04 03:42:43 +03:00
i f e q ( $( RPM_ARCH ) , )
2015-09-24 23:30:27 +03:00
RPM_ARCH = $( shell uname -m)
2015-09-04 03:42:43 +03:00
e n d i f
2016-03-11 00:44:31 +03:00
# Software collections settings if on EL6
i f e q ( $( RPM_DIST ) , . e l 6 )
SCL_PREFIX = python27-
SCL_DEFINES = --define 'scl python27'
e l s e
SCL_PREFIX =
SCL_DEFINES =
e n d i f
RPM_NVR = $( SCL_PREFIX) $( NAME) -$( VERSION) -$( RELEASE) $( RPM_DIST)
2014-05-09 16:59:02 +04:00
2015-09-04 04:33:55 +03:00
# TAR Bundle build parameters
2015-08-31 20:16:59 +03:00
DIST = $( shell echo $( RPM_DIST) | sed -e 's|^\.\(el\)\([0-9]\).*|\1|' )
DIST_MAJOR = $( shell echo $( RPM_DIST) | sed -e 's|^\.\(el\)\([0-9]\).*|\2|' )
2015-08-31 19:01:15 +03:00
DIST_FULL = $( DIST) $( DIST_MAJOR)
2015-09-05 15:39:32 +03:00
OFFLINE_TAR_NAME = $( NAME) -setup-bundle-$( VERSION) -$( RELEASE) .$( DIST_FULL)
2015-08-31 19:01:15 +03:00
OFFLINE_TAR_FILE = $( OFFLINE_TAR_NAME) .tar.gz
2015-09-05 15:39:32 +03:00
OFFLINE_TAR_LINK = $( NAME) -setup-bundle-latest.$( DIST_FULL) .tar.gz
OFFLINE_TAR_CHECKSUM = $( NAME) -setup-bundle-CHECKSUM
2015-08-20 17:25:34 +03:00
2015-09-13 22:40:32 +03:00
# Detect underlying OS distribution
DISTRO ?=
i f n e q ( , $( wildcard /etc /lsb -release ) )
DISTRO = $( shell . /etc/lsb-release && echo $$ { DISTRIB_ID} | tr '[:upper:]' '[:lower:]' )
e n d i f
i f n e q ( , $( wildcard /etc /os -release ) )
DISTRO = $( shell . /etc/os-release && echo $$ { ID} )
e n d i f
i f n e q ( , $( wildcard /etc /fedora -release ) )
DISTRO = fedora
e n d i f
i f n e q ( , $( wildcard /etc /centos -release ) )
DISTRO = centos
e n d i f
i f n e q ( , $( wildcard /etc /redhat -release ) )
DISTRO = redhat
e n d i f
# Adjust `setup.py install` parameters based on OS distribution
SETUP_INSTALL_ARGS = --skip-build --no-compile --root= $( DESTDIR) -v
2015-08-26 23:15:07 +03:00
i f e q ( $( DISTRO ) , u b u n t u )
2015-09-13 22:40:32 +03:00
SETUP_INSTALL_ARGS += --install-layout= deb
2015-08-26 23:15:07 +03:00
e n d i f
2017-07-17 04:08:04 +03:00
I18N_FLAG_FILE = .i18n_built
2016-09-28 19:38:37 +03:00
# UI flag files
UI_DEPS_FLAG_FILE = awx/ui/.deps_built
UI_RELEASE_FLAG_FILE = awx/ui/.release_built
2015-08-26 23:15:07 +03:00
.DEFAULT_GOAL := build
2016-08-19 23:28:09 +03:00
.PHONY : clean clean -tmp clean -venv rebase push requirements requirements_dev \
2016-02-02 22:50:42 +03:00
develop refresh adduser migrate dbchange dbshell runserver celeryd \
2017-03-13 19:57:47 +03:00
receiver test test_unit test_ansible test_coverage coverage_html \
test_jenkins dev_build release_build release_clean sdist rpmtar mock-rpm \
mock-srpm rpm-sign deb deb-src debian debsign pbuilder \
reprepro setup_tarball virtualbox-ovf virtualbox-centos-7 \
virtualbox-centos-6 clean-bundle setup_bundle_tarball \
2016-10-26 23:51:39 +03:00
ui-docker-machine ui-docker ui-release ui-devel \
2016-10-19 19:35:59 +03:00
ui-test ui-deps ui-test-ci ui-test-saucelabs jlaska
2014-10-28 22:20:33 +03:00
# Remove setup build files
clean-tar :
rm -rf tar-build
2013-06-20 23:53:10 +04:00
2014-10-23 00:41:24 +04:00
# Remove rpm build files
clean-rpm :
rm -rf rpm-build
# Remove debian build files
clean-deb :
rm -rf deb-build reprepro
2015-04-24 17:44:22 +03:00
# Remove packer artifacts
clean-packer :
rm -rf packer_cache
rm -rf packaging/packer/packer_cache
rm -rf packaging/packer/output-virtualbox-iso/
2015-08-14 03:20:33 +03:00
rm -rf packaging/packer/output-vmware-iso
2015-04-24 17:44:22 +03:00
rm -f packaging/packer/ansible-tower-*.box
rm -rf packaging/packer/ansible-tower*-ova
2015-08-14 03:20:33 +03:00
rm -rf packaging/packer/ansible-tower*-vmx
2015-04-24 17:44:22 +03:00
rm -f Vagrantfile
2015-09-04 04:33:55 +03:00
clean-bundle :
rm -rf setup-bundle-build
2015-08-11 23:04:36 +03:00
2015-12-05 00:05:21 +03:00
# remove ui build artifacts
clean-ui :
rm -rf awx/ui/static/
Refactor UI Build System (#3203)
* initial build trial, clean up awx/ui
* fix hardcoded refs to ng-toast, add jshint preloader
* remove browserify test
* update grunt-jshint -> jshint module loader, browser-sync, update dev targets to build-docker-machine & build-docker-cid, fix blocking tasks
* less autoprefixer
* sample build commands
* fix release build
* update README
* karma config stub
* webpack config for karma tests
* karma preview for shane
* fix build-docker-machine target
* karma+webpack test pipeline configuration, stub tests
* fix smart/job status icons classes
* fix jquery + jsyaml shims, fix LESS cascade
* fix angular-codemirror dependency, explicitly import style/mode dependencies
* shim jsonlint
* fix angular-scheduler AMD imports, remove jquuery-ui shim, fix release config
* use closed $.fn.datepicker for system-tracking
* remove packaging/node/
* remove old tests
* shrinkwrap fragile dependency sandcastle, update README, lint
* first pass at fixing rrule shim
* update makefile targets
* update gitignore w/ new flag file
* add saucelabs karma config
* add license controller test
* add examples of service and directive tests
* Makefile flubs
* consolidate clean-ui target, compulsively update flag file location
* dep on CJS/AMD/UMD compatible version of rrule lib, fix example tests/config for demo
* boilerplate karma config for saucelabs (should be abstracted to common config after proven to work)
* update docs
* docs feedback
* update Dockerfile with Node 6.x dep
2016-08-17 23:09:54 +03:00
rm -rf awx/ui/node_modules/
2017-03-10 02:53:42 +03:00
rm -rf awx/ui/coverage/
2017-05-15 18:01:07 +03:00
rm -rf awx/ui/client/languages/
2016-09-28 19:38:37 +03:00
rm -f $( UI_DEPS_FLAG_FILE)
rm -f $( UI_RELEASE_FLAG_FILE)
2015-12-05 00:05:21 +03:00
2016-04-20 20:49:18 +03:00
clean-tmp :
rm -rf tmp/
2016-08-19 23:28:09 +03:00
clean-venv :
rm -rf venv/
2017-03-29 17:57:34 +03:00
clean-dist :
rm -rf dist
2014-10-23 00:41:24 +04:00
# Remove temporary build files, compiled Python files.
2017-03-29 17:57:34 +03:00
clean : clean -rpm clean -deb clean -ui clean -tar clean -packer clean -bundle clean -dist
2016-10-27 17:17:37 +03:00
rm -rf awx/public
2015-08-10 18:02:51 +03:00
rm -rf awx/lib/site-packages
2016-11-11 22:39:23 +03:00
rm -rf awx/job_status
2016-11-23 16:55:55 +03:00
rm -rf awx/job_output
2016-11-11 22:39:23 +03:00
rm -rf reports
rm -f awx/awx_test.sqlite3
2017-03-29 18:10:05 +03:00
rm -rf requirements/vendor
2015-10-05 22:24:43 +03:00
rm -rf tmp
2017-07-17 04:08:04 +03:00
rm -rf $( I18N_FLAG_FILE)
2015-10-05 22:24:43 +03:00
mkdir tmp
2014-10-23 00:41:24 +04:00
rm -rf build $( NAME) -$( VERSION) *.egg-info
2013-03-13 21:09:36 +04:00
find . -type f -regex " .*\.py[co] $$ " -delete
2016-11-11 22:39:23 +03:00
find . -type d -name "__pycache__" -delete
2013-03-13 21:09:36 +04:00
2015-09-24 23:30:27 +03:00
# convenience target to assert environment variables are defined
guard-% :
2016-11-02 20:46:49 +03:00
@if [ " $$ { $* } " = "" ] ; then \
2015-09-24 23:30:27 +03:00
echo " The required environment variable ' $* ' is not set " ; \
exit 1; \
fi
2013-06-20 23:53:10 +04:00
# Fetch from origin, rebase local commits on top of origin commits.
2013-03-13 23:28:30 +04:00
rebase :
git pull --rebase origin master
2013-06-20 23:53:10 +04:00
# Push changes to origin.
2013-03-14 00:06:19 +04:00
push :
2013-06-20 23:53:10 +04:00
git push origin master
2013-03-13 23:15:35 +04:00
2016-04-18 19:36:15 +03:00
virtualenv : virtualenv_ansible virtualenv_tower
virtualenv_ansible :
2016-03-09 22:33:42 +03:00
if [ " $( VENV_BASE) " ] ; then \
if [ ! -d " $( VENV_BASE) " ] ; then \
mkdir $( VENV_BASE) ; \
fi ; \
if [ ! -d " $( VENV_BASE) /ansible " ] ; then \
2017-05-11 21:26:52 +03:00
virtualenv --system-site-packages $( VENV_BASE) /ansible && \
$( VENV_BASE) /ansible/bin/pip install $( PIP_OPTIONS) --ignore-installed six packaging appdirs && \
Dependency Updates
* Dynamic Inventory Source
Template against ansible 2.3 dynamic inventory sources.
The major change is removal of `rax.py`. Most upstream scripts except
`foreman.py` has quite trivial coding style changes, or minor functional
extensions that does not affect Tower inventory update runs.
`foreman.py`, on the other hand, went through quite a major refactoring,
but functionalities stay the same.
Major python dependency updates include apache-libcloud (1.3.0 -->
2.0.0), boto (2.45.0 --> 2.46.1) and shade (1.19.0 --> 1.20.0). Minor
python dependency updates include indirect updates via `pip-compile`,
which are determined by base dependencies.
Some minor `task.py` extensions:
- `.ini` file for ec2 has one more field `stack_filter=False`, which
reveals changes in `ec2.py`.
- `.ini` file for cloudforms will catch these four options from
`source_vars_dict` of inventory update: `'version', 'purge_actions',
'clean_group_keys', 'nest_tags'`. These four options have always been
available in `cloudforms.py` but `cloudforms.ini.example` has not
mentioned them until the latest version. For consistency with upstream
docs, we should make these fields available for tower user to customize.
- YAML file of openstack will catch ansible options `use_hostnames`,
`expand_hostvars` and `fail_on_errors` from `source_vars_dict` of
inventory update as a response to issue #6075.
* Remove Rackspace support
Supports of Rackspace as both a dynamic inventory source and a cloud
credential are fully removed. Data migrations have been added to support
arbitrary credential types feature and delete rackspace inventory
sources.
Note also requirement `jsonschema` has been moved from
`requirements.txt` to `requirements.in` as a primary dependency to
reflect it's usage in `/main/fields.py`.
Connected issue: #6080.
* `pexpect` major update
`pexpect` stands at the very core of our task system and underwent a
major update from 3.1 to 4.2.1. Although verified during devel, please
still be mindful of any suspicious issues on celery side even after this
PR gets merged.
* Miscellaneous
- requests now explicitly declared in `requirements.in` at version 2.11.1
in response to upstream issue
- celery: 3.1.17 -> 3.1.25
- django-extensions: 1.7.4 -> 1.7.8
- django-polymorphic: 0.7.2 -> 1.2
- django-split-settings: 0.2.2 -> 0.2.5
- django-taggit: 0.21.3 -> 0.22.1
- irc: 15.0.4 -> 15.1.1
- pygerduty: 0.35.1 -> 0.35.2
- pyOpenSSL: 16.2.0 -> 17.0.0
- python-saml: 2.2.0 -> 2.2.1
- redbaron: 0.6.2 -> 0.6.3
- slackclient: 1.0.2 -> 1.0.5
- tacacs_plus: 0.1 -> 0.2
- xmltodict: 0.10.2 -> 0.11.0
- pip: 8.1.2 -> 9.0.1
- setuptools: 23.0.0 -> 35.0.2
- (requirements_ansible.in only)kombu: 3.0.35 -> 3.0.37
2017-04-20 23:47:53 +03:00
$( VENV_BASE) /ansible/bin/pip install $( PIP_OPTIONS) --ignore-installed setuptools = = 35.0.2 && \
$( VENV_BASE) /ansible/bin/pip install $( PIP_OPTIONS) --ignore-installed pip = = 9.0.1; \
2016-03-09 22:33:42 +03:00
fi ; \
2016-01-29 17:03:03 +03:00
fi
2013-06-20 23:53:10 +04:00
2016-04-18 19:36:15 +03:00
virtualenv_tower :
if [ " $( VENV_BASE) " ] ; then \
if [ ! -d " $( VENV_BASE) " ] ; then \
mkdir $( VENV_BASE) ; \
fi ; \
if [ ! -d " $( VENV_BASE) /tower " ] ; then \
2017-05-11 21:26:52 +03:00
virtualenv --system-site-packages $( VENV_BASE) /tower && \
$( VENV_BASE) /tower/bin/pip install $( PIP_OPTIONS) --ignore-installed six packaging appdirs && \
Dependency Updates
* Dynamic Inventory Source
Template against ansible 2.3 dynamic inventory sources.
The major change is removal of `rax.py`. Most upstream scripts except
`foreman.py` has quite trivial coding style changes, or minor functional
extensions that does not affect Tower inventory update runs.
`foreman.py`, on the other hand, went through quite a major refactoring,
but functionalities stay the same.
Major python dependency updates include apache-libcloud (1.3.0 -->
2.0.0), boto (2.45.0 --> 2.46.1) and shade (1.19.0 --> 1.20.0). Minor
python dependency updates include indirect updates via `pip-compile`,
which are determined by base dependencies.
Some minor `task.py` extensions:
- `.ini` file for ec2 has one more field `stack_filter=False`, which
reveals changes in `ec2.py`.
- `.ini` file for cloudforms will catch these four options from
`source_vars_dict` of inventory update: `'version', 'purge_actions',
'clean_group_keys', 'nest_tags'`. These four options have always been
available in `cloudforms.py` but `cloudforms.ini.example` has not
mentioned them until the latest version. For consistency with upstream
docs, we should make these fields available for tower user to customize.
- YAML file of openstack will catch ansible options `use_hostnames`,
`expand_hostvars` and `fail_on_errors` from `source_vars_dict` of
inventory update as a response to issue #6075.
* Remove Rackspace support
Supports of Rackspace as both a dynamic inventory source and a cloud
credential are fully removed. Data migrations have been added to support
arbitrary credential types feature and delete rackspace inventory
sources.
Note also requirement `jsonschema` has been moved from
`requirements.txt` to `requirements.in` as a primary dependency to
reflect it's usage in `/main/fields.py`.
Connected issue: #6080.
* `pexpect` major update
`pexpect` stands at the very core of our task system and underwent a
major update from 3.1 to 4.2.1. Although verified during devel, please
still be mindful of any suspicious issues on celery side even after this
PR gets merged.
* Miscellaneous
- requests now explicitly declared in `requirements.in` at version 2.11.1
in response to upstream issue
- celery: 3.1.17 -> 3.1.25
- django-extensions: 1.7.4 -> 1.7.8
- django-polymorphic: 0.7.2 -> 1.2
- django-split-settings: 0.2.2 -> 0.2.5
- django-taggit: 0.21.3 -> 0.22.1
- irc: 15.0.4 -> 15.1.1
- pygerduty: 0.35.1 -> 0.35.2
- pyOpenSSL: 16.2.0 -> 17.0.0
- python-saml: 2.2.0 -> 2.2.1
- redbaron: 0.6.2 -> 0.6.3
- slackclient: 1.0.2 -> 1.0.5
- tacacs_plus: 0.1 -> 0.2
- xmltodict: 0.10.2 -> 0.11.0
- pip: 8.1.2 -> 9.0.1
- setuptools: 23.0.0 -> 35.0.2
- (requirements_ansible.in only)kombu: 3.0.35 -> 3.0.37
2017-04-20 23:47:53 +03:00
$( VENV_BASE) /tower/bin/pip install $( PIP_OPTIONS) --ignore-installed setuptools = = 35.0.2 && \
$( VENV_BASE) /tower/bin/pip install $( PIP_OPTIONS) --ignore-installed pip = = 9.0.1; \
2016-04-18 19:36:15 +03:00
fi ; \
fi
requirements_ansible : virtualenv_ansible
2017-03-29 18:08:03 +03:00
if [ [ " $( PIP_OPTIONS) " = = *"--no-index" * ] ] ; then \
cat requirements/requirements_ansible.txt requirements/requirements_ansible_local.txt | $( VENV_BASE) /ansible/bin/pip install $( PIP_OPTIONS) --ignore-installed -r /dev/stdin ; \
else \
2017-03-30 20:08:48 +03:00
cat requirements/requirements_ansible.txt requirements/requirements_ansible_git.txt | $( VENV_BASE) /ansible/bin/pip install $( PIP_OPTIONS) --no-binary $( SRC_ONLY_PKGS) --ignore-installed -r /dev/stdin ; \
2017-03-29 18:08:03 +03:00
fi
2017-03-14 00:40:32 +03:00
$( VENV_BASE) /ansible/bin/pip uninstall --yes -r requirements/requirements_ansible_uninstall.txt
2013-06-20 23:53:10 +04:00
2017-03-13 19:57:47 +03:00
requirements_ansible_dev :
if [ " $( VENV_BASE) " ] ; then \
2017-04-18 19:31:05 +03:00
$( VENV_BASE) /ansible/bin/pip install pytest mock; \
2017-03-13 19:57:47 +03:00
fi
2017-06-14 18:47:30 +03:00
requirements_isolated :
2017-06-19 18:15:16 +03:00
if [ ! -d " $( VENV_BASE) /tower " ] ; then \
virtualenv --system-site-packages $( VENV_BASE) /tower && \
$( VENV_BASE) /tower/bin/pip install $( PIP_OPTIONS) --ignore-installed six packaging appdirs && \
$( VENV_BASE) /tower/bin/pip install $( PIP_OPTIONS) --ignore-installed setuptools = = 35.0.2 && \
$( VENV_BASE) /tower/bin/pip install $( PIP_OPTIONS) --ignore-installed pip = = 9.0.1; \
2017-06-14 18:47:30 +03:00
fi ;
2017-06-19 18:15:16 +03:00
$( VENV_BASE) /tower/bin/pip install -r requirements/requirements_isolated.txt
2017-06-14 18:47:30 +03:00
2016-03-09 22:33:42 +03:00
# Install third-party requirements needed for Tower's environment.
2016-04-18 19:36:15 +03:00
requirements_tower : virtualenv_tower
2017-03-29 18:08:03 +03:00
if [ [ " $( PIP_OPTIONS) " = = *"--no-index" * ] ] ; then \
cat requirements/requirements.txt requirements/requirements_local.txt | $( VENV_BASE) /tower/bin/pip install $( PIP_OPTIONS) --ignore-installed -r /dev/stdin ; \
else \
2017-03-30 20:08:48 +03:00
cat requirements/requirements.txt requirements/requirements_git.txt | $( VENV_BASE) /tower/bin/pip install $( PIP_OPTIONS) --no-binary $( SRC_ONLY_PKGS) --ignore-installed -r /dev/stdin ; \
2017-03-29 18:08:03 +03:00
fi
2017-03-14 00:40:32 +03:00
$( VENV_BASE) /tower/bin/pip uninstall --yes -r requirements/requirements_tower_uninstall.txt
2016-03-09 22:33:42 +03:00
2016-03-25 20:10:47 +03:00
requirements_tower_dev :
2017-03-14 00:40:32 +03:00
$( VENV_BASE) /tower/bin/pip install -r requirements/requirements_dev.txt
$( VENV_BASE) /tower/bin/pip uninstall --yes -r requirements/requirements_dev_uninstall.txt
2013-06-20 23:53:10 +04:00
2016-04-18 19:36:15 +03:00
requirements : requirements_ansible requirements_tower
2016-03-25 20:10:47 +03:00
2017-03-13 19:57:47 +03:00
requirements_dev : requirements requirements_tower_dev requirements_ansible_dev
2016-03-25 20:10:47 +03:00
2016-12-14 18:30:28 +03:00
requirements_test : requirements
2016-04-07 03:33:44 +03:00
2015-08-05 15:10:16 +03:00
# "Install" ansible-tower package in development mode.
2013-05-25 01:55:03 +04:00
develop :
2013-09-25 05:40:53 +04:00
@if [ " $( VIRTUAL_ENV) " ] ; then \
2014-01-29 22:49:29 +04:00
pip uninstall -y awx; \
2013-09-25 05:40:53 +04:00
$( PYTHON) setup.py develop; \
else \
2016-09-19 17:54:39 +03:00
pip uninstall -y awx; \
$( PYTHON) setup.py develop; \
2014-11-11 23:18:39 +03:00
fi
2015-08-05 15:10:16 +03:00
version_file :
mkdir -p /var/lib/awx/
python -c "import awx as awx; print awx.__version__" > /var/lib/awx/.tower_version
2014-11-11 23:18:39 +03:00
# Do any one-time init tasks.
init :
2016-03-09 22:33:42 +03:00
if [ " $( VENV_BASE) " ] ; then \
. $( VENV_BASE) /tower/bin/activate; \
fi ; \
2016-09-08 20:37:53 +03:00
tower-manage register_instance --hostname= $( COMPOSE_HOST) ; \
2017-04-05 17:42:47 +03:00
tower-manage register_queue --queuename= tower --hostnames= $( COMPOSE_HOST) ; \
2017-06-22 15:37:37 +03:00
if [ " $( EXTRA_GROUP_QUEUES) " = = "thepentagon" ] ; then \
2017-06-14 18:47:30 +03:00
tower-manage register_instance --hostname= isolated; \
tower-manage register_queue --queuename= 'thepentagon' --hostnames= isolated --controller= tower; \
2017-06-27 01:07:59 +03:00
tower-manage generate_isolated_key | ssh -o "StrictHostKeyChecking no" root@isolated 'cat > /root/.ssh/authorized_keys' ; \
2017-06-22 15:37:37 +03:00
elif [ " $( EXTRA_GROUP_QUEUES) " != "" ] ; then \
tower-manage register_queue --queuename= $( EXTRA_GROUP_QUEUES) --hostnames= $( COMPOSE_HOST) ; \
2017-06-14 18:47:30 +03:00
fi ;
2013-05-25 01:55:03 +04:00
2013-06-20 23:53:10 +04:00
# Refresh development environment after pulling new code.
2015-08-05 15:10:16 +03:00
refresh : clean requirements_dev version_file develop migrate
2013-05-22 01:39:34 +04:00
2013-06-20 23:53:10 +04:00
# Create Django superuser.
2013-03-14 01:20:50 +04:00
adduser :
2016-04-13 18:18:30 +03:00
tower-manage createsuperuser
2013-03-14 01:20:50 +04:00
2013-06-20 23:53:10 +04:00
# Create database tables and apply any new migrations.
2016-02-02 22:50:42 +03:00
migrate :
2016-03-09 22:33:42 +03:00
if [ " $( VENV_BASE) " ] ; then \
. $( VENV_BASE) /tower/bin/activate; \
fi ; \
2016-04-13 18:18:30 +03:00
tower-manage migrate --noinput --fake-initial
2013-03-13 23:15:35 +04:00
2013-06-20 23:53:10 +04:00
# Run after making changes to the models to create a new migration.
dbchange :
2016-04-13 18:18:30 +03:00
tower-manage makemigrations
2013-06-20 23:53:10 +04:00
2013-06-23 21:21:02 +04:00
# access database shell, asks for password
2013-03-13 23:15:35 +04:00
dbshell :
2013-12-21 03:16:52 +04:00
sudo -u postgres psql -d awx-dev
2013-03-01 04:52:14 +04:00
2014-05-02 23:26:05 +04:00
server_noattach :
2016-10-14 19:04:30 +03:00
tmux new-session -d -s tower 'exec make uwsgi'
2014-03-19 21:51:48 +04:00
tmux rename-window 'Tower'
tmux select -window -t tower:0
tmux split-window -v 'exec make celeryd'
2016-10-14 19:04:30 +03:00
tmux new-window 'exec make daphne'
2015-04-23 20:34:56 +03:00
tmux select -window -t tower:1
2016-10-14 19:04:30 +03:00
tmux rename-window 'WebSockets'
tmux split-window -h 'exec make runworker'
2017-04-26 17:39:44 +03:00
tmux split-window -v 'exec make nginx'
2016-10-14 19:04:30 +03:00
tmux new-window 'exec make receiver'
tmux select -window -t tower:2
2015-04-23 20:34:56 +03:00
tmux rename-window 'Extra Services'
2017-04-26 17:39:44 +03:00
tmux select -window -t tower:0
2014-05-02 23:26:05 +04:00
server : server_noattach
2014-03-19 21:51:48 +04:00
tmux -2 attach-session -t tower
2015-02-13 18:30:01 +03:00
# Use with iterm2's native tmux protocol support
2015-02-10 20:34:52 +03:00
servercc : server_noattach
tmux -2 -CC attach-session -t tower
2017-02-13 00:13:15 +03:00
supervisor :
@if [ " $( VENV_BASE) " ] ; then \
. $( VENV_BASE) /tower/bin/activate; \
fi ; \
supervisord --configuration /supervisor.conf --pidfile= /tmp/supervisor_pid
2015-08-04 22:26:27 +03:00
# Alternate approach to tmux to run all development tasks specified in
# Procfile. https://youtu.be/OPMgaibszjk
honcho :
2016-03-09 22:33:42 +03:00
@if [ " $( VENV_BASE) " ] ; then \
. $( VENV_BASE) /tower/bin/activate; \
fi ; \
2017-06-14 18:47:30 +03:00
honcho start -f tools/docker-compose/Procfile
2015-08-04 22:26:27 +03:00
2016-09-09 22:18:18 +03:00
flower :
@if [ " $( VENV_BASE) " ] ; then \
. $( VENV_BASE) /tower/bin/activate; \
fi ; \
$( PYTHON) manage.py celery flower --address= 0.0.0.0 --port= 5555 --broker= amqp://guest:guest@$( RABBITMQ_HOST) :5672//
2016-10-18 19:15:01 +03:00
collectstatic :
2016-10-14 08:43:14 +03:00
@if [ " $( VENV_BASE) " ] ; then \
. $( VENV_BASE) /tower/bin/activate; \
fi ; \
2016-10-18 19:58:11 +03:00
mkdir -p awx/public/static && $( PYTHON) manage.py collectstatic --clear --noinput > /dev/null 2>& 1
2016-10-18 19:15:01 +03:00
uwsgi : collectstatic
@if [ " $( VENV_BASE) " ] ; then \
. $( VENV_BASE) /tower/bin/activate; \
fi ; \
2017-06-22 06:58:59 +03:00
uwsgi -b 32768 --socket 127.0.0.1:8050 --module= awx.wsgi:application --home= /venv/tower --chdir= /tower_devel/ --vacuum --processes= 5 --harakiri= 120 --master --no-orphans --py-autoreload 1 --max-requests= 1000 --stats /tmp/stats.socket --master-fifo= /awxfifo --lazy-apps --logformat "%(addr) %(method) %(uri) - %(proto) %(status)"
2016-10-14 08:43:14 +03:00
daphne :
@if [ " $( VENV_BASE) " ] ; then \
. $( VENV_BASE) /tower/bin/activate; \
fi ; \
2017-04-11 17:55:20 +03:00
daphne -b 127.0.0.1 -p 8051 awx.asgi:channel_layer
2016-10-14 08:43:14 +03:00
runworker :
@if [ " $( VENV_BASE) " ] ; then \
. $( VENV_BASE) /tower/bin/activate; \
fi ; \
$( PYTHON) manage.py runworker --only-channels websocket.*
2013-06-20 23:53:10 +04:00
# Run the built-in development webserver (by default on http://localhost:8013).
runserver :
2016-03-09 22:33:42 +03:00
@if [ " $( VENV_BASE) " ] ; then \
. $( VENV_BASE) /tower/bin/activate; \
fi ; \
2013-09-25 05:40:53 +04:00
$( PYTHON) manage.py runserver
2013-06-20 23:53:10 +04:00
# Run to start the background celery worker for development.
celeryd :
2016-03-09 22:33:42 +03:00
@if [ " $( VENV_BASE) " ] ; then \
. $( VENV_BASE) /tower/bin/activate; \
fi ; \
2017-06-14 18:47:30 +03:00
$( PYTHON) manage.py celeryd -l DEBUG -B -Ofair --autoreload --autoscale= 100,4 --schedule= $( CELERY_SCHEDULE_FILE) -Q tower_scheduler,tower_broadcast_all,tower,$( COMPOSE_HOST) ,$( EXTRA_GROUP_QUEUES) -n celery@$( COMPOSE_HOST)
2016-09-09 22:18:18 +03:00
#$(PYTHON) manage.py celery multi show projects jobs default -l DEBUG -Q:projects projects -Q:jobs jobs -Q:default default -c:projects 1 -c:jobs 3 -c:default 3 -Ofair -B --schedule=$(CELERY_SCHEDULE_FILE)
2013-06-20 23:53:10 +04:00
2014-02-19 00:16:39 +04:00
# Run to start the zeromq callback receiver
receiver :
2016-03-09 22:33:42 +03:00
@if [ " $( VENV_BASE) " ] ; then \
. $( VENV_BASE) /tower/bin/activate; \
fi ; \
2014-02-19 00:16:39 +04:00
$( PYTHON) manage.py run_callback_receiver
2014-04-16 23:26:52 +04:00
socketservice :
2016-03-09 22:33:42 +03:00
@if [ " $( VENV_BASE) " ] ; then \
. $( VENV_BASE) /tower/bin/activate; \
fi ; \
2014-04-16 23:26:52 +04:00
$( PYTHON) manage.py run_socketio_service
2016-10-18 21:19:18 +03:00
nginx :
nginx -g "daemon off;"
2017-05-09 21:08:59 +03:00
rdb :
$( PYTHON) tools/rdb.py
2015-05-20 22:26:44 +03:00
reports :
mkdir -p $@
2014-04-23 21:55:09 +04:00
2015-05-20 22:26:44 +03:00
pep8 : reports
@( set -o pipefail && $@ | tee reports/$@ .report)
2014-04-23 21:55:09 +04:00
2015-05-20 22:26:44 +03:00
flake8 : reports
2016-11-15 17:33:12 +03:00
@if [ " $( VENV_BASE) " ] ; then \
. $( VENV_BASE) /tower/bin/activate; \
fi ; \
( set -o pipefail && $@ | tee reports/$@ .report)
2015-05-20 22:26:44 +03:00
pyflakes : reports
@( set -o pipefail && $@ | tee reports/$@ .report)
pylint : reports
@( set -o pipefail && $@ | reports/$@ .report)
check : flake 8 pep 8 # pyflakes pylint
2016-03-02 20:09:15 +03:00
2017-02-07 18:42:09 +03:00
TEST_DIRS ?= awx/main/tests awx/conf/tests awx/sso/tests
2013-09-25 05:40:53 +04:00
# Run all API unit tests.
2017-03-14 20:47:44 +03:00
test : test_ansible
2016-08-23 22:35:43 +03:00
@if [ " $( VENV_BASE) " ] ; then \
. $( VENV_BASE) /tower/bin/activate; \
fi ; \
2016-04-20 18:48:09 +03:00
py.test $( TEST_DIRS)
2013-05-22 01:39:34 +04:00
2016-01-27 19:38:56 +03:00
test_unit :
2016-08-23 22:35:43 +03:00
@if [ " $( VENV_BASE) " ] ; then \
. $( VENV_BASE) /tower/bin/activate; \
fi ; \
2017-02-07 18:42:09 +03:00
py.test awx/main/tests/unit awx/conf/tests/unit awx/sso/tests/unit
2016-01-27 19:38:56 +03:00
2017-03-13 19:57:47 +03:00
test_ansible :
@if [ " $( VENV_BASE) " ] ; then \
. $( VENV_BASE) /ansible/bin/activate; \
fi ; \
py.test awx/lib/tests -c awx/lib/tests/pytest.ini
2013-09-25 05:40:53 +04:00
# Run all API unit tests with coverage enabled.
2013-05-22 03:08:46 +04:00
test_coverage :
2016-08-23 22:35:43 +03:00
@if [ " $( VENV_BASE) " ] ; then \
. $( VENV_BASE) /tower/bin/activate; \
fi ; \
2016-04-20 18:48:09 +03:00
py.test --create-db --cov= awx --cov-report= xml --junitxml= ./reports/junit.xml $( TEST_DIRS)
2013-05-22 03:08:46 +04:00
2013-06-20 23:53:10 +04:00
# Output test coverage as HTML (into htmlcov directory).
2013-05-22 03:08:46 +04:00
coverage_html :
coverage html
2013-09-25 05:40:53 +04:00
# Run API unit tests across multiple Python/Django versions with Tox.
test_tox :
tox -v
# Run unit tests to produce output for Jenkins.
2016-01-28 20:01:12 +03:00
# Alias existing make target so old versions run against Jekins the same way
test_jenkins : test_coverage
2013-09-25 05:40:53 +04:00
2016-12-22 20:03:56 +03:00
# Make fake data
2017-01-03 17:09:43 +03:00
DATA_GEN_PRESET = ""
2016-12-22 20:03:56 +03:00
bulk_data :
2016-12-22 21:53:19 +03:00
@if [ " $( VENV_BASE) " ] ; then \
. $( VENV_BASE) /tower/bin/activate; \
fi ; \
2017-01-03 17:09:43 +03:00
$( PYTHON) tools/data_generators/rbac_dummy_data_generator.py --preset= $( DATA_GEN_PRESET)
2016-12-22 20:03:56 +03:00
2016-10-18 15:26:40 +03:00
# l10n TASKS
2015-07-28 22:55:00 +03:00
# --------------------------------------
2016-10-26 14:17:49 +03:00
# check for UI po files
2016-10-07 12:43:33 +03:00
HAVE_PO := $( shell ls awx/ui/po/*.po 2>/dev/null)
check-po :
i f d e f H A V E _ P O
# Should be 'Language: zh-CN' but not 'Language: zh_CN' in zh_CN.po
for po in awx/ui/po/*.po ; do \
echo $$ po; \
mo = " awx/ui/po/`basename $$ po .po`.mo " ; \
msgfmt --check --verbose $$ po -o $$ mo; \
if test " $$ ? " -ne 0 ; then \
exit -1; \
fi ; \
rm $$ mo; \
name = ` echo " $$ po " | grep '-' ` ; \
if test " x $$ name " != x ; then \
right_name = ` echo $$ language | sed -e 's/-/_/' ` ; \
echo " ERROR: WRONG $$ name CORRECTION: $$ right_name " ; \
exit -1; \
fi ; \
language = ` grep '^"Language:' " $$ po " | grep '_' ` ; \
if test " x $$ language " != x ; then \
right_language = ` echo $$ language | sed -e 's/_/-/' ` ; \
echo " ERROR: WRONG $$ language CORRECTION: $$ right_language in $$ po " ; \
exit -1; \
fi ; \
done ;
e l s e
@echo No PO files
e n d i f
2016-10-26 14:17:49 +03:00
# generate UI .pot
pot : $( UI_DEPS_FLAG_FILE )
$( NPM_BIN) --prefix awx/ui run pot
# generate django .pot .po
LANG = "en-us"
messages :
@if [ " $( VENV_BASE) " ] ; then \
. $( VENV_BASE) /tower/bin/activate; \
fi ; \
$( PYTHON) manage.py makemessages -l $( LANG) --keep-pot
2017-01-20 03:27:23 +03:00
# generate l10n .json .mo
2017-07-17 04:08:04 +03:00
languages : $( I 18N_FLAG_FILE )
$(I18N_FLAG_FILE) : $( UI_DEPS_FLAG_FILE )
2016-10-07 12:43:33 +03:00
$( NPM_BIN) --prefix awx/ui run languages
2017-01-20 03:27:23 +03:00
$( PYTHON) tools/scripts/compilemessages.py
2017-07-17 04:08:04 +03:00
touch $( I18N_FLAG_FILE)
2016-10-07 12:43:33 +03:00
2016-10-26 14:17:49 +03:00
# End l10n TASKS
# --------------------------------------
# UI TASKS
# --------------------------------------
2016-10-07 12:43:33 +03:00
2016-10-19 19:35:59 +03:00
ui-deps : $( UI_DEPS_FLAG_FILE )
2017-01-25 23:25:39 +03:00
$(UI_DEPS_FLAG_FILE) :
2016-09-22 21:19:28 +03:00
$( NPM_BIN) --unsafe-perm --prefix awx/ui install awx/ui
2016-09-28 19:38:37 +03:00
touch $( UI_DEPS_FLAG_FILE)
2015-08-27 19:29:44 +03:00
2016-09-28 19:38:37 +03:00
ui-docker-machine : $( UI_DEPS_FLAG_FILE )
2017-01-26 02:34:18 +03:00
$( NPM_BIN) --prefix awx/ui run ui-docker-machine -- $( MAKEFLAGS)
2015-07-28 22:55:00 +03:00
2016-11-09 20:49:18 +03:00
# Native docker. Builds UI and raises BrowserSync & filesystem polling.
2016-09-28 19:38:37 +03:00
ui-docker : $( UI_DEPS_FLAG_FILE )
2017-01-26 02:34:18 +03:00
$( NPM_BIN) --prefix awx/ui run ui-docker -- $( MAKEFLAGS)
2015-07-20 18:56:02 +03:00
2016-11-09 20:49:18 +03:00
# Builds UI with development UI without raising browser-sync or filesystem polling.
2016-10-26 23:51:39 +03:00
ui-devel : $( UI_DEPS_FLAG_FILE )
2016-11-09 20:49:18 +03:00
$( NPM_BIN) --prefix awx/ui run build-devel -- $( MAKEFLAGS)
2016-10-26 23:51:39 +03:00
2016-10-26 00:12:27 +03:00
ui-release : $( UI_RELEASE_FLAG_FILE )
2016-09-28 19:38:37 +03:00
2017-07-17 04:08:04 +03:00
$(UI_RELEASE_FLAG_FILE) : $( I 18N_FLAG_FILE ) $( UI_DEPS_FLAG_FILE )
Refactor UI Build System (#3203)
* initial build trial, clean up awx/ui
* fix hardcoded refs to ng-toast, add jshint preloader
* remove browserify test
* update grunt-jshint -> jshint module loader, browser-sync, update dev targets to build-docker-machine & build-docker-cid, fix blocking tasks
* less autoprefixer
* sample build commands
* fix release build
* update README
* karma config stub
* webpack config for karma tests
* karma preview for shane
* fix build-docker-machine target
* karma+webpack test pipeline configuration, stub tests
* fix smart/job status icons classes
* fix jquery + jsyaml shims, fix LESS cascade
* fix angular-codemirror dependency, explicitly import style/mode dependencies
* shim jsonlint
* fix angular-scheduler AMD imports, remove jquuery-ui shim, fix release config
* use closed $.fn.datepicker for system-tracking
* remove packaging/node/
* remove old tests
* shrinkwrap fragile dependency sandcastle, update README, lint
* first pass at fixing rrule shim
* update makefile targets
* update gitignore w/ new flag file
* add saucelabs karma config
* add license controller test
* add examples of service and directive tests
* Makefile flubs
* consolidate clean-ui target, compulsively update flag file location
* dep on CJS/AMD/UMD compatible version of rrule lib, fix example tests/config for demo
* boilerplate karma config for saucelabs (should be abstracted to common config after proven to work)
* update docs
* docs feedback
* update Dockerfile with Node 6.x dep
2016-08-17 23:09:54 +03:00
$( NPM_BIN) --prefix awx/ui run build-release
2016-09-28 19:38:37 +03:00
touch $( UI_RELEASE_FLAG_FILE)
2015-02-09 17:45:23 +03:00
2016-09-28 19:38:37 +03:00
ui-test : $( UI_DEPS_FLAG_FILE )
Refactor UI Build System (#3203)
* initial build trial, clean up awx/ui
* fix hardcoded refs to ng-toast, add jshint preloader
* remove browserify test
* update grunt-jshint -> jshint module loader, browser-sync, update dev targets to build-docker-machine & build-docker-cid, fix blocking tasks
* less autoprefixer
* sample build commands
* fix release build
* update README
* karma config stub
* webpack config for karma tests
* karma preview for shane
* fix build-docker-machine target
* karma+webpack test pipeline configuration, stub tests
* fix smart/job status icons classes
* fix jquery + jsyaml shims, fix LESS cascade
* fix angular-codemirror dependency, explicitly import style/mode dependencies
* shim jsonlint
* fix angular-scheduler AMD imports, remove jquuery-ui shim, fix release config
* use closed $.fn.datepicker for system-tracking
* remove packaging/node/
* remove old tests
* shrinkwrap fragile dependency sandcastle, update README, lint
* first pass at fixing rrule shim
* update makefile targets
* update gitignore w/ new flag file
* add saucelabs karma config
* add license controller test
* add examples of service and directive tests
* Makefile flubs
* consolidate clean-ui target, compulsively update flag file location
* dep on CJS/AMD/UMD compatible version of rrule lib, fix example tests/config for demo
* boilerplate karma config for saucelabs (should be abstracted to common config after proven to work)
* update docs
* docs feedback
* update Dockerfile with Node 6.x dep
2016-08-17 23:09:54 +03:00
$( NPM_BIN) --prefix awx/ui run test
2015-08-27 19:29:44 +03:00
2017-07-07 18:37:51 +03:00
# A standard go-to target for API developers to use building the frontend
ui : clean -ui ui -devel
2016-09-28 19:38:37 +03:00
ui-test-ci : $( UI_DEPS_FLAG_FILE )
Refactor UI Build System (#3203)
* initial build trial, clean up awx/ui
* fix hardcoded refs to ng-toast, add jshint preloader
* remove browserify test
* update grunt-jshint -> jshint module loader, browser-sync, update dev targets to build-docker-machine & build-docker-cid, fix blocking tasks
* less autoprefixer
* sample build commands
* fix release build
* update README
* karma config stub
* webpack config for karma tests
* karma preview for shane
* fix build-docker-machine target
* karma+webpack test pipeline configuration, stub tests
* fix smart/job status icons classes
* fix jquery + jsyaml shims, fix LESS cascade
* fix angular-codemirror dependency, explicitly import style/mode dependencies
* shim jsonlint
* fix angular-scheduler AMD imports, remove jquuery-ui shim, fix release config
* use closed $.fn.datepicker for system-tracking
* remove packaging/node/
* remove old tests
* shrinkwrap fragile dependency sandcastle, update README, lint
* first pass at fixing rrule shim
* update makefile targets
* update gitignore w/ new flag file
* add saucelabs karma config
* add license controller test
* add examples of service and directive tests
* Makefile flubs
* consolidate clean-ui target, compulsively update flag file location
* dep on CJS/AMD/UMD compatible version of rrule lib, fix example tests/config for demo
* boilerplate karma config for saucelabs (should be abstracted to common config after proven to work)
* update docs
* docs feedback
* update Dockerfile with Node 6.x dep
2016-08-17 23:09:54 +03:00
$( NPM_BIN) --prefix awx/ui run test:ci
2014-08-28 20:01:35 +04:00
2016-08-26 20:51:49 +03:00
testjs_ci :
echo "Update UI unittests later" #ui-test-ci
2016-08-26 20:20:12 +03:00
2017-03-10 03:06:13 +03:00
jshint : $( UI_DEPS_FLAG_FILE )
2016-11-09 17:53:58 +03:00
$( NPM_BIN) run --prefix awx/ui jshint
2016-08-26 20:20:12 +03:00
2016-09-28 19:38:37 +03:00
ui-test-saucelabs : $( UI_DEPS_FLAG_FILE )
Refactor UI Build System (#3203)
* initial build trial, clean up awx/ui
* fix hardcoded refs to ng-toast, add jshint preloader
* remove browserify test
* update grunt-jshint -> jshint module loader, browser-sync, update dev targets to build-docker-machine & build-docker-cid, fix blocking tasks
* less autoprefixer
* sample build commands
* fix release build
* update README
* karma config stub
* webpack config for karma tests
* karma preview for shane
* fix build-docker-machine target
* karma+webpack test pipeline configuration, stub tests
* fix smart/job status icons classes
* fix jquery + jsyaml shims, fix LESS cascade
* fix angular-codemirror dependency, explicitly import style/mode dependencies
* shim jsonlint
* fix angular-scheduler AMD imports, remove jquuery-ui shim, fix release config
* use closed $.fn.datepicker for system-tracking
* remove packaging/node/
* remove old tests
* shrinkwrap fragile dependency sandcastle, update README, lint
* first pass at fixing rrule shim
* update makefile targets
* update gitignore w/ new flag file
* add saucelabs karma config
* add license controller test
* add examples of service and directive tests
* Makefile flubs
* consolidate clean-ui target, compulsively update flag file location
* dep on CJS/AMD/UMD compatible version of rrule lib, fix example tests/config for demo
* boilerplate karma config for saucelabs (should be abstracted to common config after proven to work)
* update docs
* docs feedback
* update Dockerfile with Node 6.x dep
2016-08-17 23:09:54 +03:00
$( NPM_BIN) --prefix awx/ui run test:saucelabs
2013-09-25 05:40:53 +04:00
2015-07-28 22:55:00 +03:00
# END UI TASKS
# --------------------------------------
2013-06-20 23:53:10 +04:00
# Build a pip-installable package into dist/ with a timestamped version number.
2014-02-17 19:18:33 +04:00
dev_build :
2013-09-25 05:40:53 +04:00
$( PYTHON) setup.py dev_build
2013-05-22 01:39:34 +04:00
2013-06-20 23:53:10 +04:00
# Build a pip-installable package into dist/ with the release version number.
2013-05-22 01:39:34 +04:00
release_build :
2013-09-25 05:40:53 +04:00
$( PYTHON) setup.py release_build
2014-10-28 22:20:33 +03:00
# Build setup tarball
tar-build/$(SETUP_TAR_FILE) :
@mkdir -p tar-build
2016-10-12 23:07:25 +03:00
@rsync -az --exclude /test setup/ tar-build/$( SETUP_TAR_NAME)
2015-09-18 22:38:49 +03:00
@rsync -az docs/licenses tar-build/$( SETUP_TAR_NAME) /
2014-10-28 22:20:33 +03:00
@cd tar-build/$( SETUP_TAR_NAME) && sed -e 's#%NAME%#$(NAME)#;s#%VERSION%#$(VERSION)#;s#%RELEASE%#$(RELEASE)#;' group_vars/all.in > group_vars/all
2016-10-12 23:07:25 +03:00
@cd tar-build && tar -czf $( SETUP_TAR_FILE) --exclude "*/all.in" $( SETUP_TAR_NAME) /
2014-11-18 17:31:43 +03:00
@ln -sf $( SETUP_TAR_FILE) tar-build/$( SETUP_TAR_LINK)
2015-08-31 19:01:15 +03:00
2015-09-04 04:33:55 +03:00
tar-build/$(SETUP_TAR_CHECKSUM) :
@if [ " $( OFFICIAL) " != "yes" ] ; then \
2015-09-05 15:39:32 +03:00
cd tar-build && $( SHASUM_BIN) $( NAME) *.tar.gz > $( notdir $@ ) ; \
2015-09-04 04:33:55 +03:00
else \
2015-09-10 23:26:59 +03:00
cd tar-build && $( SHASUM_BIN) $( NAME) *.tar.gz | $( GPG_BIN) --clearsign --batch --passphrase " $( GPG_PASSPHRASE) " -u " $( GPG_KEY) " -o $( notdir $@ ) - ; \
2015-09-04 04:33:55 +03:00
fi
setup_tarball : tar -build /$( SETUP_TAR_FILE ) tar -build /$( SETUP_TAR_CHECKSUM )
2014-10-17 17:01:45 +04:00
@echo "#############################################"
2015-09-13 22:40:32 +03:00
@echo "Artifacts:"
2014-10-28 22:20:33 +03:00
@echo tar-build/$( SETUP_TAR_FILE)
2014-11-18 17:31:43 +03:00
@echo tar-build/$( SETUP_TAR_LINK)
2015-09-04 04:33:55 +03:00
@echo tar-build/$( SETUP_TAR_CHECKSUM)
2014-10-17 17:01:45 +04:00
@echo "#############################################"
2013-06-11 01:21:04 +04:00
release_clean :
2013-05-26 19:01:00 +04:00
-( rm *.tar)
2013-06-11 01:21:04 +04:00
-( rm -rf ( $RELEASE ) )
2013-06-15 12:10:11 +04:00
Refactor UI Build System (#3203)
* initial build trial, clean up awx/ui
* fix hardcoded refs to ng-toast, add jshint preloader
* remove browserify test
* update grunt-jshint -> jshint module loader, browser-sync, update dev targets to build-docker-machine & build-docker-cid, fix blocking tasks
* less autoprefixer
* sample build commands
* fix release build
* update README
* karma config stub
* webpack config for karma tests
* karma preview for shane
* fix build-docker-machine target
* karma+webpack test pipeline configuration, stub tests
* fix smart/job status icons classes
* fix jquery + jsyaml shims, fix LESS cascade
* fix angular-codemirror dependency, explicitly import style/mode dependencies
* shim jsonlint
* fix angular-scheduler AMD imports, remove jquuery-ui shim, fix release config
* use closed $.fn.datepicker for system-tracking
* remove packaging/node/
* remove old tests
* shrinkwrap fragile dependency sandcastle, update README, lint
* first pass at fixing rrule shim
* update makefile targets
* update gitignore w/ new flag file
* add saucelabs karma config
* add license controller test
* add examples of service and directive tests
* Makefile flubs
* consolidate clean-ui target, compulsively update flag file location
* dep on CJS/AMD/UMD compatible version of rrule lib, fix example tests/config for demo
* boilerplate karma config for saucelabs (should be abstracted to common config after proven to work)
* update docs
* docs feedback
* update Dockerfile with Node 6.x dep
2016-08-17 23:09:54 +03:00
dist/$(SDIST_TAR_FILE) : ui -release
2017-06-23 15:48:39 +03:00
BUILD = " $( BUILD) " $( PYTHON) setup.py $( SDIST_COMMAND)
2014-05-22 19:25:50 +04:00
2017-06-14 16:28:39 +03:00
dist/ansible-tower.tar.gz : ui -release
OFFICIAL = "yes" $( PYTHON) setup.py sdist
2015-09-23 23:10:40 +03:00
sdist : dist /$( SDIST_TAR_FILE )
@echo "#############################################"
@echo "Artifacts:"
@echo dist/$( SDIST_TAR_FILE)
@echo "#############################################"
2013-06-15 12:10:11 +04:00
2015-09-04 04:33:55 +03:00
# Build setup bundle tarball
setup-bundle-build :
2015-08-31 19:01:15 +03:00
mkdir -p $@
# TODO - Somehow share implementation with setup_tarball
2015-09-04 04:33:55 +03:00
setup-bundle-build/$(OFFLINE_TAR_FILE) :
2016-10-12 23:07:25 +03:00
rsync -az --exclude /test setup/ setup-bundle-build/$( OFFLINE_TAR_NAME)
2015-09-18 22:38:49 +03:00
rsync -az docs/licenses setup-bundle-build/$( OFFLINE_TAR_NAME) /
2015-09-04 04:33:55 +03:00
cd setup-bundle-build/$( OFFLINE_TAR_NAME) && sed -e 's#%NAME%#$(NAME)#;s#%VERSION%#$(VERSION)#;s#%RELEASE%#$(RELEASE)#;' group_vars/all.in > group_vars/all
$( PYTHON) $( DEPS_SCRIPT) -d $( DIST) -r $( DIST_MAJOR) -u $( AW_REPO_URL) -s setup-bundle-build/$( OFFLINE_TAR_NAME) -v -v -v
cd setup-bundle-build && tar -czf $( OFFLINE_TAR_FILE) --exclude "*/all.in" $( OFFLINE_TAR_NAME) /
ln -sf $( OFFLINE_TAR_FILE) setup-bundle-build/$( OFFLINE_TAR_LINK)
setup-bundle-build/$(OFFLINE_TAR_CHECKSUM) :
2015-09-05 04:08:49 +03:00
@if [ " $( OFFICIAL) " != "yes" ] ; then \
2015-09-10 20:40:24 +03:00
cd setup-bundle-build && $( SHASUM_BIN) $( NAME) *.tar.gz > $( notdir $@ ) ; \
2015-09-05 04:08:49 +03:00
else \
2015-09-10 23:26:59 +03:00
cd setup-bundle-build && $( SHASUM_BIN) $( NAME) *.tar.gz | $( GPG_BIN) --clearsign --batch --passphrase " $( GPG_PASSPHRASE) " -u " $( GPG_KEY) " -o $( notdir $@ ) - ; \
2015-09-05 04:08:49 +03:00
fi
2015-09-04 04:33:55 +03:00
setup_bundle_tarball : setup -bundle -build setup -bundle -build /$( OFFLINE_TAR_FILE ) setup -bundle -build /$( OFFLINE_TAR_CHECKSUM )
2015-08-31 19:01:15 +03:00
@echo "#############################################"
@echo "Offline artifacts:"
2015-09-04 04:33:55 +03:00
@echo setup-bundle-build/$( OFFLINE_TAR_FILE)
@echo setup-bundle-build/$( OFFLINE_TAR_LINK)
@echo setup-bundle-build/$( OFFLINE_TAR_CHECKSUM)
2015-08-31 19:01:15 +03:00
@echo "#############################################"
2015-08-11 23:04:36 +03:00
2015-05-26 18:03:36 +03:00
rpm-build :
2015-08-31 19:01:15 +03:00
mkdir -p $@
2015-05-26 18:03:36 +03:00
2017-03-23 05:58:11 +03:00
rpm-build/$(SDIST_TAR_FILE) : rpm -build dist /$( SDIST_TAR_FILE ) tar -build /$( SETUP_TAR_FILE )
2017-04-01 06:59:46 +03:00
ansible localhost \
-m template \
-a " src=packaging/rpm/ $( NAME) .spec.j2 dest=rpm-build/ $( NAME) .spec " \
-e tower_version = $( VERSION) \
-e tower_release = $( RELEASE)
2016-12-12 23:54:44 +03:00
cp packaging/rpm/tower.te rpm-build/
2017-01-24 09:50:34 +03:00
cp packaging/rpm/tower.fc rpm-build/
2017-06-23 15:48:39 +03:00
cp packaging/rpm/ansible-tower.sysconfig rpm-build/
2014-10-20 23:00:00 +04:00
cp packaging/remove_tower_source.py rpm-build/
2016-05-20 22:38:12 +03:00
cp packaging/bytecompile.sh rpm-build/
2017-03-23 05:58:11 +03:00
cp tar-build/$( SETUP_TAR_FILE) rpm-build/
2017-04-01 06:59:46 +03:00
2017-07-13 20:06:17 +03:00
cd rpm-build && git clone git@github.com:ansible/tower-license.git
cd rpm-build/tower-license && $( PYTHON) setup.py sdist
cp rpm-build/tower-license/dist/* rpm-build/ && rm -rf rpm-build/tower-license
2013-06-26 16:10:17 +04:00
if [ " $( OFFICIAL) " != "yes" ] ; then \
2014-10-17 17:01:45 +04:00
( cd dist/ && tar zxf $( SDIST_TAR_FILE) ) ; \
( cd dist/ && mv $( NAME) -$( VERSION) -$( BUILD) $( NAME) -$( VERSION) ) ; \
( cd dist/ && tar czf ../rpm-build/$( SDIST_TAR_FILE) $( NAME) -$( VERSION) ) ; \
ln -sf $( SDIST_TAR_FILE) rpm-build/$( NAME) -$( VERSION) .tar.gz ; \
2017-03-23 05:58:11 +03:00
( cd tar-build/ && tar zxf $( SETUP_TAR_FILE) ) ; \
( cd tar-build/ && mv $( NAME) -setup-$( VERSION) -$( BUILD) $( NAME) -setup-$( VERSION) ) ; \
( cd tar-build/ && tar czf ../rpm-build/$( SETUP_TAR_FILE) $( NAME) -setup-$( VERSION) ) ; \
ln -sf $( SETUP_TAR_FILE) rpm-build/$( NAME) -setup-$( VERSION) .tar.gz ; \
2014-10-17 17:01:45 +04:00
else \
2014-11-15 00:11:39 +03:00
cp -a dist/$( SDIST_TAR_FILE) rpm-build/ ; \
2013-06-26 16:10:17 +04:00
fi
2014-10-17 17:01:45 +04:00
2014-10-23 00:41:24 +04:00
rpmtar : sdist rpm -build /$( SDIST_TAR_FILE )
2014-10-17 17:01:45 +04:00
2017-03-29 18:09:38 +03:00
brewrpmtar : rpm -build /python -deps .tar .gz requirements /requirements_local .txt requirements /requirements_ansible_local .txt rpmtar
2017-03-14 01:07:36 +03:00
rpm-build/python-deps.tar.gz : requirements /vendor rpm -build
tar czf rpm-build/python-deps.tar.gz requirements/vendor
requirements/vendor :
2017-03-29 18:09:38 +03:00
cat requirements/requirements.txt requirements/requirements_git.txt | pip download \
2017-03-14 01:07:36 +03:00
--no-binary= :all: \
2017-03-29 18:09:38 +03:00
--requirement= /dev/stdin \
2017-03-14 01:07:36 +03:00
--dest= $@ \
--exists-action= i
2017-03-29 18:09:38 +03:00
cat requirements/requirements_ansible.txt requirements/requirements_ansible_git.txt | pip download \
2017-03-14 01:07:36 +03:00
--no-binary= :all: \
2017-03-29 18:09:38 +03:00
--requirement= /dev/stdin \
2017-03-14 01:07:36 +03:00
--dest= $@ \
--exists-action= i
pip download \
--no-binary= :all: \
--requirement= requirements/requirements_setup_requires.txt \
--dest= $@ \
--exists-action= i
2017-03-29 18:09:38 +03:00
requirements/requirements_local.txt :
@echo "This is going to take a while..."
pip download \
--requirement= requirements/requirements_git.txt \
--no-deps \
--exists-action= w \
--dest= requirements/vendor 2>/dev/null | sed -n 's/^\s*Saved\s*//p' > $@
requirements/requirements_ansible_local.txt :
pip download \
--requirement= requirements/requirements_ansible_git.txt \
--no-deps \
--exists-action= w \
--dest= requirements/vendor 2>/dev/null | sed -n 's/^\s*Saved\s*//p' > $@
2014-10-17 17:01:45 +04:00
rpm-build/$(RPM_NVR).src.rpm : /etc /mock /$( MOCK_CFG ) .cfg
2017-04-01 06:59:46 +03:00
$( MOCK_BIN) -r $( MOCK_CFG) --resultdir rpm-build --buildsrpm --spec rpm-build/$( NAME) .spec --sources rpm-build
2015-09-13 22:40:32 +03:00
mock-srpm : rpmtar rpm -build /$( RPM_NVR ) .src .rpm
2014-10-17 17:01:45 +04:00
@echo "#############################################"
2015-09-13 22:40:32 +03:00
@echo "Artifacts:"
2014-10-17 17:01:45 +04:00
@echo rpm-build/$( RPM_NVR) .src.rpm
@echo "#############################################"
2017-03-14 01:15:32 +03:00
brew-srpm : brewrpmtar mock -srpm
2015-08-26 18:49:09 +03:00
rpm-build/$(RPM_NVR).$(RPM_ARCH).rpm : rpm -build /$( RPM_NVR ) .src .rpm
2017-04-01 06:59:46 +03:00
$( MOCK_BIN) -r $( MOCK_CFG) --resultdir rpm-build --rebuild rpm-build/$( RPM_NVR) .src.rpm
2015-09-13 22:40:32 +03:00
mock-rpm : rpmtar rpm -build /$( RPM_NVR ) .$( RPM_ARCH ) .rpm
2014-10-17 17:01:45 +04:00
@echo "#############################################"
2015-09-13 22:40:32 +03:00
@echo "Artifacts:"
2015-08-26 18:49:09 +03:00
@echo rpm-build/$( RPM_NVR) .$( RPM_ARCH) .rpm
2014-10-17 17:01:45 +04:00
@echo "#############################################"
2015-06-01 22:58:07 +03:00
i f e q ( $( OFFICIAL ) , y e s )
2015-06-08 18:38:50 +03:00
rpm-build/$(GPG_FILE) : rpm -build
2015-09-10 23:26:59 +03:00
$( GPG_BIN) --export -a " ${ GPG_KEY } " > " $@ "
2015-05-26 18:03:36 +03:00
2015-08-26 18:49:09 +03:00
rpm-sign : rpm -build /$( GPG_FILE ) rpmtar rpm -build /$( RPM_NVR ) .$( RPM_ARCH ) .rpm
2017-06-19 17:59:42 +03:00
rpm --define "_signature gpg" --define " _gpg_name $( GPG_KEY) " --addsign rpm-build/*.$( RPM_ARCH) .rpm
2015-06-01 22:58:07 +03:00
e n d i f
2015-05-26 18:03:36 +03:00
2015-09-09 05:44:29 +03:00
deb-build :
mkdir -p $@
2015-09-13 22:40:32 +03:00
deb-build/$(DEB_TAR_NAME) : dist /$( SDIST_TAR_FILE )
mkdir -p $( dir $@ )
2015-09-23 23:10:40 +03:00
@if [ " $( OFFICIAL) " != "yes" ] ; then \
tar -C deb-build/ -xvf dist/$( SDIST_TAR_FILE) ; \
mv deb-build/$( SDIST_TAR_NAME) deb-build/$( DEB_TAR_NAME) ; \
cd deb-build && tar czf $( DEB_TAR_FILE) $( DEB_TAR_NAME) ; \
else \
cp -a dist/$( SDIST_TAR_FILE) deb-build/$( DEB_TAR_FILE) ; \
fi
cd deb-build && tar -xf $( DEB_TAR_FILE)
2015-09-13 22:40:32 +03:00
cp -a packaging/debian deb-build/$( DEB_TAR_NAME) /
cp packaging/remove_tower_source.py deb-build/$( DEB_TAR_NAME) /debian/
2017-07-14 01:09:11 +03:00
cd deb-build/$( DEB_TAR_NAME) /debian/ && git clone git@github.com:ansible/tower-license.git
rm -rf deb-build/$( DEB_TAR_NAME) /debian/tower-license/.git
2015-09-13 22:40:32 +03:00
sed -ie " s#^ $( NAME) (\([^)]*\)) \([^;]*\);# $( NAME) ( $( VERSION) - $( RELEASE) ~ $( DEB_DIST) ) $( DEB_DIST) ;# " deb-build/$( DEB_TAR_NAME) /debian/changelog
2014-10-17 17:01:45 +04:00
2015-09-09 05:44:29 +03:00
i f e q ( $( OFFICIAL ) , y e s )
2015-09-13 22:40:32 +03:00
debian : deb -build /$( DEB_TAR_NAME ) deb -build /$( GPG_FILE )
2015-09-09 05:44:29 +03:00
2015-09-10 23:26:59 +03:00
deb-build/$(GPG_FILE) : deb -build
$( GPG_BIN) --export -a " ${ GPG_KEY } " > " $@ "
2015-09-09 05:44:29 +03:00
e l s e
2015-09-13 22:40:32 +03:00
debian : deb -build /$( DEB_TAR_NAME )
2015-09-09 05:44:29 +03:00
e n d i f
2014-10-17 17:01:45 +04:00
2015-09-13 22:40:32 +03:00
deb-build/$(DEB_NVR).dsc : deb -build /$( DEB_TAR_NAME )
2016-08-16 20:41:23 +03:00
cd deb-build/$( DEB_TAR_NAME) && \
cp debian/control.$( DEB_DIST) debian/control && \
$( DEBUILD) -S
2015-09-13 22:40:32 +03:00
deb-src : deb -build /$( DEB_NVR ) .dsc
2014-10-17 17:01:45 +04:00
@echo "#############################################"
2015-09-13 22:40:32 +03:00
@echo "Artifacts:"
@echo deb-build/$( DEB_NVR) .dsc
@echo deb-build/$( DEB_NVRS) .changes
2014-10-17 17:01:45 +04:00
@echo "#############################################"
2015-09-13 22:40:32 +03:00
$(PBUILDER_CACHE_DIR)/$(DEB_DIST)-$(DEB_ARCH)-base.tgz :
$( PBUILDER_BIN) create $( PBUILDER_OPTS)
2014-10-17 17:01:45 +04:00
2015-09-13 22:40:32 +03:00
pbuilder : $( PBUILDER_CACHE_DIR ) /$( DEB_DIST ) -$( DEB_ARCH ) -base .tgz deb -build /$( DEB_NVRA ) .deb
deb-build/$(DEB_NVRA).deb : deb -build /$( DEB_NVR ) .dsc $( PBUILDER_CACHE_DIR ) /$( DEB_DIST ) -$( DEB_ARCH ) -base .tgz
# cd deb-build/$(DEB_TAR_NAME) && $(DEBUILD) -b
$( PBUILDER_BIN) update $( PBUILDER_OPTS)
$( PBUILDER_BIN) execute $( PBUILDER_OPTS) --save-after-exec packaging/pbuilder/setup.sh $( DEB_DIST)
$( PBUILDER_BIN) build $( PBUILDER_OPTS) deb-build/$( DEB_NVR) .dsc
2014-10-17 17:01:45 +04:00
2015-09-24 23:30:27 +03:00
deb : guard -DEB_DIST deb -build /$( DEB_NVRA ) .deb
2014-10-17 17:01:45 +04:00
@echo "#############################################"
2015-09-13 22:40:32 +03:00
@echo "Artifacts:"
@echo deb-build/$( DEB_NVRA) .deb
2014-10-17 17:01:45 +04:00
@echo "#############################################"
2015-09-13 22:40:32 +03:00
deb-upload : deb -build /$( DEB_NVRA ) .changes
$( DPUT_BIN) $( DPUT_OPTS) $( DEB_PPA) deb-build/$( DEB_NVRA) .changes
2014-10-17 17:01:45 +04:00
2015-09-13 22:40:32 +03:00
dput : deb -build /$( DEB_NVRA ) .changes
$( DPUT_BIN) $( DPUT_OPTS) $( DEB_PPA) deb-build/$( DEB_NVRA) .changes
2014-10-17 17:01:45 +04:00
2015-09-13 22:40:32 +03:00
deb-src-upload : deb -build /$( DEB_NVRS ) .changes
$( DPUT_BIN) $( DPUT_OPTS) $( DEB_PPA) deb-build/$( DEB_NVRS) .changes
2014-10-17 17:01:45 +04:00
2015-09-13 22:40:32 +03:00
debsign : deb -build /$( DEB_NVRS ) .changes debian deb -build /$( DEB_NVR ) .dsc
debsign -k$( GPG_KEY) deb-build/$( DEB_NVRS) .changes deb-build/$( DEB_NVR) .dsc
2014-10-17 17:01:45 +04:00
2015-09-13 22:40:32 +03:00
reprepro/conf :
mkdir -p $@
cp -a packaging/reprepro/* $@ /
2015-09-09 06:14:31 +03:00
if [ " $( OFFICIAL) " = "yes" ] ; then \
2015-09-24 03:33:40 +03:00
sed -i -e 's|^\(Codename:\)|SignWith: $(GPG_KEY)\n\1|' $@ /distributions ; \
2015-09-09 17:57:55 +03:00
fi
2015-09-13 22:40:32 +03:00
reprepro : deb -build /$( DEB_NVRA ) .deb reprepro /conf
2015-09-24 23:30:27 +03:00
$( REPREPRO_BIN) $( REPREPRO_OPTS) clearvanished
for COMPONENT in non-free $( VERSION) ; do \
$( REPREPRO_BIN) $( REPREPRO_OPTS) -C $$ COMPONENT remove $( DEB_DIST) $( NAME) ; \
2015-11-25 17:47:29 +03:00
$( REPREPRO_BIN) $( REPREPRO_OPTS) -C $$ COMPONENT --keepunreferencedfiles --ignore= brokenold includedeb $( DEB_DIST) deb-build/$( DEB_NVRA) .deb ; \
2015-09-13 22:40:32 +03:00
done
2013-06-23 23:40:07 +04:00
2015-10-01 19:06:01 +03:00
2015-09-09 05:44:29 +03:00
#
# Packer build targets
#
2015-04-24 17:44:22 +03:00
amazon-ebs :
cd packaging/packer && $( PACKER) build -only $@ $( PACKER_BUILD_OPTS) -var " aws_instance_count= $( AWS_INSTANCE_COUNT) " -var " product_version= $( VERSION) " packer-$( NAME) .json
2016-08-02 17:44:29 +03:00
# Vagrant box using virtualbox provider
2017-03-09 00:01:29 +03:00
vagrant-virtualbox : packaging /packer /ansible -tower -$( VERSION ) -virtualbox .box tar -build /$( SETUP_TAR_FILE )
2015-04-24 17:44:22 +03:00
packaging/packer/ansible-tower-$(VERSION)-virtualbox.box : packaging /packer /output -virtualbox -iso /centos -7.ovf
cd packaging/packer && $( PACKER) build -only virtualbox-ovf $( PACKER_BUILD_OPTS) -var " aws_instance_count= $( AWS_INSTANCE_COUNT) " -var " product_version= $( VERSION) " packer-$( NAME) .json
packaging/packer/output-virtualbox-iso/centos-7.ovf :
2015-08-14 03:20:33 +03:00
cd packaging/packer && $( PACKER) build -only virtualbox-iso packer-centos-7.json
virtualbox-iso : packaging /packer /output -virtualbox -iso /centos -7.ovf
2016-08-02 17:44:29 +03:00
# Vagrant box using VMware provider
2017-03-09 00:01:29 +03:00
vagrant-vmware : packaging /packer /ansible -tower -$( VERSION ) -vmware .box tar -build /$( SETUP_TAR_FILE )
2016-08-02 17:44:29 +03:00
2015-08-14 03:20:33 +03:00
packaging/packer/output-vmware-iso/centos-7.vmx :
cd packaging/packer && $( PACKER) build -only vmware-iso packer-centos-7.json
2016-08-02 17:44:29 +03:00
packaging/packer/ansible-tower-$(VERSION)-vmware.box : packaging /packer /output -vmware -iso /centos -7.vmx
2015-08-14 03:20:33 +03:00
cd packaging/packer && $( PACKER) build -only vmware-vmx $( PACKER_BUILD_OPTS) -var " aws_instance_count= $( AWS_INSTANCE_COUNT) " -var " product_version= $( VERSION) " packer-$( NAME) .json
2014-01-07 21:04:25 +04:00
2015-08-26 23:15:07 +03:00
# TODO - figure out how to build the front-end and python requirements with
# 'build'
build :
2016-03-11 00:44:31 +03:00
export SCL_PREFIX
2015-08-26 23:15:07 +03:00
$( PYTHON) setup.py build
2013-06-23 23:40:07 +04:00
install :
2016-03-23 22:46:00 +03:00
export SCL_PREFIX HTTPD_SCL_PREFIX
2015-08-26 23:15:07 +03:00
$( PYTHON) setup.py install $( SETUP_INSTALL_ARGS)
2015-09-10 00:16:35 +03:00
2016-08-25 18:57:31 +03:00
docker-auth :
2017-06-29 14:40:09 +03:00
docker login -u oauth2accesstoken -p " $( GCLOUD_AUTH) " https://gcr.io
2016-08-25 18:57:31 +03:00
2017-06-14 18:47:30 +03:00
# Docker isolated rampart
docker-isolated :
TAG = $( COMPOSE_TAG) docker-compose -f tools/docker-compose.yml -f tools/docker-isolated-override.yml create
docker start tools_tower_1
docker start tools_isolated_1
2017-06-12 15:43:46 +03:00
if [ "`docker exec -i -t tools_isolated_1 cat /root/.ssh/authorized_keys`" = = "`docker exec -t tools_tower_1 cat /root/.ssh/id_rsa.pub`" ] ; then \
2017-06-14 18:47:30 +03:00
echo "SSH keys already copied to isolated instance" ; \
else \
2017-06-12 15:43:46 +03:00
docker exec "tools_isolated_1" bash -c " mkdir -p /root/.ssh && rm -f /root/.ssh/authorized_keys && echo $$ (docker exec -t tools_tower_1 cat /root/.ssh/id_rsa.pub) >> /root/.ssh/authorized_keys " ; \
2017-06-14 18:47:30 +03:00
fi
TAG = $( COMPOSE_TAG) docker-compose -f tools/docker-compose.yml -f tools/docker-isolated-override.yml up
2015-09-10 00:16:35 +03:00
# Docker Compose Development environment
2016-08-25 18:57:31 +03:00
docker-compose : docker -auth
2017-06-29 22:40:09 +03:00
TAG = $( COMPOSE_TAG) docker-compose -f tools/docker-compose.yml up --no-recreate tower
2015-09-29 17:45:25 +03:00
2016-09-08 17:18:14 +03:00
docker-compose-cluster : docker -auth
2017-06-29 22:40:09 +03:00
TAG = $( COMPOSE_TAG) docker-compose -f tools/docker-compose-cluster.yml up
2016-09-08 17:18:14 +03:00
2016-08-25 18:57:31 +03:00
docker-compose-test : docker -auth
2017-06-29 22:40:09 +03:00
cd tools && TAG = $( COMPOSE_TAG) docker-compose run --rm --service-ports tower /bin/bash
2015-09-29 17:45:25 +03:00
2017-06-14 18:47:30 +03:00
docker-compose-build : tower -devel -build tower -isolated -build
tower-devel-build :
2016-08-25 18:57:31 +03:00
docker build -t ansible/tower_devel -f tools/docker-compose/Dockerfile .
docker tag ansible/tower_devel gcr.io/ansible-tower-engineering/tower_devel:$( COMPOSE_TAG)
#docker push gcr.io/ansible-tower-engineering/tower_devel:$(COMPOSE_TAG)
2017-06-14 18:47:30 +03:00
tower-isolated-build :
docker build -t ansible/tower_isolated -f tools/docker-isolated/Dockerfile .
docker tag ansible/tower_isolated gcr.io/ansible-tower-engineering/tower_isolated:$( COMPOSE_TAG)
#docker push gcr.io/ansible-tower-engineering/tower_isolated:$(COMPOSE_TAG)
2016-02-01 19:30:43 +03:00
MACHINE ?= default
2016-03-16 20:06:54 +03:00
docker-clean :
2016-02-01 19:30:43 +03:00
eval $$ ( docker-machine env $( MACHINE) )
2016-09-13 17:59:45 +03:00
$( foreach container_id,$( shell docker ps -f name = tools_tower -aq) ,docker stop $( container_id) ; docker rm -f $( container_id) ; )
2016-10-05 17:31:45 +03:00
-docker images | grep "tower_devel" | awk '{print $$1 ":" $$2}' | xargs docker rmi
2016-03-16 20:06:54 +03:00
docker-refresh : docker -clean docker -compose
2016-02-01 19:30:43 +03:00
2016-10-17 22:00:38 +03:00
# Docker Development Environment with Elastic Stack Connected
docker-compose-elk : docker -auth
2017-06-29 22:40:09 +03:00
TAG = $( COMPOSE_TAG) docker-compose -f tools/docker-compose.yml -f tools/elastic/docker-compose.logstash-link.yml -f tools/elastic/docker-compose.elastic-override.yml up --no-recreate
2016-10-17 22:00:38 +03:00
docker-compose-cluster-elk : docker -auth
2017-06-29 22:40:09 +03:00
TAG = $( COMPOSE_TAG) docker-compose -f tools/docker-compose-cluster.yml -f tools/elastic/docker-compose.logstash-link-cluster.yml -f tools/elastic/docker-compose.elastic-override.yml up --no-recreate
2016-10-17 22:00:38 +03:00
clean-elk :
docker stop tools_kibana_1
docker stop tools_logstash_1
docker stop tools_elasticsearch_1
docker rm tools_logstash_1
docker rm tools_elasticsearch_1
docker rm tools_kibana_1
2015-10-09 19:03:25 +03:00
psql-container :
2017-01-31 22:28:48 +03:00
docker run -it --net tools_default --rm postgres:9.4.1 sh -c 'exec psql -h "postgres" -p "5432" -U postgres'
2017-06-14 16:28:39 +03:00
2017-06-30 23:06:57 +03:00
# Openshift placeholders, these are good for bootstrapping a totally fresh Openshift Node but not for re-running
# So you may want to pick and choose the functionality in these targets based on what you are doing
2017-06-30 22:25:42 +03:00
openshift-production-build : dist /ansible -tower .tar .gz
docker build -t ansible/tower_web -f installer/openshift/Dockerfile .
docker build -t ansible/tower_task -f installer/openshift/Dockerfile.celery .
openshift-production-tag : openshift -production -build
docker tag ansible/tower_web:latest 172.30.1.1:5000/tower/tower_web:latest
docker tag ansible/tower_task:latest 172.30.1.1:5000/tower/tower_task:latest
openshift-image-push : openshift -production -tag
oc login -u developer && \
2017-06-30 23:06:57 +03:00
docker login -u developer -p $( shell oc whoami -t) 172.30.1.1:5000 && \
2017-06-30 22:25:42 +03:00
docker push 172.30.1.1:5000/tower/tower_web:latest && \
docker push 172.30.1.1:5000/tower/tower_task:latest
2017-06-30 23:06:57 +03:00
openshift-preconfig :
oc login -u developer || true && \
oc new-project tower || true && \
oc adm policy add-role-to-user admin developer -n tower
openshift-deploy : openshift -preconfig openshift -image -push
2017-06-30 22:25:42 +03:00
oc login -u developer && \
oc new-app --template= postgresql-persistent -e MEMORY_LIMIT = 512Mi -e NAMESPACE = openshift -e DATABASE_SERVICE_NAME = postgresql -e POSTGRESQL_USER = tower -e POSTGRESQL_PASSWORD = password123 -e POSTGRESQL_DATABASE = tower -e VOLUME_CAPACITY = 1Gi -e POSTGRESQL_VERSION = 9.5 -n tower && \
2017-06-30 23:06:57 +03:00
echo "Waiting for PG to come online" && \
sleep 15 && \
2017-06-30 22:25:42 +03:00
oc apply -f installer/openshift/config/configmap.yml && \
oc apply -f installer/openshift/config/deployment.yml
openshift-delete :
oc delete -f installer/openshift/config/deployment.yml