New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Processes the index projects in batches #612

Merged
merged 10 commits into from Sep 17, 2018

Separates the custom exception into a ccp/exceptions.py

 Also adds PYTHONPATH before invoking index_reader, as
 index_reader.py is now referenceing the other modules.
  • Loading branch information...
navidshaikh committed Sep 7, 2018
commit 6d8b43b178dff3deb73e946aaa75f3b6af33d35a
View
@@ -0,0 +1,10 @@
"""
This script defines custom exceptions of the service.
"""
class InvalidPipelineName(Exception):
"""
Exception to be raised when pipeline name populated doesn't
confornt to allowed value for openshift template field metadata.name
"""
pass
View
@@ -11,20 +11,8 @@
from glob import glob
class InvalidPipelineName(Exception):
"""
Exception to be raised when pipeline name populated doesn't
confornt to allowed value for openshift template field metadata.name
"""
pass
class ErrorAccessingIndexEntryAttributes(Exception):
"""
Exception to be raised when there are errors accessing
index entry attributes
"""
pass
from ccp.exceptions import InvalidPipelineName, \
ErrorAccessingIndexEntryAttributes
def _print(msg):
@@ -220,7 +208,7 @@ def read_projects(self):
project = Project(entry, self.namespace)
except Exception as e:
_print("Error processing index entry {}. Moving on.".format(
entry))
entry))
_print("Error: {}".format(e))
else:
# append to the list of projects
@@ -63,7 +63,7 @@ objects:
}
stage('Parse index') {
dir("${PIPELINE_REPO_DIR}") {
sh "python ccp/index_reader.py ${CONTAINER_INDEX_DIR}/index.d ${REGISTRY_URL} ${NAMESPACE} ${FROM_ADDRESS} ${SMTP_SERVER}"
sh "PYTHONPATH=${PIPELINE_REPO_DIR} python ccp/index_reader.py ${CONTAINER_INDEX_DIR}/index.d ${REGISTRY_URL} ${NAMESPACE} ${FROM_ADDRESS} ${SMTP_SERVER}"
}
}
}
ProTip! Use n and p to navigate between commits in a pull request.