Skip to content
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

ability to trigger deployment of an environment via the UI #838

Closed
twardnw opened this Issue Jan 9, 2019 · 3 comments

Comments

3 participants
@twardnw
Copy link
Member

twardnw commented Jan 9, 2019

No description provided.

@rocketeerbkw rocketeerbkw added this to ToDo in Lagoon Kanban via automation Jan 17, 2019

@rocketeerbkw rocketeerbkw moved this from ToDo to In Progress in Lagoon Kanban Jan 17, 2019

@rocketeerbkw

This comment has been minimized.

Copy link
Member

rocketeerbkw commented Jan 24, 2019

Proposed API additions

type ProjectInput {
  id: Int
  name: String
}

type EnvironmentInput {
  id: Int
  name: String
  project: ProjectInput
}

type DeploymentInput {
  id: Int
}

type DeployEnvironmentLatestInput {
  environment: EnvironmentInput!
}

type DeployEnvironmentPreviousInput {
  environment: EnvironmentInput!
  deployment: DeploymentInput!
}

type DeployEnvironmentBranchInput {
  environment: EnvironmentInput!
  branch: {
    ref: String
  }
}

type DeployEnvironmentPullrequestInput {
  environment: EnvironmentInput!
  pullrequest: {
    baseRef: String
    headRef: String
  }
}

# Deploys the latest code for the environment, whether branch or PR
# Used in UI to replace empty commit deploys
deployEnvironmentLatest(input: DeployEnvironmentLatestInput!): String

# Deploys the same code that was used for a previous deployment
# Used in UI to "rollback" to a previous deployment
deployEnvironmentPrevious(input: DeployEnvironmentPreviousInput!): String

# Deploys a specific ref on an environment. Ref can be a branch, tag or commit
deployEnvironmentBranch(input: DeployEnvironmentBranchInput!): String

# Deploys a specific merge for a PR
deployEnvironmentPullrequest(input: DeployEnvironmentPullrequestInput!): String

Examples:

mutation {
  deployEnvironmentLatest(input: {
    environment: {
      id: 24
    }
  })
}

mutation {
  deployEnvironmentLatest(input: {
    environment: {
      name: 'dev'
      project: {
        id: 5
      }
    }
  })
}

mutation {
  deployEnvironmentLatest(input: {
    environment: {
      name: 'dev'
      project: {
        name: 'high-cotton'
      }
    }
  })
}

mutation {
  deployEnvironmentPrevious(input: {
    environment: {
      id: 24
    }
    deployment: {
      id: 192
    }
  })
}

mutation {
  deployEnvironmentBranch(input: {
    environment: {
      id: 24
    }
    branch: {
      ref: "9ff28zao8"
    }
  })
}

mutation {
  deployEnvironmentPullrequest(input: {
    environment: {
      id: 24
    }
    pullrequest: {
      baseRef: "9ff28zao8"
      headRef: "9ff28zao8"
    }
  })
}
@Schnitzel

This comment has been minimized.

Copy link
Member

Schnitzel commented Jan 24, 2019

nice work!
some feedback:

Let's not implement deployEnvironmentPrevious for now, as I would like to have a separate system for rollbacks as we could actually just deploy the previous docker image and not need to trigger a whole build.

Will deployEnvironmentLatest trigger the latest SHA that was deployed or just the newest SHA that is in the branch? As the rest2tasks did the later, means that if you sent a deploy via rest2tasks just with a branch name it deployed whatever was in that branch and didn't check which last sha was deployed before.

@rocketeerbkw

This comment has been minimized.

Copy link
Member

rocketeerbkw commented Jan 24, 2019

Let's not implement deployEnvironmentPrevious for now, as I would like to have a separate system for rollbacks as we could actually just deploy the previous docker image and not need to trigger a whole build.

Is it useful to have an api at all that says "I want a new deployment, same as this other one" vs a rollback to a previously deployed?

Will deployEnvironmentLatest trigger the latest SHA that was deployed or just the newest SHA that is in the branch? As the rest2tasks did the later, means that if you sent a deploy via rest2tasks just with a branch name it deployed whatever was in that branch and didn't check which last sha was deployed before.

Yes, "latest" means the newest code for a branch or pr. Maybe a different name like deployEnvironmentHead or something else?

@rocketeerbkw rocketeerbkw moved this from In Progress to Testing in Lagoon Kanban Mar 9, 2019

@rocketeerbkw rocketeerbkw removed their assignment Mar 9, 2019

Lagoon Kanban automation moved this from Testing to Done Mar 9, 2019

@rocketeerbkw rocketeerbkw reopened this Mar 9, 2019

Lagoon Kanban automation moved this from Done to ToDo Mar 9, 2019

@rocketeerbkw rocketeerbkw moved this from ToDo to Testing in Lagoon Kanban Mar 9, 2019

@rocketeerbkw rocketeerbkw added the ui label Mar 16, 2019

Lagoon Kanban automation moved this from Testing to Done Mar 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.