Laur IVAN

Jenkins Pipeline Deployment Variants

Posted by in IT, Tutorial

This post outlined a list of steps in a pipeline. When building actual pipelines, I’ve noticed the deployment process is more than just deployment. I’ve identified several variants: orchestration deployment (e.g. helios deployment) file copy like this git update for e.g. assets repositories This might be useful if you’re building a mechanism based on a shared library. HTH, A little experiment: If you find this post and ad below useful, please check the ad out :-)

Rundeck – Speeding Up Even More the Cleaning Process

Posted by in IT, Tutorial

As I was running the script, I’ve noticed it ran very slow. I have left it for a few days to run (700K executions), I’ve noticed the speed increased linearly over time. As Rundeck has both DB and files to store its data, it looked to me that it was the file system which was the slow part. Sure enough, when I tried to access the directory where the execution data was stored, it was slow – 1.4M files would take a while to get organised :) To short out…read more

Delete Executions in Rundeck – Wrapping it all Up

Posted by in IT, Software, Tutorial

The previous posts have built the components to allow us to get projects, jobs, executions and remove executions from a Rundeck instance via its API. Now, we can just wrap them up :) The list of packages we need is:

For convenience, I’ve declared a bunch of constants we can use throughout the project:

As we already have all the helper functions defined, we only need to wrap them in a convenient execution command:

The logis is fairly simple: Get the list of projects For each project,…read more

Remove Executions in Rundeck

Posted by in IT, Tutorial

TL;DR: You have to get the executions’ list and remove the appropriate ones using hte API. Once we’ve managed to get the list of job executions, we can use the API to remove the relevant executions. The command is rather simple:

This method requires: server – the Rundeck’s server address port – the port on which we can connect to the Rundeck server api_key – the API key execution_ids – an array of valid execution IDs The function will try to remove all execution IDs in one go, since…read more

Get Job Executions in Rundeck

Posted by in IT, Tutorial

Following the previous articles, we are now in position to query job executions. The query is done via API as well. As a job can have an arbitrary number of executions, it’s advisable to use pagination. The code follows the same lines as the one in the previous entries:

This function builds the URL for the call and returns an XML string. Its parameters are: server – the rundeck server port – the rundeck server’s port api_key – the api key for rundeck job_id – one of the job…read more

Map Subdomains to Docker Containers with Synology

Posted by in IT, Tutorial

The other day I got fed up with having to insert diskstation.local:12345 to point towards an installed service on my NAS. I also thought that my SO has difficulties remembering all the ports (I do too) and cleaning up the browser cache doesn’t help either. So, I thought: Wouldn’t it be nicer if instead of disksation.local:32400 I could just type plex.laurii.lan? Yes! Yes, it would! :) So I started my quest to make things happen. Use case My se case is the following: As a local user, I want to…read more

List Rundeck Jobs for a Project

Posted by in IT, Software, Tutorial

Now that we Rundeck have a list of project names, we might want to see which jobs were created for each project. To do this, we need: The Rundeck instance’s address (server, port) The API key (api_key) A project’s name (project_name) First, we need to get the list of jobs for a project:

The result is also an XML, just like the one for the projects. Therefore, we need to parse it:

At the end of this exercise, we’ll have a list of job names (IDs). HTH, A…read more

List Rundeck Projects

Posted by in IT, Software, Tutorial

The other day I found out that Rundeck has an API which allows it to be controlled remotely by scripts. I’ve decided to write a script to list all the projects defined in a rundeck instance. Prerequisites Before you start, you need: The instance’s URL (server and port) An api key for the user Make sure the user has enough credentials to list the projects The code I’ve picked up Python as language for the task just because I’m more familiar with it in this context. Therefore, another dependency is…read more

Remove Large Files in Git

Posted by in Software, Tutorial

TL;DR: BFG is your friend. java -jar bfg.jar -b 50M myrepo-bfg.git for example The other day I’ve committed a rather large file by mistake (generated movie of the git commit history). This was a bit annoying because all other developers would have suddenly to check out a 1G file :( with no LFS support… As I took the opportunity to clean up the repository also, I’ve noticed the size of the cloned reop was rather huge! So, I was presented with several options Create a new repo with the cleaned…read more