32 lines
1.5 KiB
Bash
Executable File
32 lines
1.5 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
# A script to regenerate a list of roles and their CI status.
|
|
|
|
# Where are the roles stored locally?
|
|
directory="/home/robertdb/Documents/github.com/robertdebock"
|
|
|
|
# What is the pattern of the directory names?
|
|
pattern="ansible-role-"
|
|
|
|
# Print the header of the table.
|
|
echo "|Role name|Travis|GitHub Action|GitLab CI|Version|"
|
|
echo "|---------|------|-------------|---------|-------|"
|
|
|
|
# Loop over the found roles.
|
|
cd ${directory} ; ls -d "${pattern}"* | while read rolename ; do
|
|
|
|
# Find the short name, i.e. "httpd" instead of "ansible-role-httpd"
|
|
shortrolename=$(echo "${rolename}" | sed "s/^${pattern}//")
|
|
|
|
# Save the markdown per column in a variable, better readable loop.
|
|
galaxy="[${shortrolename}](https://galaxy.ansible.com/robertdebock/${shortrolename})"
|
|
travis="[](https://travis-ci.com/robertdebock/${rolename})"
|
|
github="[](https://github.com/robertdebock/${rolename}/actions)"
|
|
gitlab="[](https://gitlab.com/robertdebock/${rolename})"
|
|
version="[](https://github.com/robertdebock/${rolename}/releases)"
|
|
|
|
# Print the line of one role.
|
|
echo "|${galaxy}|${travis}|${github}|${gitlab}|${version}|"
|
|
|
|
done
|