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

Approve manual actions #2

Open
rcollette opened this issue May 28, 2021 · 3 comments
Open

Approve manual actions #2

rcollette opened this issue May 28, 2021 · 3 comments

Comments

@rcollette
Copy link

rcollette commented May 28, 2021

From our master branch, we gate deployments from dev to qa and from qa to production with a manual job trigger. I would like to be able to execute these manual triggers from Alexa. Ex " promote project xyz"

Is there a way to do this currently with this app? If not does the GitLab API support execution of manual triggers such that this could be done reasonably from Alexa?. I would be willing to contribute.

@nfriend
Copy link
Owner

nfriend commented May 31, 2021

@rcollette I think this might be possible, depending on what you need.

Check out the Pipeline variables section of the README. If you can build your .gitlab-ci.yml in such a way that the "promote" jobs are regular jobs that only run when certain variables are populated, then I think it should be possible to do what you want with a job like this:

deploy_to_qa:
  script:
    - echo 'Deploying to qa....'
  only:
    variables:
      - $LAB_ASSISTANT && $LAB_ASSISTANT_TEST

This job would be triggered by a phrase like "Alexa, start a new test pipeline".

The caveat is that Lab Assistant always creates a new pipeline. It can't trigger manual jobs on existing pipelines. So I think this is unlikely to work for most projects that use trunk-based deployments, since this would always deploy the latest code to the target environment.


One other thought I had: if you are able to build a shell script that can perform the logic you want using the GitLab API, another approach is to have Alexa trigger a "dummy" job whose only job is to trigger the shell script, which then performs the logic you need.

@rcollette
Copy link
Author

I would probably have to use the latter approach. But I'm starting to wonder if this will be sufficiently useful for me. Without notifications of a pipeline pending manual approval (as mentioned in my other issue), I would wind up having to be in gitlab to check status anyway. I definitely don't want my pipeline coupled to Alexa with special "announcement" jobs or scripting since on my team I may be the only team using it.

@nfriend
Copy link
Owner

nfriend commented Jun 4, 2021

@rcollette Makes sense! I agree the lack of notification support is a huge missing feature.

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

No branches or pull requests

2 participants