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

Projects
None yet
2 participants
@rocketeerbkw
Copy link
Member

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 to 2852c65 Mar 4, 2019

@rocketeerbkw rocketeerbkw changed the title [WIP] Allow deployments from UI and deprecate rest2tasks Allow deployments from UI and deprecate rest2tasks Mar 9, 2019

Show resolved Hide resolved services/api/src/typeDefs.js Outdated
@Schnitzel

This comment has been minimized.

Copy link
Member

Schnitzel commented Mar 21, 2019

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

@rocketeerbkw rocketeerbkw force-pushed the 838-trigger-deploys-ui branch from 2852c65 to e9000ce Mar 27, 2019

@rocketeerbkw

This comment has been minimized.

Copy link
Member Author

rocketeerbkw commented Mar 27, 2019

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

@rocketeerbkw

This comment has been minimized.

Copy link
Member Author

rocketeerbkw commented Mar 28, 2019

All green for me locally

@rocketeerbkw rocketeerbkw removed their assignment Mar 28, 2019

@rocketeerbkw rocketeerbkw requested a review from Schnitzel Mar 28, 2019

@Schnitzel

This comment has been minimized.

Copy link
Member

Schnitzel commented Mar 28, 2019

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

@Schnitzel Schnitzel merged commit 01e3941 into master Mar 29, 2019

1 check passed

continuous-integration/jenkins/pr-merge This commit looks good
Details

@dasrecht dasrecht deleted the 838-trigger-deploys-ui branch Apr 10, 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.