def validate_deployment_action_basic(action, **kwargs):
    """Validates that the DeploymentConfiguration is present

    Checks:
      - The deployment configuration from Deckhand using the design version
          - If the deployment configuration is missing, error
    """
    validator = ValidateDeploymentAction(
        dh_client=service_clients.deckhand_client(),
        action=action,
        full_validation=False)
    validator.validate()
def validate_deployment_action_full(action, **kwargs):
    """Validates that the deployment configuration is correctly set up

    Checks:
      - The deployment configuration from Deckhand using the design version
          - If the deployment configuration is missing, error
      - The deployment strategy from the deployment configuration.
          - If the deployment strategy is specified, but is missing, error.
          - Check that there are no cycles in the groups
    """
    validator = ValidateDeploymentAction(
        dh_client=service_clients.deckhand_client(),
        action=action,
        full_validation=True)
    validator.validate()
Ejemplo n.º 3
0
def validate_site_action(action):
    """Validates that the deployment configuration is correctly set up

    Checks:

      - The deployment configuration from Deckhand using the design version

          - If the deployment configuration is missing, error

      - The deployment strategy from the deployment configuration.

          - If the deployment strategy is specified, but is missing, error.
          - Check that there are no cycles in the groups
    """
    validator = _SiteActionValidator(
        dh_client=service_clients.deckhand_client(), action=action)
    validator.validate()
 def _get_shipyard_validations(self, revision_id):
     # Run Shipyard's own validations.
     try:
         sy_val_mgr = DocumentValidationManager(
             service_clients.deckhand_client(),
             revision_id,
             [(ValidateDeploymentConfigurationFull,
               'deployment-configuration')]
         )
         return sy_val_mgr.validate()
     except Exception as ex:
         # Don't let any exceptions here prevent subsequent processing,
         # but make sure we register an error to prevent success.
         return [_generate_validation_message({
             "error": True,
             "message": ("Shipyard has encountered an unexpected error "
                         "while processing document validations"),
             "name": "DocumentValidationProcessingError",
             "diagnostic": str(ex),
         })]