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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use VCS, CLI and API driven workflows together on same workspace #596
Comments
Hello @kspradheep.
I guess that to support pull request automation we will have to handle some webhook from bitbucket and trigger the job, at least from my side I don't have the bandwidth to do all the research to check how it should work. If someone would like to help with us to add that feature any contribution is welcome in this project Regards. |
Maybe you could check atlantis, that project support pull request automation |
Hi @alfespa17 Thanks for the quick reply. Understood. How to run terraform plan from different branch like feature branch? Ideally we want to run dry-runs (terraform run excludes apply) from local machine through CLI driven workflow or run from feature branch. After git changes merged to main/master branch VCS workflow to run plan and apply. Would be nice to have something like this https://docs.scalr.io/docs/workspaces-runs |
Hello @kspradheep If you want to use a feature branch, you will have to override the default branch in the workspace using the API, something like the following:
After you have updated the value you could run the new job. By the way you could build custom jobs, we do that using templates and extensions, that would be like the equivalent for workspace runs in scalr to build like a custom flow |
@alfespa17 workspace branch update using API throws 415 response code. Also, trying to configure terrakube cli but login failing on tenant id. https://docs.terrakube.io/user-guide/terrakube-cli/getting-started#authentication doc has Azure example. I'm using Dex OIDC connector. What is TERRAKUBE_TENANT_ID? |
Your are missing the content type application/vnd.api+json The CLI won't work it hasn't been update in a long time, it is no even compatible with Dex, there is an issue about that |
Hi @alfespa17 I configured cli-driven workflow and noticed some issues.
How to cancel this run? Thanks! |
For the first one there is an open issue check here For the second issue I will have to check the code, which terrakube version are you using? |
Chart: terrakube-3.10.2 |
Ok, let me check because discard logic should work |
I think I found the issue I created a small fix, maybe you could override the API version and use 2.17.3-beta.1 to test |
Okay, do I need to override just api component or all (api, executor, ui and registry)? |
Just the API |
okay, it worked and can't reproduce it for new runs however it didn't work for the old run. How to kill old run?
|
I think I can add some logic so jobs gets cancelled after some period of time like 6 hours, I will do that tomorrow, other option is to go to the database and change the job status to failed |
Assume I created a new template and wanted to use for terraform CLI operations. How do I change job template for workspace? |
Not sure what you are trying to do, but you can go to the organization settings and you will find an option for templates, there you will find some special templates that are used specifically for CLI driven workflow. You could change those templates if you want, but you will have to be very carefull because you could break the internal logic for the CLI driven worlkflow. Maybe you could try to explain why you want to change the templates logic so I can get more context and help you a little bit |
My use case: Run terraform operations from both UI (VCS) and CLI for same workspace. |
Not sure if you can do that with terraform cloud, I will have to check the terraform CLI code to validate if that is possible |
@alfespa17 any updates? |
Sorry I have been a little busy I will try to check next week. |
I added this feature you can now run a job using the terraform CLI with a workspace using a private VCS connection, maybe you can test it to see if you can find some bug. You could test version "2.19.0-beta.1" |
@alfespa17 It's triggering a job from CLI but not taking locally changed terraform files. It's using VCS repo code scripts. This not helps to test my terraform changes locally before push to master/main branch. |
@alfespa17 is above behavior expected? |
Hello @kspradheep I was testing but I am not facing your issue: I have this workspace using a VCS github connection that is working correctly: I did some changes in my local directory to simulate changes that I could test adding the backend.tf with the following:
Then I can run:
And it is working as expected running my local changes remotely:
Could you test with version "2.19.0-beta.2"?? |
Hello @alfespa17 I'm using "2.19.0-beta.2". The test case I did was changing input variable values. Example:
|
I think it should work if you use a terraform.auto.tfvars file locally to put the variables |
I tried with terraform.auto.tfvars and terraform.tfvars but not working. |
Maybe adding a var could help to reproduce your issue, I will check tomorrow |
I did some tests and I was able to add variables using terraform.auto.tfvars and also adding the terraform variable from the UI and trigger the job using the CLI driven workflow. I have no idea how to reproduce your issue. If you could create a sample repository with your test case I will be happy to help you, but right not I am out of ideas :( |
these are the steps I performed:
Did you perform these steps in your tests? |
@alfespa17 are you able to reproduce the issue with above steps? |
@alfespa17 any updates? |
Feature description 馃挕
Hello,
We use hosted bitbucket server and configured a workspace with VCS workflow but don't see plans get trigger automatically when pullreuqest opened or merged. Everytime I had to run job from UI. How to configure triggers? And how to run job from feature branches?
Is it possible to run CLI driven workflow for a workspace that was configured VCS workflow already? Basically I would like to test my changes before commit and push changes to remote branch.
Thanks!
Anything else?
No response
The text was updated successfully, but these errors were encountered: