mirror of
https://github.com/ansible/awx.git
synced 2026-04-14 06:29:25 -02:30
Merge pull request #2332 from shanemcd/devel
Updates to versioning system.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -112,7 +112,6 @@ local/
|
|||||||
*.mo
|
*.mo
|
||||||
requirements/vendor
|
requirements/vendor
|
||||||
.i18n_built
|
.i18n_built
|
||||||
VERSION
|
|
||||||
.idea/*
|
.idea/*
|
||||||
|
|
||||||
# AWX python libs populated by requirements.txt
|
# AWX python libs populated by requirements.txt
|
||||||
|
|||||||
28
Makefile
28
Makefile
@@ -12,10 +12,7 @@ MANAGEMENT_COMMAND ?= awx-manage
|
|||||||
IMAGE_REPOSITORY_AUTH ?=
|
IMAGE_REPOSITORY_AUTH ?=
|
||||||
IMAGE_REPOSITORY_BASE ?= https://gcr.io
|
IMAGE_REPOSITORY_BASE ?= https://gcr.io
|
||||||
|
|
||||||
VERSION=$(shell git describe --long --first-parent)
|
VERSION := $(shell cat VERSION)
|
||||||
VERSION3=$(shell git describe --long --first-parent | sed 's/\-g.*//')
|
|
||||||
VERSION3DOT=$(shell git describe --long --first-parent | sed 's/\-g.*//' | sed 's/\-/\./')
|
|
||||||
RELEASE_VERSION=$(shell git describe --long --first-parent | sed 's@\([0-9.]\{1,\}\).*@\1@')
|
|
||||||
|
|
||||||
# NOTE: This defaults the container image version to the branch that's active
|
# NOTE: This defaults the container image version to the branch that's active
|
||||||
COMPOSE_TAG ?= $(GIT_BRANCH)
|
COMPOSE_TAG ?= $(GIT_BRANCH)
|
||||||
@@ -30,8 +27,6 @@ DEV_DOCKER_TAG_BASE ?= gcr.io/ansible-tower-engineering
|
|||||||
# Comma separated list
|
# Comma separated list
|
||||||
SRC_ONLY_PKGS ?= cffi,pycparser,psycopg2,twilio
|
SRC_ONLY_PKGS ?= cffi,pycparser,psycopg2,twilio
|
||||||
|
|
||||||
CURWD = $(shell pwd)
|
|
||||||
|
|
||||||
# Determine appropriate shasum command
|
# Determine appropriate shasum command
|
||||||
UNAME_S := $(shell uname -s)
|
UNAME_S := $(shell uname -s)
|
||||||
ifeq ($(UNAME_S),Linux)
|
ifeq ($(UNAME_S),Linux)
|
||||||
@@ -48,20 +43,9 @@ DATE := $(shell date -u +%Y%m%d%H%M)
|
|||||||
NAME ?= awx
|
NAME ?= awx
|
||||||
GIT_REMOTE_URL = $(shell git config --get remote.origin.url)
|
GIT_REMOTE_URL = $(shell git config --get remote.origin.url)
|
||||||
|
|
||||||
ifeq ($(OFFICIAL),yes)
|
|
||||||
VERSION_TARGET ?= $(RELEASE_VERSION)
|
|
||||||
else
|
|
||||||
VERSION_TARGET ?= $(VERSION3DOT)
|
|
||||||
endif
|
|
||||||
|
|
||||||
# TAR build parameters
|
# TAR build parameters
|
||||||
ifeq ($(OFFICIAL),yes)
|
SDIST_TAR_NAME=$(NAME)-$(VERSION)
|
||||||
SDIST_TAR_NAME=$(NAME)-$(RELEASE_VERSION)
|
WHEEL_NAME=$(NAME)-$(VERSION)
|
||||||
WHEEL_NAME=$(NAME)-$(RELEASE_VERSION)
|
|
||||||
else
|
|
||||||
SDIST_TAR_NAME=$(NAME)-$(VERSION3DOT)
|
|
||||||
WHEEL_NAME=$(NAME)-$(VERSION3DOT)
|
|
||||||
endif
|
|
||||||
|
|
||||||
SDIST_COMMAND ?= sdist
|
SDIST_COMMAND ?= sdist
|
||||||
WHEEL_COMMAND ?= bdist_wheel
|
WHEEL_COMMAND ?= bdist_wheel
|
||||||
@@ -112,7 +96,6 @@ clean: clean-ui clean-dist
|
|||||||
rm -rf requirements/vendor
|
rm -rf requirements/vendor
|
||||||
rm -rf tmp
|
rm -rf tmp
|
||||||
rm -rf $(I18N_FLAG_FILE)
|
rm -rf $(I18N_FLAG_FILE)
|
||||||
rm -f VERSION
|
|
||||||
mkdir tmp
|
mkdir tmp
|
||||||
rm -rf build $(NAME)-$(VERSION) *.egg-info
|
rm -rf build $(NAME)-$(VERSION) *.egg-info
|
||||||
find . -type f -regex ".*\.py[co]$$" -delete
|
find . -type f -regex ".*\.py[co]$$" -delete
|
||||||
@@ -611,7 +594,7 @@ docker-compose-cluster-elk: docker-auth
|
|||||||
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
|
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
|
||||||
|
|
||||||
minishift-dev:
|
minishift-dev:
|
||||||
ansible-playbook -i localhost, -e devtree_directory=$(CURWD) tools/clusterdevel/start_minishift_dev.yml
|
ansible-playbook -i localhost, -e devtree_directory=$(CURDIR) tools/clusterdevel/start_minishift_dev.yml
|
||||||
|
|
||||||
|
|
||||||
clean-elk:
|
clean-elk:
|
||||||
@@ -626,5 +609,4 @@ psql-container:
|
|||||||
docker run -it --net tools_default --rm postgres:9.6 sh -c 'exec psql -h "postgres" -p "5432" -U postgres'
|
docker run -it --net tools_default --rm postgres:9.6 sh -c 'exec psql -h "postgres" -p "5432" -U postgres'
|
||||||
|
|
||||||
VERSION:
|
VERSION:
|
||||||
@echo $(VERSION_TARGET) > $@
|
@echo "awx: $(VERSION)"
|
||||||
@echo "awx: $(VERSION_TARGET)"
|
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
FROM centos:7
|
FROM centos:7
|
||||||
|
|
||||||
RUN yum install -y epel-release
|
RUN yum install -y epel-release
|
||||||
RUN yum install -y https://centos7.iuscommunity.org/ius-release.rpm
|
|
||||||
|
|
||||||
RUN yum install -y bzip2 \
|
RUN yum install -y bzip2 \
|
||||||
gcc-c++ \
|
gcc-c++ \
|
||||||
gettext \
|
gettext \
|
||||||
git2u-core \
|
git \
|
||||||
make \
|
make \
|
||||||
python \
|
python \
|
||||||
python-pip
|
python-pip
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: Get Version from checkout if not provided
|
- name: Get Version from checkout if not provided
|
||||||
shell: "git describe --long --first-parent | sed 's/\\-g.*//' | sed 's/\\-/\\./'"
|
shell: "{{ lookup('file', playbook_dir + '/../VERSION') }}"
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
register: awx_version_command
|
register: awx_version_command
|
||||||
when: awx_version is not defined
|
when: awx_version is not defined
|
||||||
|
|||||||
@@ -29,10 +29,9 @@ WORKDIR /tmp
|
|||||||
RUN mkdir -p /var/lib/awx/public/static
|
RUN mkdir -p /var/lib/awx/public/static
|
||||||
RUN chgrp -Rf root /var/lib/awx && chmod -Rf g+w /var/lib/awx
|
RUN chgrp -Rf root /var/lib/awx && chmod -Rf g+w /var/lib/awx
|
||||||
RUN yum -y install epel-release && \
|
RUN yum -y install epel-release && \
|
||||||
yum -y install https://centos7.iuscommunity.org/ius-release.rpm && \
|
|
||||||
yum -y localinstall http://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm && \
|
yum -y localinstall http://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm && \
|
||||||
yum -y update && \
|
yum -y update && \
|
||||||
yum -y install ansible git2u-core mercurial subversion curl python-psycopg2 python-pip python-setuptools libselinux-python setools-libs yum-utils sudo acl make postgresql-devel nginx python-psutil libxml2-devel libxslt-devel libstdc++.so.6 gcc cyrus-sasl-devel cyrus-sasl openldap-devel libffi-devel python-pip xmlsec1-devel swig krb5-devel xmlsec1-openssl xmlsec1 xmlsec1-openssl-devel libtool-ltdl-devel bubblewrap gcc-c++ python-devel krb5-workstation krb5-libs python-crypto libcurl-devel rsync unzip && \
|
yum -y install ansible git mercurial subversion curl python-psycopg2 python-pip python-setuptools libselinux-python setools-libs yum-utils sudo acl make postgresql-devel nginx python-psutil libxml2-devel libxslt-devel libstdc++.so.6 gcc cyrus-sasl-devel cyrus-sasl openldap-devel libffi-devel python-pip xmlsec1-devel swig krb5-devel xmlsec1-openssl xmlsec1 xmlsec1-openssl-devel libtool-ltdl-devel bubblewrap gcc-c++ python-devel krb5-workstation krb5-libs python-crypto libcurl-devel rsync unzip && \
|
||||||
pip install virtualenv supervisor && \
|
pip install virtualenv supervisor && \
|
||||||
CFLAGS="-DXMLSEC_NO_SIZE_T" \
|
CFLAGS="-DXMLSEC_NO_SIZE_T" \
|
||||||
VENV_BASE=/var/lib/awx/venv make requirements_ansible && \
|
VENV_BASE=/var/lib/awx/venv make requirements_ansible && \
|
||||||
|
|||||||
9
setup.py
9
setup.py
@@ -22,13 +22,8 @@ docdir = "/usr/share/doc/awx"
|
|||||||
def get_version():
|
def get_version():
|
||||||
current_dir = os.path.dirname(os.path.abspath(__file__))
|
current_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
version_file = os.path.join(current_dir, 'VERSION')
|
version_file = os.path.join(current_dir, 'VERSION')
|
||||||
if os.path.isfile(version_file):
|
with open(version_file, 'r') as file:
|
||||||
with open(version_file, 'r') as file:
|
return file.read().strip()
|
||||||
version = file.read().strip()
|
|
||||||
else:
|
|
||||||
version = subprocess.Popen("git describe --long | cut -d - -f 1-1", shell=True, stdout=subprocess.PIPE).stdout.read().strip()
|
|
||||||
return version
|
|
||||||
|
|
||||||
|
|
||||||
if os.path.exists("/etc/debian_version"):
|
if os.path.exists("/etc/debian_version"):
|
||||||
sysinit = "/etc/init.d"
|
sysinit = "/etc/init.d"
|
||||||
|
|||||||
Reference in New Issue
Block a user