diff --git a/tfgrid3/jenkins/README.md b/tfgrid3/jenkins/README.md index 4108cef7..6c58caa1 100644 --- a/tfgrid3/jenkins/README.md +++ b/tfgrid3/jenkins/README.md @@ -1,17 +1,41 @@ -# MariaDB +# Jenkins TF Image -the image contains: +A Docker-based flist used to deploy Jenkins on the Threefold Grid. This image sets up a Jenkins server with the ability to configure the admin username and password through environment variables, enabling automated setup without manual intervention. The image also includes SSH capabilities, allowing remote access to the Jenkins server. -- mariadb server -- node exporter -- mysqld exporter +## How to Use -## ports +1. **Build the Image**: + - Convert the Docker image into a flist. -- `9500` for mysqld exporter -- `9501` for node exporter +2. **Upload the Flist**: + - Upload the flist to hub.grid.tf using the UI or via `curl` with an [API token](https://hub.grid.tf/token). -## image +3. **Deploy on the Threefold Grid**: + - Deploy a VM on the Threefold Grid and use this flist as the root filesystem. + - Ensure the necessary environment variables (as outlined below) are passed during deployment. -- docker: omarabdul3ziz/mariadb -- [flist](https://hub.grid.tf/omarabdulaziz.3bot/omarabdul3ziz-mariadb-latest.flist) \ No newline at end of file +## Environment Variables + +To configure the Jenkins setup, you need to provide the following environment variables: + +- `JENKINS_ADMIN_USERNAME`: Username for the Jenkins admin account. +- `JENKINS_ADMIN_PASSWORD`: Password for the Jenkins admin account. +- `SSH_KEY`: SSH public key for remote access. This key will be added to the `authorized_keys` file of the root user. + +## Jenkins Configuration +The image includes a Groovy script that automatically creates the Jenkins admin user based on the provided environment variables. This script runs during the initial setup of Jenkins, bypassing the need for manual configuration through the Jenkins UI. + + +## Testing + +To test the Jenkins flist: + +### Deploy the VM: + +- Deploy a VM with the Jenkins flist on the Threefold Grid. +- Ensure that the environment variables `JENKINS_ADMIN_USERNAME` and `JENKINS_ADMIN_PASSWORD` are set. + +### Access Jenkins: + +- Once the VM is running, access Jenkins via the VM's IP address on port `9090`. +- Log in using the credentials specified in the environment variables.