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

Allow deployments from UI and deprecate rest2tasks #894

Merged
merged 13 commits into from Mar 29, 2019

Conversation

rocketeerbkw
Copy link
Member

@rocketeerbkw rocketeerbkw commented Feb 12, 2019

Checklist

  • Affected Issues have been mentioned in the Closing issues section
  • Documentation has been written/updated.
  • Changelog entry has been written

API

New mutations added to the API to trigger deployments. Examples:

# Deploy latest code for an environment that already exists
mutation deployEnvironmentLatest {
  deployEnvironmentLatest (input: {
    environment: {
      name: "nginx"
      project: {
        name: "ci-nginx"
      }
    }
  })
}

# Deploy latest or specific commit for an environment that does or does not already exist
mutation deployEnvironmentBranch {
  deployEnvironmentBranch(input:{
    project: {
      name: "ci-nginx"
    }
    branchName: "nginx"
    branchRef: "b82sx9234"
  })
}

mutation deployEnvironmentPullrequest {
  deployEnvironmentPullrequest(input: {
    project: {
      name: "ci-nginx"
    }
    number: 5
    title: "111 Add New Feature"
    baseBranchName: "master"
    baseBranchRef: "origin/master"
    headBranchName: "111-add-new-feature"
    headBranchRef: "origin/111-add-new-feature"
  })
}

mutation deployEnvironmentPromote {
  deployEnvironmentPromote(input: {
    sourceEnvironment: {
      name: "source"
      project: {
        name: "ci-features"
      }
    }
    branchName:"target"
    project: {
      name:"ci-features"
    }
  })
}

In order to facilitate deployments, new information is tracked for environments and is now required when creating/updating them. Example:

"environmentByOpenshiftProjectName": {
  "id": 3,
  "openshiftProjectName": "high-cotton-master",
  "name": "Master",
  "deployType": "branch",
  "deployTitle": null,
  "deployBaseRef": "Master",
  "deployHeadRef": null
}

UI

Environments that have been configured with deployment information will have a new button on the deployments page to trigger a deploy of the latest code for that environment.

image

Changelog Entry

Feature - API has new mutations for triggering deployments
Change - API requires new deployment information when creating/updating environments
Improvement - UI can now trigger new deployments for environments (#838)
Change - rest2tasks is deprecated in favor of API

Deployment notes

For existing environments, at lest one deployment must happen via non-ui methods before the "deploy" button will show up in the ui. New environments will get the button immediately.

Closing issues

Closes #838

@rocketeerbkw rocketeerbkw force-pushed the 838-trigger-deploys-ui branch 3 times, most recently from 1b97b40 to 2852c65 Compare March 8, 2019 16:45
@rocketeerbkw rocketeerbkw changed the title [WIP] Allow deployments from UI and deprecate rest2tasks Allow deployments from UI and deprecate rest2tasks Mar 9, 2019
services/api/src/typeDefs.js Outdated Show resolved Hide resolved
@Schnitzel
Copy link
Contributor

very nice work! just some small adaptions and unfortunately we have some conflicts now :(

@rocketeerbkw
Copy link
Member Author

I rebased to fix the conflicts, will wait for tests to come back while I test locally.

@rocketeerbkw
Copy link
Member Author

All green for me locally

@rocketeerbkw rocketeerbkw removed their assignment Mar 28, 2019
@Schnitzel
Copy link
Contributor

ugh, another Conflict now :( @rocketeerbkw can you have another look? thank you

@Schnitzel Schnitzel merged commit 01e3941 into master Mar 29, 2019
@dasrecht dasrecht deleted the 838-trigger-deploys-ui branch April 10, 2019 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ability to trigger deployment of an environment via the UI
2 participants