This is an automated email from the ASF dual-hosted git repository.

nchung pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-ingester.git


The following commit(s) were added to refs/heads/dev by this push:
     new 813355d  SDAP-411: Used global versioning for SDAP ingester artifacts 
(#62)
813355d is described below

commit 813355dae109ae9f70b4da89d6eaba134bc7e496
Author: Nga Chung <[email protected]>
AuthorDate: Thu Nov 17 15:40:41 2022 -0800

    SDAP-411: Used global versioning for SDAP ingester artifacts (#62)
---
 VERSION.txt                                       | 1 +
 collection_manager/collection_manager/__init__.py | 2 +-
 collection_manager/docker/Dockerfile              | 1 +
 collection_manager/setup.py                       | 7 +++----
 granule_ingester/docker/Dockerfile                | 1 +
 granule_ingester/setup.py                         | 3 +++
 6 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/VERSION.txt b/VERSION.txt
new file mode 100644
index 0000000..afaf360
--- /dev/null
+++ b/VERSION.txt
@@ -0,0 +1 @@
+1.0.0
\ No newline at end of file
diff --git a/collection_manager/collection_manager/__init__.py 
b/collection_manager/collection_manager/__init__.py
index 899e700..8b13789 100644
--- a/collection_manager/collection_manager/__init__.py
+++ b/collection_manager/collection_manager/__init__.py
@@ -1 +1 @@
-__version__ = '1.0.0.dev0'
+
diff --git a/collection_manager/docker/Dockerfile 
b/collection_manager/docker/Dockerfile
index 8bfb8ab..8b464c1 100644
--- a/collection_manager/docker/Dockerfile
+++ b/collection_manager/docker/Dockerfile
@@ -5,6 +5,7 @@ RUN curl -s 
https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add
 RUN echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | tee -a 
/etc/apt/sources.list.d/kubernetes.list
 RUN apt-get update && apt-get install -y kubectl
 
+COPY VERSION.txt /VERSION.txt
 COPY common /common
 COPY collection_manager/collection_manager 
/collection_manager/collection_manager
 COPY collection_manager/setup.py /collection_manager/setup.py
diff --git a/collection_manager/setup.py b/collection_manager/setup.py
index e1178f8..55926de 100644
--- a/collection_manager/setup.py
+++ b/collection_manager/setup.py
@@ -4,9 +4,8 @@ import setuptools
 
 PACKAGE_NAME = "sdap_collection_manager"
 
-with open("./collection_manager/__init__.py") as fi:
-    result = re.search(r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fi.read())
-version = result.group(1)
+with open('../VERSION.txt', 'r') as f:
+    __version__ = f.readline()
 
 with open("README.md", "r") as fh:
     long_description = fh.read()
@@ -16,7 +15,7 @@ with open('requirements.txt', 'r') as f:
 
 setuptools.setup(
     name=PACKAGE_NAME,
-    version=version,
+    version=__version__,
     author="Apache - SDAP",
     author_email="[email protected]",
     description="a helper to ingest data in sdap",
diff --git a/granule_ingester/docker/Dockerfile 
b/granule_ingester/docker/Dockerfile
index 1e7aedd..72812d7 100644
--- a/granule_ingester/docker/Dockerfile
+++ b/granule_ingester/docker/Dockerfile
@@ -6,6 +6,7 @@ ENV PATH="/opt/conda/bin:$PATH"
 
 RUN apk update --no-cache && apk add --no-cache --virtual .build-deps git 
openjdk8
 
+COPY VERSION.txt /VERSION.txt
 COPY common /common
 COPY granule_ingester/granule_ingester /sdap/granule_ingester
 COPY granule_ingester/setup.py /sdap/setup.py
diff --git a/granule_ingester/setup.py b/granule_ingester/setup.py
index 2a5920e..0525188 100644
--- a/granule_ingester/setup.py
+++ b/granule_ingester/setup.py
@@ -5,6 +5,9 @@ from setuptools import setup, find_packages
 with open('requirements.txt') as f:
     pip_requirements = f.readlines()
 
+with open('../VERSION.txt', 'r') as f:
+    __version__ = f.readline()
+
 try:
     check_call(['conda', 'install', '-y', '-c', 'conda-forge', '--file', 
'conda-requirements.txt'])
 except (CalledProcessError, IOError) as e:

Reply via email to