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

Feature Request: Trigger build after pull request is closed #1707

Open
catto opened this issue Aug 1, 2019 · 2 comments
Open

Feature Request: Trigger build after pull request is closed #1707

catto opened this issue Aug 1, 2019 · 2 comments
Labels

Comments

@catto
Copy link
Member

catto commented Aug 1, 2019

What happened:
Some users deploy their apps every open pull request with ~pr trigger and the apps would be named with each pull request number.
Once a pull request is merged or closed, no one takes care of temporarily deployed apps from pull request build. Then unused/abandoned apps retain on their infrastructure.

What you expected to happen:
Screwdriver triggers a build after each pull request is closed so that users can run teardown build and keep their compute cluster clean.

For example,

jobs:
    pullrequest:
        requires: ~pr
        image: node:8
        steps:
        - test: build and test
        - deploy: <deploy app using SD_PULL_REQUEST environment variable as its name>
        - check: <test against http://endpoint-pr-$SD_PULL_REQUEST.example.com>
    pr-teardown:
        # triggers after pr is closed
        requires: ~prclosed
        image: node:8
        steps:
        - teardown: <remove endpoint-pr-$SD_PULL_REQUEST.example.com app>
@jithine
Copy link
Member

jithine commented Aug 1, 2019

How is this different than enabling pull request chain and user adding a job to do clean up ? Even better option will to to combine this teardown step with PR build steps and make a template

@catto
Copy link
Member Author

catto commented Aug 2, 2019

@jithin1987 Users can deploy, test, teardown in a single event using chainPR feature. But in some cases, users don't want to teardown their instance automatically after tests.

For instance, screwdriver has homepage. Each author has to get screenshot and paste it to the PR. (screwdriver-cd/homepage#41 ).

If there is PR-closed trigger, we can achieve a workflow like below:

  • When new PR is open, deploy the homepage to a temporary instance without teardown job.
  • The deploy job adds a comment like "changes have been deployed to http://homepage-pr-X.example.com" to the PR.
  • We can check if the changes works properly on each reviewer's browsers/environment.
  • The instance will be cleaned up after PR is closed.

@jithine jithine added the feature label Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants