Add xstatic-check-version and xstatic-publish-to-pypi

These are needed by xstatic jobs for migration.

Change-Id: I01bfd5f255b400e4fb575f31fecffbe7a254d621
This commit is contained in:
Monty Taylor 2017-09-13 17:25:46 -06:00
parent 6664ecb46d
commit 287ee02152
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
3 changed files with 107 additions and 2 deletions

View File

@ -0,0 +1,26 @@
- hosts: all
tasks:
- name: Copy version check script
copy:
src: xstatic_check_version.py
dest: xstatic_check_version.py
- name: Make virtualenv
command: virtualenv .venv
- name: Print pip version
command: .venv/bin/pip --version
- name: Install setuptools_scm
command: .venv/bin/pip install setuptools_scm
- name: Check version match
command: .venv/bin/python xstatic_check_version.py
- name: Clean up after ourselves
file:
path: "{{ item }}"
state: absent
with_items:
- xstatic_check_version.py
- .venv

View File

@ -0,0 +1,39 @@
#! /usr/bin/env python
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import importlib
import os
import sys
from setuptools_scm import get_version
# add the xstatic repos checkout to the PYTHONPATH so we can
# import its contents
sys.path.append(os.getcwd())
xs = None
for name in os.listdir('xstatic/pkg'):
if os.path.isdir('xstatic/pkg/' + name):
if xs is not None:
sys.exit('More than one xstatic.pkg package found.')
xs = importlib.import_module('xstatic.pkg.' + name)
if xs is None:
sys.exit('No xstatic.pkg package found.')
git_version = get_version()
if git_version != xs.PACKAGE_VERSION:
sys.exit(
'git tag version ({}) does not match package version ({})'.format(
git_version, xs.PACKAGE_VERSION))

View File

@ -204,6 +204,12 @@
required-projects:
- openstack-infra/release-tools
- job:
name: xstatic-check-version
description:
Check version used by xstatic packages
run: playbooks/xstatic/check-version
- nodeset:
name: centos-7
nodes:
@ -343,14 +349,48 @@
- announce-release:
dependencies:
- release-openstack-python
- propose-update-constraints
- propose-update-constraints:
dependencies:
- release-openstack-python
release:
jobs:
- release-openstack-python
- announce-release:
dependencies:
- release-openstack-python
- propose-update-constraints
- propose-update-constraints:
dependencies:
- release-openstack-python
- project-template:
name: publish-xstatic-to-pypi
description: |
Publish an XStatic Python package to PyPI, then send release announcement
emails and propose updates to upper-constraints as needed.
pre-release:
jobs:
- xstatic-check-version
- release-openstack-python:
dependencies:
- xstatic-check-version
- announce-release:
dependencies:
- release-openstack-python
- propose-update-constraints:
dependencies:
- release-openstack-python
release:
jobs:
- xstatic-check-version
- release-openstack-python:
dependencies:
- xstatic-check-version
- announce-release:
dependencies:
- release-openstack-python
- propose-update-constraints:
dependencies:
- release-openstack-python
- project-template:
name: publish-to-pypi-quietly