Showing posts with label DevOps. Show all posts
Showing posts with label DevOps. Show all posts

Quick HOWTO: Run Loop in GitHub Actions

In GitHub Action workflows, there is no direct way to repeat the same job or step using variables. We have to use the "matrix" to achieve this.

Example:


my_loop_job:
name: loop job
runs-on: my-github-runners
strategy:
matrix:
my_variable: [ "var1", "var2", "var3" ]
        
steps:
- name: test loop
run: |
          echo "running the steps for $my_variable"
sh myscript.sh $



When using strategy matrix, it will create parallel jobs using the variables passed.  Maximum jobs matrix can create is 256 Jobs.


Quick HOWTO: Reset Jenkins Admin Password

To reset the jenkins admin password, You can simply disable the security in the config.xml file.

1. If your jenkins is running on the Linux OS, edit the below file.

vi /var/lib/jenkins/config.xml file.

2. Search for the word <useSecurity>true</useSecurity>
and change the word true to false

3. Restart the Jenkins server.
service jenkins restart

4. Now go to the Jenkins portal again and Jenkins will not ask any credentials this time. You navigate to "Manage Jenkins" to set the administrator password again.

5. Enable the security again by changing settings to <useSecurity>true</useSecurity> and restart the Jenkins again.

Note: 

If your jenkins is running on Windows OS, config.xml file located in C:\Program Files (x86)\Jenkis\ folder.