def createDeployParameters()

in riff-raff/app/schedule/DeployJob.scala [61:92]


  def createDeployParameters(
      lastDeploy: Record,
      scheduledDeploysEnabled: Boolean
  ): Either[RiffRaffError, DeployParameters] = {
    lastDeploy.state match {
      case RunState.Completed =>
        val params = extractDeployParameters(lastDeploy)
        if (
          lastDeploy.parameters.selector.isInstanceOf[DeploymentKeysSelector]
        ) {
          Left(SkippedDueToPreviousPartialDeploy(lastDeploy))
        } else if (scheduledDeploysEnabled) {
          Right(params)
        } else {
          Left(
            Error(
              s"Scheduled deployments disabled. Would have deployed $params"
            )
          )
        }
      case RunState.Failed =>
        Left(SkippedDueToPreviousFailure(lastDeploy))
      case RunState.NotRunning =>
        Left(SkippedDueToPreviousWaitingDeploy(lastDeploy))
      case otherState =>
        Left(
          Error(
            s"Skipping scheduled deploy as deploy record ${lastDeploy.uuid} has status $otherState"
          )
        )
    }
  }