Running a Terraform process inside Rundeck - terraform

I'm discovering Rundeck; is there a way to create and run a Terraform process from inside Rundeck?
Thanks in advance
Regards

You can call your Terraform scripts from the command step or the script step on your workflow in the same way you can call any program. Here you can see a complete example of Rundeck+Terraform integration (and about how to automate your deploys).
UPDATE: Also you can test (and collaborate) with this unofficial plugin.

Related

How to run a python script in Bamboo server?

I'm new to Devop's field. I wanted to run python script using bamboo server. Can anyone help me with the proper Documentation or any steps?
You have to be much more specific here:
Do you have Bamboo Project/Plan ready?
Do you want to run the script on a remote PC? If so, do you have a Bamboo Agent installed on the PC?
If you have all of the above ready, just create a Job in your Plan. Then create a Task of Builder/Script type. Simplest example of the Script Task would be as on the following screenshot:
bamboo task to run a python script

Variable substitution in build pipeline

There are tons of resources online on how to replace JSON configuration files in a release pipeline like this one. I configured this. It works. However, we have multiple integration tests which reach the database too. These tests are run during build time. I haven't seen any option yet to replace config values in the build pipeline. Does it exist? Or do I really have to use this custom task (see screenshot below)?
There is an out-of-the-box task since recently by Microsoft. It's called File Transform. It's currently in preview but it works really well! Haven't had any issues whatsoever with it and it works the same as you would configure it in the release pipeline. Would recommend this any day!
Below you can see my configuration.
There is no out-of-the-box task only to replace tokens/values in files (also in the release pipline the task is Azure App Service Deploy and not only for replace json configuration).
You need to use an external extension from here or write a PowerShell script for that.

How to automate a Jenkins task using groovy script which runs on script console

I have groovy script which runs on jenkins script console. My objective here is to automate the process which should run everyday.
Could you guys help me in achieving this task?
There are different ways you can automate it, but you will need to install one of the below plugins:
https://wiki.jenkins-ci.org/display/JENKINS/Groovy+plugin
https://wiki.jenkins-ci.org/display/JENKINS/Groovy+Postbuild+Plugin
Scriptler plugin is another plugin.
Then,
- Create a Jenkins Job
- Add (system groovy build action or groovy post build action)
- Run and Test
I hope it helps.
Cheers

AWS CloudFormation bash deploy script vs template commands

From what I understand, CloudFormation template can retrieve a file from remote and run it (Ex: bash shell), for example: download a bash script to install Graphite/OpenTSDB RRD tools.
My question is: is there any best practice between using CloudFormation template commands to do installation steps by steps vs using CloudFormation template to retrieve the bash script to run installation?
Thanks
There is no "best" way to do it, there are only lots of different options with different trade-offs.
Putting scripts in your CF template quickly becomes tiresome because you have to quote your data.
Linking to shell scripts can get complex because you have to specify everything in detail, and the steps can get brittle.
After a while, you'll want to use Puppet or Chef. These let you declare what you want "Apache 2.1 should be installed, the config file should look like this.." instead of specifying how it should be done. This can keep complex things organized. (But has a learning curve. Look into OpsWorks.)
After that, you'll want to bundle your image into an AMI (speeds things up if your build take a while, and relies on other servers on the internet being up to install!)
I'd suggest you use user-data, given as a parameter to your template. whether it is saved locally or remotely, it is best to separate your infrastructure details (i.e the template) from the boot logic (the shell script). the user data can be a shell script, and it will get invoked when your instances boot.
Here's an example of providing user-data as a parameter:
"Parameters":{
"KeyName":{
"Description":"N/A",
"Type":"String"
},
"initScript":{
"Description":"The shell script to be executed on boot",
"Type":"String"
},
},
"Resources":{
"workersGroup1":{
"GlobalWorker":{
"Type":"AWS::EC2::Instance",
"Properties":{
"InstanceType":"t1.micro",
"ImageId":"ami-XXXX",
"UserData":{"Fn::Base64":{"Fn::Join":["", [{"Ref":"initScript"}]]}},
...

jenkins script console: list of available jenkins methods?

I would like to use the jenkins script console some more.
Where do I have to look in order to find a list of available Objects/Methods that I can use via groovy? Is there something online? Should I browse the source on Github? Where would I start?
Like in this example, how would I have known that hudson.model.Hudson.instance.pluginManager.plugins exists and is ready to be called from the jenkins script console?
println(hudson.model.Hudson.instance.pluginManager.plugins)
Thanks!
You are looking for Jenkins Main Module API.
You may find this answer helpful in getting yourself on your way.
You can enter a groovy script in the script console.
The complete API can be found at the jenkins javadoc.

Resources