<commit_before>PYTHON=python
SITELIB=$(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
OFFICIAL ?= no
PACKER ?= packer
GRUNT ?= $(shell [ -t 0 ] && echo "grunt" || echo "grunt --no-color")

# Get the branch information from git
GIT_DATE := $(shell git log -n 1 --format="%ai")
DATE := $(shell date -u +%Y%m%d%H%M)

NAME=ansible-tower
VERSION=$(shell $(PYTHON) -c "from awx import __version__; print(__version__.split('-')[0])")
RELEASE=$(shell $(PYTHON) -c "from awx import __version__; print(__version__.split('-')[1])")
GIT_REMOTE_URL=$(shell git config --get remote.origin.url)

# Allow AMI license customization
AWS_INSTANCE_COUNT ?= 10

ifneq ($(OFFICIAL),yes)
BUILD=0.dev$(DATE)
SDIST_TAR_FILE=$(NAME)-$(VERSION)-$(BUILD).tar.gz
SETUP_TAR_NAME=$(NAME)-setup-$(VERSION)-$(BUILD)
RPM_PKG_RELEASE=$(BUILD)
DEB_BUILD_DIR=deb-build/$(NAME)-$(VERSION)-$(BUILD)
DEB_PKG_RELEASE=$(VERSION)-$(BUILD)
PACKER_BUILD_OPTS=-var-file=vars-aws-keys.json -var-file=vars-nightly.json
else
BUILD=
SDIST_TAR_FILE=$(NAME)-$(VERSION).tar.gz
SETUP_TAR_NAME=$(NAME)-setup-$(VERSION)
RPM_PKG_RELEASE=$(RELEASE)
DEB_BUILD_DIR=deb-build/$(NAME)-$(VERSION)
DEB_PKG_RELEASE=$(VERSION)-$(RELEASE)
PACKER_BUILD_OPTS=-var-file=vars-aws-keys.json -var-file=vars-release.json
endif

MOCK_BIN ?= mock
MOCK_CFG ?=

.PHONY: clean rebase push requirements requirements_pypi develop refresh \
	adduser syncdb migrate dbchange dbshell runserver celeryd receiver test \
	test_coverage coverage_html test_ui test_jenkins dev_build \
	release_build release_clean sdist rpm

# Remove temporary build files, compiled Python files.
clean:
	rm -rf dist/*
	rm -rf build rpm-build *.egg-info
	rm -rf debian deb-build
	rm -f awx/ui/static/{js,css}/awx*.{js,css}
	rm -rf awx/ui/static/docs
	rm -rf node_modules package.json Gruntfile.js bower.json
	find . -type f -regex ".*\.py[co]$$" -delete

# Fetch from origin, rebase local commits on top of origin commits.
rebase:
	git pull --rebase origin master

# Push changes to origin.
push:
	git push origin master

# Install third-party requirements needed for development environment (using
# locally downloaded packages).
requirements:
	@if [ "$(VIRTUAL_ENV)" ]; then \
	    (cd requirements && pip install --no-index setuptools-2.2.tar.gz); \
	    (cd requirements && pip install --no-index Django-1.6.7.tar.gz); \
	    (cd requirements && pip install --no-index -r dev_local.txt); \
	    $(PYTHON) fix_virtualenv_setuptools.py; \
	else \
	    (cd requirements && sudo pip install --no-index -r dev_local.txt); \
	fi

# Install third-party requirements needed for development environment
# (downloading from PyPI if necessary).
requirements_pypi:
	@if [ "$(VIRTUAL_ENV)" ]; then \
	    pip install setuptools==2.2; \
	    pip install Django\>=1.6.7,\<1.7; \
	    pip install -r requirements/dev.txt; \
	    $(PYTHON) fix_virtualenv_setuptools.py; \
	else \
	    sudo pip install -r requirements/dev.txt; \
	fi

# Install third-party requirements needed for running unittests in jenkins
# (using locally downloaded packages).
requirements_jenkins: requirements
	@if [ "$(VIRTUAL_ENV)" ]; then \
	    (cd requirements && pip install --no-index -r jenkins.txt); \
	    (cd requirements && pip install -U pycrypto); \
	    $(PYTHON) fix_virtualenv_setuptools.py; \
	else \
	    (cd requirements && sudo pip install --no-index -r jenkins.txt); \
	    (cd requirements && sudo pip install --no-index -U pycrypto); \
	fi
	npm install -g csslint jshint

# "Install" ansible-tower package in development mode.  Creates link to working
# copy in site-packages and installs awx-manage command.
develop:
	@if [ "$(VIRTUAL_ENV)" ]; then \
	    pip uninstall -y awx; \
	    $(PYTHON) setup.py develop; \
	else \
	    sudo pip uninstall -y awx; \
	    sudo $(PYTHON) setup.py develop; \
	fi

# Refresh development environment after pulling new code.
refresh: clean requirements develop migrate

# Create Django superuser.
adduser:
	$(PYTHON) manage.py createsuperuser<commit_msg>Yes, please download jenkins dependencies<commit_after>PYTHON=python
SITELIB=$(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
OFFICIAL ?= no
PACKER ?= packer
GRUNT ?= $(shell [ -t 0 ] && echo "grunt" || echo "grunt --no-color")

# Get the branch information from git
GIT_DATE := $(shell git log -n 1 --format="%ai")
DATE := $(shell date -u +%Y%m%d%H%M)

NAME=ansible-tower
VERSION=$(shell $(PYTHON) -c "from awx import __version__; print(__version__.split('-')[0])")
RELEASE=$(shell $(PYTHON) -c "from awx import __version__; print(__version__.split('-')[1])")
GIT_REMOTE_URL=$(shell git config --get remote.origin.url)

# Allow AMI license customization
AWS_INSTANCE_COUNT ?= 10

ifneq ($(OFFICIAL),yes)
BUILD=0.dev$(DATE)
SDIST_TAR_FILE=$(NAME)-$(VERSION)-$(BUILD).tar.gz
SETUP_TAR_NAME=$(NAME)-setup-$(VERSION)-$(BUILD)
RPM_PKG_RELEASE=$(BUILD)
DEB_BUILD_DIR=deb-build/$(NAME)-$(VERSION)-$(BUILD)
DEB_PKG_RELEASE=$(VERSION)-$(BUILD)
PACKER_BUILD_OPTS=-var-file=vars-aws-keys.json -var-file=vars-nightly.json
else
BUILD=
SDIST_TAR_FILE=$(NAME)-$(VERSION).tar.gz
SETUP_TAR_NAME=$(NAME)-setup-$(VERSION)
RPM_PKG_RELEASE=$(RELEASE)
DEB_BUILD_DIR=deb-build/$(NAME)-$(VERSION)
DEB_PKG_RELEASE=$(VERSION)-$(RELEASE)
PACKER_BUILD_OPTS=-var-file=vars-aws-keys.json -var-file=vars-release.json
endif

MOCK_BIN ?= mock
MOCK_CFG ?=

.PHONY: clean rebase push requirements requirements_pypi develop refresh \
	adduser syncdb migrate dbchange dbshell runserver celeryd receiver test \
	test_coverage coverage_html test_ui test_jenkins dev_build \
	release_build release_clean sdist rpm

# Remove temporary build files, compiled Python files.
clean:
	rm -rf dist/*
	rm -rf build rpm-build *.egg-info
	rm -rf debian deb-build
	rm -f awx/ui/static/{js,css}/awx*.{js,css}
	rm -rf awx/ui/static/docs
	rm -rf node_modules package.json Gruntfile.js bower.json
	find . -type f -regex ".*\.py[co]$$" -delete

# Fetch from origin, rebase local commits on top of origin commits.
rebase:
	git pull --rebase origin master

# Push changes to origin.
push:
	git push origin master

# Install third-party requirements needed for development environment (using
# locally downloaded packages).
requirements:
	@if [ "$(VIRTUAL_ENV)" ]; then \
	    (cd requirements && pip install --no-index setuptools-2.2.tar.gz); \
	    (cd requirements && pip install --no-index Django-1.6.7.tar.gz); \
	    (cd requirements && pip install --no-index -r dev_local.txt); \
	    $(PYTHON) fix_virtualenv_setuptools.py; \
	else \
	    (cd requirements && sudo pip install --no-index -r dev_local.txt); \
	fi

# Install third-party requirements needed for development environment
# (downloading from PyPI if necessary).
requirements_pypi:
	@if [ "$(VIRTUAL_ENV)" ]; then \
	    pip install setuptools==2.2; \
	    pip install Django\>=1.6.7,\<1.7; \
	    pip install -r requirements/dev.txt; \
	    $(PYTHON) fix_virtualenv_setuptools.py; \
	else \
	    sudo pip install -r requirements/dev.txt; \
	fi

# Install third-party requirements needed for running unittests in jenkins
# (using locally downloaded packages).
requirements_jenkins: requirements
	@if [ "$(VIRTUAL_ENV)" ]; then \
	    (cd requirements && pip install -r jenkins.txt); \
	    (cd requirements && pip install -U pycrypto); \
	    $(PYTHON) fix_virtualenv_setuptools.py; \
	else \
	    (cd requirements && sudo pip install -r jenkins.txt); \
	    (cd requirements && sudo pip install -U pycrypto); \
	fi
	npm install -g csslint jshint

# "Install" ansible-tower package in development mode.  Creates link to working
# copy in site-packages and installs awx-manage command.
develop:
	@if [ "$(VIRTUAL_ENV)" ]; then \
	    pip uninstall -y awx; \
	    $(PYTHON) setup.py develop; \
	else \
	    sudo pip uninstall -y awx; \
	    sudo $(PYTHON) setup.py develop; \
	fi

# Refresh development environment after pulling new code.
refresh: clean requirements develop migrate

# Create Django superuser.
adduser:
	$(PYTHON) manage.py createsuperuser
{'fraction_non_alphanumeric': 0.13710582076529976, 'fraction_numerical': 0.004736382899164901, 'mean_word_length': 4.120612635609445, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3148823', 'n_tokens_mistral': 2862, 'n_tokens_neox': 2723, 'n_words': 754}