From 62e3b9e3b62a7706889e7fff2ee7e874114f85a5 Mon Sep 17 00:00:00 2001 From: Shane McDonald Date: Wed, 26 Sep 2018 20:20:26 -0400 Subject: [PATCH 1/4] Driveby cleanup: use built-in Make variable --- Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 2f444a3c89..75d4b44d45 100644 --- a/Makefile +++ b/Makefile @@ -30,8 +30,6 @@ DEV_DOCKER_TAG_BASE ?= gcr.io/ansible-tower-engineering # Comma separated list SRC_ONLY_PKGS ?= cffi,pycparser,psycopg2,twilio -CURWD = $(shell pwd) - # Determine appropriate shasum command UNAME_S := $(shell uname -s) ifeq ($(UNAME_S),Linux) @@ -611,7 +609,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 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: From 50fe0392eda5606b2f6737ed6610fbc64aff419b Mon Sep 17 00:00:00 2001 From: Shane McDonald Date: Wed, 26 Sep 2018 19:53:35 -0400 Subject: [PATCH 2/4] Updates to versioning system. https://github.com/ansible/awx/issues?q=%22--first-parent%22 --- .gitignore | 1 - Makefile | 24 ++++------------------ VERSION | 1 + installer/roles/image_build/tasks/main.yml | 2 +- setup.py | 9 ++------ 5 files changed, 8 insertions(+), 29 deletions(-) create mode 100644 VERSION diff --git a/.gitignore b/.gitignore index 137c233c19..621101995d 100644 --- a/.gitignore +++ b/.gitignore @@ -112,7 +112,6 @@ local/ *.mo requirements/vendor .i18n_built -VERSION .idea/* # AWX python libs populated by requirements.txt diff --git a/Makefile b/Makefile index 75d4b44d45..9468563647 100644 --- a/Makefile +++ b/Makefile @@ -12,10 +12,7 @@ MANAGEMENT_COMMAND ?= awx-manage IMAGE_REPOSITORY_AUTH ?= IMAGE_REPOSITORY_BASE ?= https://gcr.io -VERSION=$(shell git describe --long --first-parent) -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@') +VERSION := $(shell cat VERSION) # NOTE: This defaults the container image version to the branch that's active COMPOSE_TAG ?= $(GIT_BRANCH) @@ -46,20 +43,9 @@ DATE := $(shell date -u +%Y%m%d%H%M) NAME ?= awx 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 -ifeq ($(OFFICIAL),yes) - SDIST_TAR_NAME=$(NAME)-$(RELEASE_VERSION) - WHEEL_NAME=$(NAME)-$(RELEASE_VERSION) -else - SDIST_TAR_NAME=$(NAME)-$(VERSION3DOT) - WHEEL_NAME=$(NAME)-$(VERSION3DOT) -endif +SDIST_TAR_NAME=$(NAME)-$(VERSION) +WHEEL_NAME=$(NAME)-$(VERSION) SDIST_COMMAND ?= sdist WHEEL_COMMAND ?= bdist_wheel @@ -110,7 +96,6 @@ clean: clean-ui clean-dist rm -rf requirements/vendor rm -rf tmp rm -rf $(I18N_FLAG_FILE) - rm -f VERSION mkdir tmp rm -rf build $(NAME)-$(VERSION) *.egg-info find . -type f -regex ".*\.py[co]$$" -delete @@ -624,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' VERSION: - @echo $(VERSION_TARGET) > $@ - @echo "awx: $(VERSION_TARGET)" + @echo "awx: $(VERSION)" diff --git a/VERSION b/VERSION new file mode 100644 index 0000000000..227cea2156 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +2.0.0 diff --git a/installer/roles/image_build/tasks/main.yml b/installer/roles/image_build/tasks/main.yml index c8b1d7d628..93fd436b6a 100644 --- a/installer/roles/image_build/tasks/main.yml +++ b/installer/roles/image_build/tasks/main.yml @@ -1,6 +1,6 @@ --- - 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 register: awx_version_command when: awx_version is not defined diff --git a/setup.py b/setup.py index 51c992e5e0..fadc6eb94c 100755 --- a/setup.py +++ b/setup.py @@ -22,13 +22,8 @@ docdir = "/usr/share/doc/awx" def get_version(): current_dir = os.path.dirname(os.path.abspath(__file__)) version_file = os.path.join(current_dir, 'VERSION') - if os.path.isfile(version_file): - with open(version_file, 'r') as file: - 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 - + with open(version_file, 'r') as file: + return file.read().strip() if os.path.exists("/etc/debian_version"): sysinit = "/etc/init.d" From 86140dec0843dc43e503d8ea9bd931ddbc250c65 Mon Sep 17 00:00:00 2001 From: Shane McDonald Date: Thu, 27 Sep 2018 17:29:04 -0400 Subject: [PATCH 3/4] Revert "Fix sdist builder image" This reverts commit 97472cb91b1f8ed56c37e93438519d4c8aaef206. # Conflicts: # installer/roles/image_build/tasks/main.yml --- installer/roles/image_build/files/Dockerfile.sdist | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/installer/roles/image_build/files/Dockerfile.sdist b/installer/roles/image_build/files/Dockerfile.sdist index a32c34c4c0..e66f76b97b 100644 --- a/installer/roles/image_build/files/Dockerfile.sdist +++ b/installer/roles/image_build/files/Dockerfile.sdist @@ -1,12 +1,11 @@ FROM centos:7 RUN yum install -y epel-release -RUN yum install -y https://centos7.iuscommunity.org/ius-release.rpm RUN yum install -y bzip2 \ gcc-c++ \ gettext \ - git2u-core \ + git \ make \ python \ python-pip From 3701567ad7ca11a412629363ed0a4c7d888549d2 Mon Sep 17 00:00:00 2001 From: Shane McDonald Date: Thu, 27 Sep 2018 17:30:56 -0400 Subject: [PATCH 4/4] Revert "first-parent requires git >= 1.8.4" This reverts commit 1af0ee2f8ce8ae1128f97f6898b376b0219038bb. # Conflicts: # installer/roles/image_build/templates/Dockerfile.j2 --- installer/roles/image_build/templates/Dockerfile.j2 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/installer/roles/image_build/templates/Dockerfile.j2 b/installer/roles/image_build/templates/Dockerfile.j2 index 0d1ade70fa..b93605874a 100644 --- a/installer/roles/image_build/templates/Dockerfile.j2 +++ b/installer/roles/image_build/templates/Dockerfile.j2 @@ -29,10 +29,9 @@ WORKDIR /tmp RUN mkdir -p /var/lib/awx/public/static RUN chgrp -Rf root /var/lib/awx && chmod -Rf g+w /var/lib/awx 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 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 && \ CFLAGS="-DXMLSEC_NO_SIZE_T" \ VENV_BASE=/var/lib/awx/venv make requirements_ansible && \