2019-01-03 20:49:54 +03:00
PYTHON ?= python3
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
2020-05-19 16:21:03 +03:00
CHROMIUM_BIN = /tmp/chrome-linux/chrome
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)
2017-07-18 18:16:18 +03:00
MANAGEMENT_COMMAND ?= awx-manage
2017-08-09 22:53:25 +03:00
IMAGE_REPOSITORY_AUTH ?=
IMAGE_REPOSITORY_BASE ?= https://gcr.io
2018-09-27 02:53:35 +03:00
VERSION := $( shell cat VERSION)
2020-05-11 21:21:09 +03:00
PYCURL_SSL_LIBRARY ?= openssl
2016-08-25 18:57:31 +03:00
# 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)
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 ?=
2017-10-10 19:34:49 +03:00
CELERY_SCHEDULE_FILE ?= /var/lib/awx/beat.db
2016-03-09 22:33:42 +03:00
2017-08-09 22:53:25 +03:00
DEV_DOCKER_TAG_BASE ?= gcr.io/ansible-tower-engineering
2016-07-05 18:44:27 +03:00
# Python packages to install only from source (not from binary wheels)
# Comma separated list
2020-05-11 20:11:19 +03:00
SRC_ONLY_PKGS ?= cffi,pycparser,psycopg2,twilio,pycurl
2019-12-16 16:24:33 +03:00
# These should be upgraded in the AWX and Ansible venv before attempting
# to install the actual requirements
2019-12-18 21:22:20 +03:00
VENV_BOOTSTRAP ?= pip = = 19.3.1 setuptools = = 41.6.0
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-08-03 17:39:04 +03:00
NAME ?= awx
2014-10-17 17:01:45 +04:00
GIT_REMOTE_URL = $( shell git config --get remote.origin.url)
2017-08-03 23:19:27 +03:00
2014-10-17 17:01:45 +04:00
# TAR build parameters
2018-09-27 02:53:35 +03:00
SDIST_TAR_NAME = $( NAME) -$( VERSION)
WHEEL_NAME = $( NAME) -$( VERSION)
2017-06-30 23:21:03 +03:00
2017-06-23 15:48:39 +03:00
SDIST_COMMAND ?= sdist
2017-07-24 19:35:21 +03:00
WHEEL_COMMAND ?= bdist_wheel
2017-06-14 16:28:39 +03:00
SDIST_TAR_FILE ?= $( SDIST_TAR_NAME) .tar.gz
2017-07-24 19:35:21 +03:00
WHEEL_FILE ?= $( WHEEL_NAME) -py2-none-any.whl
2017-06-30 23:21:03 +03:00
2016-09-28 19:38:37 +03:00
# UI flag files
UI_DEPS_FLAG_FILE = awx/ui/.deps_built
2019-01-17 03:31:25 +03:00
UI_RELEASE_DEPS_FLAG_FILE = awx/ui/.release_deps_built
2016-09-28 19:38:37 +03:00
UI_RELEASE_FLAG_FILE = awx/ui/.release_built
2017-07-27 23:30:03 +03:00
I18N_FLAG_FILE = .i18n_built
2018-04-25 18:55:57 +03:00
.PHONY : awx -link clean clean -tmp clean -venv requirements requirements_dev \
2019-09-03 21:22:07 +03:00
develop refresh adduser migrate dbchange runserver \
2019-04-12 18:54:51 +03:00
receiver test test_unit test_coverage coverage_html \
2017-07-27 23:46:40 +03:00
dev_build release_build release_clean sdist \
2016-10-26 23:51:39 +03:00
ui-docker-machine ui-docker ui-release ui-devel \
2017-09-09 11:05:48 +03:00
ui-test ui-deps ui-test-ci VERSION
2016-10-19 19:35:59 +03:00
2015-12-05 00:05:21 +03:00
# remove ui build artifacts
2019-07-26 03:47:35 +03:00
clean-ui : clean -languages
2015-12-05 00:05:21 +03:00
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-11-02 08:03:00 +03:00
rm -rf awx/ui/test/unit/reports/
rm -rf awx/ui/test/spec/reports/
rm -rf awx/ui/test/e2e/reports/
2017-05-15 18:01:07 +03:00
rm -rf awx/ui/client/languages/
2019-06-28 19:11:07 +03:00
rm -rf awx/ui_next/node_modules/
2020-07-01 17:51:29 +03:00
rm -rf node_modules
2019-06-28 19:11:07 +03:00
rm -rf awx/ui_next/coverage/
rm -rf awx/ui_next/build/locales/_build/
2016-09-28 19:38:37 +03:00
rm -f $( UI_DEPS_FLAG_FILE)
2019-01-17 03:31:25 +03:00
rm -f $( UI_RELEASE_DEPS_FLAG_FILE)
2016-09-28 19:38:37 +03:00
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
2018-11-16 00:25:13 +03:00
clean-schema :
rm -rf swagger.json
rm -rf schema.json
rm -rf reference-schema.json
2019-07-26 03:47:35 +03:00
clean-languages :
rm -f $( I18N_FLAG_FILE)
find . -type f -regex " .*\.mo $$ " -delete
2014-10-23 00:41:24 +04:00
# Remove temporary build files, compiled Python files.
2019-11-25 23:55:22 +03:00
clean : clean -ui clean -api clean -awxkit 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
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
2019-08-27 18:02:15 +03:00
clean-api :
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
2019-08-27 18:02:15 +03:00
rm -f awx/awx_test.sqlite3*
rm -rf requirements/vendor
2019-12-05 00:50:05 +03:00
rm -rf awx/projects
2013-03-13 21:09:36 +04:00
2019-11-25 23:55:22 +03:00
clean-awxkit :
2019-12-19 05:15:25 +03:00
rm -rf awxkit/*.egg-info awxkit/.tox awxkit/build/*
2019-11-25 23:55:22 +03: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
2017-07-18 18:16:18 +03:00
virtualenv : virtualenv_ansible virtualenv_awx
2016-04-18 19:36:15 +03:00
2019-12-16 16:24:33 +03:00
# virtualenv_* targets do not use --system-site-packages to prevent bugs installing packages
# but Ansible venvs are expected to have this, so that must be done after venv creation
2016-04-18 19:36:15 +03:00
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 \
2019-12-12 22:56:01 +03:00
virtualenv -p python $( VENV_BASE) /ansible && \
2019-12-16 16:24:33 +03:00
$( VENV_BASE) /ansible/bin/pip install $( PIP_OPTIONS) $( VENV_BOOTSTRAP) ; \
2019-12-12 00:40:32 +03:00
fi ; \
2016-01-29 17:03:03 +03:00
fi
2013-06-20 23:53:10 +04:00
2019-01-17 01:14:08 +03:00
virtualenv_ansible_py3 :
if [ " $( VENV_BASE) " ] ; then \
if [ ! -d " $( VENV_BASE) " ] ; then \
mkdir $( VENV_BASE) ; \
fi ; \
2019-01-18 08:03:33 +03:00
if [ ! -d " $( VENV_BASE) /ansible " ] ; then \
2019-12-12 00:40:32 +03:00
virtualenv -p $( PYTHON) $( VENV_BASE) /ansible; \
2019-12-16 16:24:33 +03:00
$( VENV_BASE) /ansible/bin/pip install $( PIP_OPTIONS) $( VENV_BOOTSTRAP) ; \
2019-12-12 00:40:32 +03:00
fi ; \
2019-01-17 01:14:08 +03:00
fi
2019-12-18 21:22:20 +03:00
# flit is needed for offline install of certain packages, specifically ptyprocess
# it is needed for setup, but not always recognized as a setup dependency
2019-12-16 16:24:33 +03:00
# similar to pip, setuptools, and wheel, these are all needed here as a bootstrapping issues
2017-07-18 18:16:18 +03:00
virtualenv_awx :
2016-04-18 19:36:15 +03:00
if [ " $( VENV_BASE) " ] ; then \
if [ ! -d " $( VENV_BASE) " ] ; then \
mkdir $( VENV_BASE) ; \
fi ; \
2017-07-18 18:16:18 +03:00
if [ ! -d " $( VENV_BASE) /awx " ] ; then \
2019-12-12 00:40:32 +03:00
virtualenv -p $( PYTHON) $( VENV_BASE) /awx; \
2020-02-18 19:08:54 +03:00
$( VENV_BASE) /awx/bin/pip install $( PIP_OPTIONS) $( VENV_BOOTSTRAP) ; \
2016-04-18 19:36:15 +03:00
fi ; \
fi
2019-12-16 16:24:33 +03:00
# --ignore-install flag is not used because *.txt files should specify exact versions
2016-04-18 19:36:15 +03:00
requirements_ansible : virtualenv_ansible
2017-03-29 18:08:03 +03:00
if [ [ " $( PIP_OPTIONS) " = = *"--no-index" * ] ] ; then \
2020-05-11 21:21:09 +03:00
cat requirements/requirements_ansible.txt requirements/requirements_ansible_local.txt | PYCURL_SSL_LIBRARY = $( PYCURL_SSL_LIBRARY) $( VENV_BASE) /ansible/bin/pip install $( PIP_OPTIONS) -r /dev/stdin ; \
2017-03-29 18:08:03 +03:00
else \
2020-05-11 21:21:09 +03:00
cat requirements/requirements_ansible.txt requirements/requirements_ansible_git.txt | PYCURL_SSL_LIBRARY = $( PYCURL_SSL_LIBRARY) $( VENV_BASE) /ansible/bin/pip install $( PIP_OPTIONS) --no-binary $( SRC_ONLY_PKGS) -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
2019-12-16 16:24:33 +03:00
# Same effect as using --system-site-packages flag on venv creation
2019-12-12 00:40:32 +03:00
rm $( shell ls -d $( VENV_BASE) /ansible/lib/python* | head -n 1) /no-global-site-packages.txt
2013-06-20 23:53:10 +04:00
2019-01-17 01:14:08 +03:00
requirements_ansible_py3 : virtualenv_ansible_py 3
2019-03-22 19:10:47 +03:00
if [ [ " $( PIP_OPTIONS) " = = *"--no-index" * ] ] ; then \
2020-05-11 21:21:09 +03:00
cat requirements/requirements_ansible.txt requirements/requirements_ansible_local.txt | PYCURL_SSL_LIBRARY = $( PYCURL_SSL_LIBRARY) $( VENV_BASE) /ansible/bin/pip3 install $( PIP_OPTIONS) -r /dev/stdin ; \
2019-03-22 19:10:47 +03:00
else \
2020-05-11 21:21:09 +03:00
cat requirements/requirements_ansible.txt requirements/requirements_ansible_git.txt | PYCURL_SSL_LIBRARY = $( PYCURL_SSL_LIBRARY) $( VENV_BASE) /ansible/bin/pip3 install $( PIP_OPTIONS) --no-binary $( SRC_ONLY_PKGS) -r /dev/stdin ; \
2019-03-22 19:10:47 +03:00
fi
2019-01-18 08:03:33 +03:00
$( VENV_BASE) /ansible/bin/pip3 uninstall --yes -r requirements/requirements_ansible_uninstall.txt
2019-12-16 16:24:33 +03:00
# Same effect as using --system-site-packages flag on venv creation
2019-12-12 00:40:32 +03:00
rm $( shell ls -d $( VENV_BASE) /ansible/lib/python* | head -n 1) /no-global-site-packages.txt
2019-01-17 01:14:08 +03: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-07-18 18:16:18 +03:00
# Install third-party requirements needed for AWX's environment.
2019-12-16 16:24:33 +03:00
# this does not use system site packages intentionally
2017-07-18 18:16:18 +03:00
requirements_awx : virtualenv_awx
2017-03-29 18:08:03 +03:00
if [ [ " $( PIP_OPTIONS) " = = *"--no-index" * ] ] ; then \
2019-12-16 16:24:33 +03:00
cat requirements/requirements.txt requirements/requirements_local.txt | $( VENV_BASE) /awx/bin/pip install $( PIP_OPTIONS) -r /dev/stdin ; \
2017-03-29 18:08:03 +03:00
else \
2019-11-18 23:12:45 +03:00
cat requirements/requirements.txt requirements/requirements_git.txt | $( VENV_BASE) /awx/bin/pip install $( PIP_OPTIONS) --no-binary $( SRC_ONLY_PKGS) -r /dev/stdin ; \
2017-03-29 18:08:03 +03:00
fi
2019-10-16 20:48:59 +03:00
$( VENV_BASE) /awx/bin/pip uninstall --yes -r requirements/requirements_tower_uninstall.txt
2016-03-09 22:33:42 +03:00
2017-07-18 18:16:18 +03:00
requirements_awx_dev :
$( VENV_BASE) /awx/bin/pip install -r requirements/requirements_dev.txt
2013-06-20 23:53:10 +04:00
2020-03-11 17:08:57 +03:00
requirements_collections :
mkdir -p $( COLLECTION_BASE)
ansible-galaxy collection install -r requirements/collections_requirements.yml -p $( COLLECTION_BASE)
requirements : requirements_ansible requirements_awx requirements_collections
2016-03-25 20:10:47 +03:00
2019-10-29 23:10:51 +03:00
requirements_dev : requirements_awx requirements_ansible_py 3 requirements_awx_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
2017-07-18 18:16:18 +03:00
# "Install" awx 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 :
2017-11-10 01:17:30 +03:00
mkdir -p /var/lib/awx/; \
if [ " $( VENV_BASE) " ] ; then \
. $( VENV_BASE) /awx/bin/activate; \
fi ; \
2018-10-22 19:58:42 +03:00
python -c "import awx; print(awx.__version__)" > /var/lib/awx/.awx_version; \
2015-08-05 15:10:16 +03:00
2014-11-11 23:18:39 +03:00
# Do any one-time init tasks.
2017-08-10 21:56:46 +03:00
comma := ,
2014-11-11 23:18:39 +03:00
init :
2016-03-09 22:33:42 +03:00
if [ " $( VENV_BASE) " ] ; then \
2017-07-18 18:16:18 +03:00
. $( VENV_BASE) /awx/bin/activate; \
2016-03-09 22:33:42 +03:00
fi ; \
2017-08-08 22:18:07 +03:00
$( MANAGEMENT_COMMAND) provision_instance --hostname= $( COMPOSE_HOST) ; \
2017-11-16 22:55:17 +03:00
$( MANAGEMENT_COMMAND) register_queue --queuename= tower --instance_percent= 100; \
2017-08-10 21:56:46 +03:00
if [ " $( AWX_GROUP_QUEUES) " = = "tower,thepentagon" ] ; then \
2017-08-08 22:18:07 +03:00
$( MANAGEMENT_COMMAND) provision_instance --hostname= isolated; \
2017-07-18 18:16:18 +03:00
$( MANAGEMENT_COMMAND) register_queue --queuename= 'thepentagon' --hostnames= isolated --controller= tower; \
2019-03-29 19:14:40 +03:00
$( MANAGEMENT_COMMAND) generate_isolated_key > /awx_devel/awx/main/isolated/authorized_keys; \
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 :
2017-07-18 18:16:18 +03:00
$( MANAGEMENT_COMMAND) 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 \
2017-07-18 18:16:18 +03:00
. $( VENV_BASE) /awx/bin/activate; \
2016-03-09 22:33:42 +03:00
fi ; \
2018-04-02 22:34:39 +03:00
$( MANAGEMENT_COMMAND) migrate --noinput
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 :
2017-07-18 18:16:18 +03:00
$( MANAGEMENT_COMMAND) makemigrations
2013-06-20 23:53:10 +04:00
2017-02-13 00:13:15 +03:00
supervisor :
@if [ " $( VENV_BASE) " ] ; then \
2017-07-18 18:16:18 +03:00
. $( VENV_BASE) /awx/bin/activate; \
2017-02-13 00:13:15 +03:00
fi ; \
2019-09-12 22:22:16 +03:00
supervisord --pidfile= /tmp/supervisor_pid -n
2015-08-04 22:26:27 +03:00
2016-10-18 19:15:01 +03:00
collectstatic :
2016-10-14 08:43:14 +03:00
@if [ " $( VENV_BASE) " ] ; then \
2017-07-18 18:16:18 +03:00
. $( VENV_BASE) /awx/bin/activate; \
2016-10-14 08:43:14 +03:00
fi ; \
2019-09-12 22:22:16 +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 \
2017-07-18 18:16:18 +03:00
. $( VENV_BASE) /awx/bin/activate; \
2016-10-18 19:15:01 +03:00
fi ; \
2019-09-12 22:22:16 +03:00
uwsgi -b 32768 --socket 127.0.0.1:8050 --module= awx.wsgi:application --home= /venv/awx --chdir= /awx_devel/ --vacuum --processes= 5 --harakiri= 120 --master --no-orphans --py-autoreload 1 --max-requests= 1000 --stats /tmp/stats.socket --lazy-apps --logformat "%(addr) %(method) %(uri) - %(proto) %(status)" --hook-accepting1= "exec:supervisorctl restart tower-processes:awx-dispatcher tower-processes:awx-receiver"
2016-10-14 08:43:14 +03:00
daphne :
@if [ " $( VENV_BASE) " ] ; then \
2017-07-18 18:16:18 +03:00
. $( VENV_BASE) /awx/bin/activate; \
2016-10-14 08:43:14 +03:00
fi ; \
2019-09-12 22:22:16 +03:00
daphne -b 127.0.0.1 -p 8051 awx.asgi:channel_layer
2016-10-14 08:43:14 +03:00
2020-02-15 00:12:04 +03:00
wsbroadcast :
2016-03-09 22:33:42 +03:00
@if [ " $( VENV_BASE) " ] ; then \
2017-07-18 18:16:18 +03:00
. $( VENV_BASE) /awx/bin/activate; \
2016-03-09 22:33:42 +03:00
fi ; \
2020-02-15 00:12:04 +03:00
$( PYTHON) manage.py run_wsbroadcast
2013-06-20 23:53:10 +04:00
2018-08-08 20:41:07 +03:00
# Run to start the background task dispatcher for development.
dispatcher :
2016-03-09 22:33:42 +03:00
@if [ " $( VENV_BASE) " ] ; then \
2017-07-18 18:16:18 +03:00
. $( VENV_BASE) /awx/bin/activate; \
2016-03-09 22:33:42 +03:00
fi ; \
2019-09-12 22:22:16 +03:00
$( PYTHON) manage.py run_dispatcher
2018-08-08 20:41:07 +03:00
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 \
2017-07-18 18:16:18 +03:00
. $( VENV_BASE) /awx/bin/activate; \
2016-03-09 22:33:42 +03:00
fi ; \
2019-09-12 22:22:16 +03:00
$( PYTHON) manage.py run_callback_receiver
2014-02-19 00:16:39 +04:00
2016-10-18 21:19:18 +03:00
nginx :
nginx -g "daemon off;"
2017-12-06 07:46:18 +03:00
jupyter :
@if [ " $( VENV_BASE) " ] ; then \
. $( VENV_BASE) /awx/bin/activate; \
fi ; \
2019-09-12 22:22:16 +03:00
$( MANAGEMENT_COMMAND) shell_plus --notebook
2017-12-06 07:46:18 +03:00
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 \
2017-07-18 18:16:18 +03:00
. $( VENV_BASE) /awx/bin/activate; \
2016-11-15 17:33:12 +03:00
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)
2018-09-18 20:03:38 +03:00
genschema : reports
2019-06-06 17:03:11 +03:00
$( MAKE) swagger PYTEST_ARGS = "--genschema --create-db "
2019-05-22 02:15:21 +03:00
mv swagger.json schema.json
2018-09-18 20:03:38 +03:00
2018-02-01 18:52:14 +03:00
swagger : reports
@if [ " $( VENV_BASE) " ] ; then \
. $( VENV_BASE) /awx/bin/activate; \
fi ; \
2018-11-06 23:22:07 +03:00
( set -o pipefail && py.test $( PYTEST_ARGS) awx/conf/tests/functional awx/main/tests/functional/api awx/main/tests/docs --release= $( VERSION_TARGET) | tee reports/$@ .report)
2018-02-01 18:52:14 +03:00
2015-05-20 22:26:44 +03:00
check : flake 8 pep 8 # pyflakes pylint
2016-03-02 20:09:15 +03:00
2018-04-25 18:55:57 +03:00
awx-link :
2020-05-19 22:00:13 +03:00
[ -d "/awx_devel/awx.egg-info" ] || python3 /awx_devel/setup.py egg_info_dev
2019-01-03 20:49:54 +03:00
cp -f /tmp/awx.egg-link /venv/awx/lib/python$( PYTHON_VERSION) /site-packages/awx.egg-link
2018-04-25 18:55:57 +03:00
2018-07-25 00:40:45 +03:00
TEST_DIRS ?= awx/main/tests/unit awx/main/tests/functional awx/conf/tests awx/sso/tests
2018-04-04 19:56:58 +03:00
2013-09-25 05:40:53 +04:00
# Run all API unit tests.
2018-04-16 16:49:45 +03:00
test :
2020-06-16 03:54:14 +03:00
if [ " $( VENV_BASE) " ] ; then \
2017-07-18 18:16:18 +03:00
. $( VENV_BASE) /awx/bin/activate; \
2016-08-23 22:35:43 +03:00
fi ; \
2018-09-24 17:53:55 +03:00
PYTHONDONTWRITEBYTECODE = 1 py.test -p no:cacheprovider -n auto $( TEST_DIRS)
2020-05-21 19:11:40 +03:00
cmp VERSION awxkit/VERSION || "VERSION and awxkit/VERSION *must* match"
2020-06-18 22:31:35 +03:00
cd awxkit && $( VENV_BASE) /awx/bin/tox -re py3
2020-08-03 22:30:37 +03:00
awx-manage check_migrations --dry-run --check -n 'missing_migration_file'
2013-05-22 01:39:34 +04:00
2019-09-17 22:58:35 +03:00
COLLECTION_TEST_DIRS ?= awx_collection/test/awx
2020-03-24 05:47:30 +03:00
COLLECTION_TEST_TARGET ?=
2019-10-01 20:45:07 +03:00
COLLECTION_PACKAGE ?= awx
COLLECTION_NAMESPACE ?= awx
2020-03-04 06:19:38 +03:00
COLLECTION_INSTALL = ~/.ansible/collections/ansible_collections/$( COLLECTION_NAMESPACE) /$( COLLECTION_PACKAGE)
2019-08-31 00:11:01 +03:00
2019-09-17 22:48:00 +03:00
test_collection :
2020-06-16 03:54:14 +03:00
rm -f $( shell ls -d $( VENV_BASE) /awx/lib/python* | head -n 1) /no-global-site-packages.txt
if [ " $( VENV_BASE) " ] ; then \
2019-08-31 00:11:01 +03:00
. $( VENV_BASE) /awx/bin/activate; \
fi ; \
2020-06-16 03:54:14 +03:00
py.test $( COLLECTION_TEST_DIRS) -v
2020-05-07 21:52:39 +03:00
# The python path needs to be modified so that the tests can find Ansible within the container
# First we will use anything expility set as PYTHONPATH
# Second we will load any libraries out of the virtualenv (if it's unspecified that should be ok because python should not load out of an empty directory)
# Finally we will add the system path so that the tests can find the ansible libraries
2019-08-31 00:11:01 +03:00
2019-09-17 22:48:00 +03:00
flake8_collection :
2019-09-17 22:58:35 +03:00
flake8 awx_collection/ # Different settings, in main exclude list
2019-08-31 00:11:01 +03:00
2020-04-07 20:31:06 +03:00
test_collection_all : test_collection flake 8_collection
2019-09-17 22:48:00 +03:00
2020-02-20 23:05:58 +03:00
# WARNING: symlinking a collection is fundamentally unstable
# this is for rapid development iteration with playbooks, do not use with other test targets
symlink_collection :
2020-03-04 04:19:41 +03:00
rm -rf $( COLLECTION_INSTALL)
mkdir -p ~/.ansible/collections/ansible_collections/$( COLLECTION_NAMESPACE) # in case it does not exist
ln -s $( shell pwd ) /awx_collection $( COLLECTION_INSTALL)
2019-10-03 19:04:59 +03:00
2019-09-17 22:48:00 +03:00
build_collection :
2020-05-18 15:51:39 +03:00
ansible-playbook -i localhost, awx_collection/tools/template_galaxy.yml -e collection_package = $( COLLECTION_PACKAGE) -e collection_namespace = $( COLLECTION_NAMESPACE) -e collection_version = $( VERSION) -e '{"awx_template_version":false}'
2020-06-10 14:14:34 +03:00
ansible-galaxy collection build awx_collection_build --force --output-path= awx_collection_build
2019-12-20 23:24:06 +03:00
install_collection : build_collection
2020-03-04 04:19:41 +03:00
rm -rf $( COLLECTION_INSTALL)
2020-06-10 14:14:34 +03:00
ansible-galaxy collection install awx_collection_build/$( COLLECTION_NAMESPACE) -$( COLLECTION_PACKAGE) -$( VERSION) .tar.gz
2019-08-31 00:11:01 +03:00
2020-03-04 04:19:41 +03:00
test_collection_sanity : install_collection
cd $( COLLECTION_INSTALL) && ansible-test sanity
test_collection_integration : install_collection
2020-03-24 05:47:30 +03:00
cd $( COLLECTION_INSTALL) && ansible-test integration $( COLLECTION_TEST_TARGET)
2020-03-04 04:19:41 +03:00
2016-01-27 19:38:56 +03:00
test_unit :
2016-08-23 22:35:43 +03:00
@if [ " $( VENV_BASE) " ] ; then \
2017-07-18 18:16:18 +03:00
. $( VENV_BASE) /awx/bin/activate; \
2016-08-23 22:35:43 +03:00
fi ; \
2018-07-25 00:40:45 +03:00
py.test awx/main/tests/unit awx/conf/tests/unit awx/sso/tests/unit
2016-01-27 19:38:56 +03:00
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 \
2017-07-18 18:16:18 +03:00
. $( VENV_BASE) /awx/bin/activate; \
2016-08-23 22:35:43 +03:00
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
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 \
2017-07-18 18:16:18 +03:00
. $( VENV_BASE) /awx/bin/activate; \
2016-12-22 21:53:19 +03:00
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 \
2017-07-18 18:16:18 +03:00
. $( VENV_BASE) /awx/bin/activate; \
2016-10-26 14:17:49 +03:00
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 )
2019-01-17 03:31:25 +03:00
$(I18N_FLAG_FILE) : $( UI_RELEASE_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
# --------------------------------------
2019-01-17 03:31:25 +03:00
# UI RELEASE TASKS
2016-10-26 14:17:49 +03:00
# --------------------------------------
2019-01-17 03:31:25 +03:00
ui-release : $( UI_RELEASE_FLAG_FILE )
$(UI_RELEASE_FLAG_FILE) : $( I 18N_FLAG_FILE ) $( UI_RELEASE_DEPS_FLAG_FILE )
$( NPM_BIN) --prefix awx/ui run build-release
touch $( UI_RELEASE_FLAG_FILE)
2016-10-07 12:43:33 +03:00
2019-01-17 03:31:25 +03:00
$(UI_RELEASE_DEPS_FLAG_FILE) :
2019-01-22 18:45:48 +03:00
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD = 1 $( NPM_BIN) --unsafe-perm --prefix awx/ui ci --no-save awx/ui
2019-01-17 03:31:25 +03:00
touch $( UI_RELEASE_DEPS_FLAG_FILE)
# END UI RELEASE TASKS
# --------------------------------------
# UI TASKS
# --------------------------------------
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) :
2019-01-17 03:31:25 +03:00
@if [ -f ${ UI_RELEASE_DEPS_FLAG_FILE } ] ; then \
rm -rf awx/ui/node_modules; \
rm -f ${ UI_RELEASE_DEPS_FLAG_FILE } ; \
fi ; \
2019-01-22 18:45:48 +03:00
$( NPM_BIN) --unsafe-perm --prefix awx/ui ci --no-save 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-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
2019-05-22 02:15:21 +03:00
ui-lint : $( UI_DEPS_FLAG_FILE )
$( NPM_BIN) run --prefix awx/ui jshint
$( NPM_BIN) run --prefix awx/ui lint
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
2017-11-01 20:01:24 +03:00
$( NPM_BIN) --prefix awx/ui run unit
2014-08-28 20:01:35 +04: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
2017-11-01 20:01:24 +03:00
$( NPM_BIN) run --prefix awx/ui lint
2016-08-26 20:20:12 +03:00
2020-05-19 16:21:03 +03:00
ui-zuul-lint-and-test :
CHROMIUM_BIN = $( CHROMIUM_BIN) ./awx/ui/build/zuul_download_chromium.sh
CHROMIUM_BIN = $( CHROMIUM_BIN) PUPPETEER_SKIP_CHROMIUM_DOWNLOAD = 1 $( NPM_BIN) --unsafe-perm --prefix awx/ui ci --no-save awx/ui
CHROMIUM_BIN = $( CHROMIUM_BIN) $( NPM_BIN) run --prefix awx/ui jshint
CHROMIUM_BIN = $( CHROMIUM_BIN) $( NPM_BIN) run --prefix awx/ui lint
CHROME_BIN = $( CHROMIUM_BIN) $( NPM_BIN) --prefix awx/ui run test:ci
CHROME_BIN = $( CHROMIUM_BIN) $( NPM_BIN) --prefix awx/ui run unit
2019-10-07 21:49:13 +03:00
2015-07-28 22:55:00 +03:00
# END UI TASKS
# --------------------------------------
2019-06-28 19:11:07 +03:00
# UI NEXT TASKS
# --------------------------------------
2020-06-19 00:28:44 +03:00
awx/ui_next/node_modules :
2019-06-28 19:11:07 +03:00
$( NPM_BIN) --prefix awx/ui_next install
2020-06-19 00:28:44 +03:00
ui-release-next :
mkdir -p awx/ui_next/build/static
touch awx/ui_next/build/static/.placeholder
ui-devel-next : awx /ui_next /node_modules
2020-07-01 18:29:08 +03:00
$( NPM_BIN) --prefix awx/ui_next run extract-strings
$( NPM_BIN) --prefix awx/ui_next run compile-strings
2020-06-19 00:28:44 +03:00
$( NPM_BIN) --prefix awx/ui_next run build
mkdir -p awx/public/static/css
mkdir -p awx/public/static/js
mkdir -p awx/public/static/media
cp -r awx/ui_next/build/static/css/* awx/public/static/css
cp -r awx/ui_next/build/static/js/* awx/public/static/js
cp -r awx/ui_next/build/static/media/* awx/public/static/media
clean-ui-next :
2020-07-01 17:51:29 +03:00
rm -rf node_modules
2020-06-19 00:28:44 +03:00
rm -rf awx/ui_next/node_modules
rm -rf awx/ui_next/build
2019-06-28 19:11:07 +03:00
2019-10-07 21:49:13 +03:00
ui-next-zuul-lint-and-test :
$( NPM_BIN) --prefix awx/ui_next install
$( NPM_BIN) run --prefix awx/ui_next lint
$( NPM_BIN) run --prefix awx/ui_next prettier-check
$( NPM_BIN) run --prefix awx/ui_next test
2019-06-28 19:11:07 +03:00
# END UI NEXT 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
2020-06-19 00:28:44 +03:00
dist/$(SDIST_TAR_FILE) : ui -release ui -release -next VERSION
2017-07-25 17:55:37 +03:00
$( PYTHON) setup.py $( SDIST_COMMAND)
2014-05-22 19:25:50 +04:00
2020-06-19 00:28:44 +03:00
dist/$(WHEEL_FILE) : ui -release ui -release -next
2017-07-25 17:55:37 +03:00
$( PYTHON) setup.py $( WHEEL_COMMAND)
2017-06-14 16:28:39 +03:00
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
2017-07-24 19:35:21 +03:00
wheel : dist /$( WHEEL_FILE )
@echo "#############################################"
@echo "Artifacts:"
@echo dist/$( WHEEL_FILE)
@echo "#############################################"
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 $@
2016-08-25 18:57:31 +03:00
docker-auth :
2019-08-14 22:32:26 +03:00
@if [ " $( IMAGE_REPOSITORY_AUTH) " ] ; then \
echo " $( IMAGE_REPOSITORY_AUTH) " | docker login -u oauth2accesstoken --password-stdin $( IMAGE_REPOSITORY_BASE) ; \
2017-07-18 18:16:18 +03:00
fi ;
2016-08-25 18:57:31 +03:00
2019-12-05 00:50:05 +03:00
# This directory is bind-mounted inside of the development container and
# needs to be pre-created for permissions to be set correctly. Otherwise,
# Docker will create this directory as root.
awx/projects :
@mkdir -p $@
2017-06-14 18:47:30 +03:00
# Docker isolated rampart
2019-12-05 00:50:05 +03:00
docker-compose-isolated : awx /projects
2018-10-23 02:02:31 +03:00
CURRENT_UID = $( shell id -u) TAG = $( COMPOSE_TAG) DEV_DOCKER_TAG_BASE = $( DEV_DOCKER_TAG_BASE) docker-compose -f tools/docker-compose.yml -f tools/docker-isolated-override.yml up
2017-06-14 18:47:30 +03:00
2015-09-10 00:16:35 +03:00
# Docker Compose Development environment
2019-12-05 00:50:05 +03:00
docker-compose : docker -auth awx /projects
2019-05-10 19:19:39 +03:00
CURRENT_UID = $( shell id -u) OS = " $( shell docker info | grep 'Operating System' ) " TAG = $( COMPOSE_TAG) DEV_DOCKER_TAG_BASE = $( DEV_DOCKER_TAG_BASE) docker-compose -f tools/docker-compose.yml up --no-recreate awx
2015-09-29 17:45:25 +03:00
2019-12-05 00:50:05 +03:00
docker-compose-cluster : docker -auth awx /projects
2018-10-23 02:02:31 +03:00
CURRENT_UID = $( shell id -u) TAG = $( COMPOSE_TAG) DEV_DOCKER_TAG_BASE = $( DEV_DOCKER_TAG_BASE) docker-compose -f tools/docker-compose-cluster.yml up
2016-09-08 17:18:14 +03:00
2019-12-05 00:50:05 +03:00
docker-compose-credential-plugins : docker -auth awx /projects
2019-02-28 21:10:44 +03:00
echo -e "\033[0;31mTo generate a CyberArk Conjur API key: docker exec -it tools_conjur_1 conjurctl account create quick-start\033[0m"
CURRENT_UID = $( shell id -u) TAG = $( COMPOSE_TAG) DEV_DOCKER_TAG_BASE = $( DEV_DOCKER_TAG_BASE) docker-compose -f tools/docker-compose.yml -f tools/docker-credential-plugins-override.yml up --no-recreate awx
2019-01-22 02:20:24 +03:00
2019-12-05 00:50:05 +03:00
docker-compose-test : docker -auth awx /projects
2019-05-10 19:19:39 +03:00
cd tools && CURRENT_UID = $( shell id -u) OS = " $( shell docker info | grep 'Operating System' ) " TAG = $( COMPOSE_TAG) DEV_DOCKER_TAG_BASE = $( DEV_DOCKER_TAG_BASE) docker-compose run --rm --service-ports awx /bin/bash
2015-09-29 17:45:25 +03:00
2019-12-05 00:50:05 +03:00
docker-compose-runtest : awx /projects
2018-10-23 02:02:31 +03:00
cd tools && CURRENT_UID = $( shell id -u) TAG = $( COMPOSE_TAG) DEV_DOCKER_TAG_BASE = $( DEV_DOCKER_TAG_BASE) docker-compose run --rm --service-ports awx /start_tests.sh
2018-10-03 18:32:54 +03:00
2019-12-05 00:50:05 +03:00
docker-compose-build-swagger : awx /projects
2020-05-12 23:35:09 +03:00
cd tools && CURRENT_UID = $( shell id -u) TAG = $( COMPOSE_TAG) DEV_DOCKER_TAG_BASE = $( DEV_DOCKER_TAG_BASE) docker-compose run --rm --service-ports --no-deps awx /start_tests.sh swagger
2018-10-10 16:37:36 +03:00
2019-05-22 02:15:21 +03:00
detect-schema-change : genschema
2018-11-16 00:25:13 +03:00
curl https://s3.amazonaws.com/awx-public-ci-files/schema.json -o reference-schema.json
2018-11-16 17:47:33 +03:00
# Ignore differences in whitespace with -b
2018-12-20 23:05:01 +03:00
diff -u -b reference-schema.json schema.json
2018-11-16 00:25:13 +03:00
2019-12-05 00:50:05 +03:00
docker-compose-clean : awx /projects
2018-10-03 18:32:54 +03:00
cd tools && TAG = $( COMPOSE_TAG) DEV_DOCKER_TAG_BASE = $( DEV_DOCKER_TAG_BASE) docker-compose rm -sf
2018-09-24 17:53:55 +03:00
2017-08-09 22:53:25 +03:00
# Base development image build
2020-05-14 20:21:46 +03:00
docker-compose-build :
2020-05-13 06:37:44 +03:00
ansible localhost -m template -a "src=installer/roles/image_build/templates/Dockerfile.j2 dest=tools/docker-compose/Dockerfile" -e build_dev = True
2019-06-11 21:01:35 +03:00
docker build -t ansible/awx_devel -f tools/docker-compose/Dockerfile \
--cache-from= $( DEV_DOCKER_TAG_BASE) /awx_devel:$( COMPOSE_TAG) .
2017-08-09 22:53:25 +03:00
docker tag ansible/awx_devel $( DEV_DOCKER_TAG_BASE) /awx_devel:$( COMPOSE_TAG)
#docker push $(DEV_DOCKER_TAG_BASE)/awx_devel:$(COMPOSE_TAG)
2016-08-25 18:57:31 +03:00
2017-08-09 22:53:25 +03:00
# For use when developing on "isolated" AWX deployments
2020-05-14 20:21:46 +03:00
docker-compose-isolated-build : docker -compose -build
2017-07-18 18:16:18 +03:00
docker build -t ansible/awx_isolated -f tools/docker-isolated/Dockerfile .
2017-08-09 22:53:25 +03:00
docker tag ansible/awx_isolated $( DEV_DOCKER_TAG_BASE) /awx_isolated:$( COMPOSE_TAG)
#docker push $(DEV_DOCKER_TAG_BASE)/awx_isolated:$(COMPOSE_TAG)
2017-06-14 18:47:30 +03:00
2016-03-16 20:06:54 +03:00
docker-clean :
2017-07-18 18:16:18 +03:00
$( foreach container_id,$( shell docker ps -f name = tools_awx -aq) ,docker stop $( container_id) ; docker rm -f $( container_id) ; )
2020-04-06 20:06:18 +03:00
docker images | grep "awx_devel" | awk '{print $$1 ":" $$2}' | xargs docker rmi
2020-04-21 22:47:59 +03:00
docker-clean-volumes : docker -compose -clean
2020-04-06 20:06:18 +03:00
docker volume rm tools_awx_db
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
2019-12-05 00:50:05 +03:00
docker-compose-elk : docker -auth awx /projects
2018-10-23 02:02:31 +03:00
CURRENT_UID = $( shell id -u) TAG = $( COMPOSE_TAG) DEV_DOCKER_TAG_BASE = $( DEV_DOCKER_TAG_BASE) 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
2019-12-05 00:50:05 +03:00
docker-compose-cluster-elk : docker -auth awx /projects
2017-08-09 22:53:25 +03:00
TAG = $( COMPOSE_TAG) DEV_DOCKER_TAG_BASE = $( DEV_DOCKER_TAG_BASE) 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
2019-04-08 18:57:17 +03:00
prometheus :
docker run -u0 --net= tools_default --link= ` docker ps | egrep -o "tools_awx(_run)?_([^ ]+)?" ` :awxweb --volume ` pwd ` /tools/prometheus:/prometheus --name prometheus -d -p 0.0.0.0:9090:9090 prom/prometheus --web.enable-lifecycle --config.file= /prometheus/prometheus.yml
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 :
2019-05-24 23:30:06 +03:00
docker run -it --net tools_default --rm postgres:10 sh -c 'exec psql -h "postgres" -p "5432" -U postgres'
2017-07-25 17:54:42 +03:00
VERSION :
2018-09-27 02:53:35 +03:00
@echo " awx: $( VERSION) "