This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Delete old artifacts that fills up the disk on the master node. | |
| // Run this from the Jenkins console (Manage Jenkins, Manage Nodes, master, Script Console) | |
| def project = Jenkins.get().getItemByFullName('your-project-id') | |
| def jobs = project.getAllJobs() | |
| def total_size = 0 | |
| jobs.each{ job -> | |
| def builds = job.getBuilds() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import hudson.model.* | |
| import jenkins.model.Jenkins | |
| def q = Jenkins.instance.queue | |
| q.items.findAll { it.task.name }.each { q.cancel(it.task) } | |
| for (aSlave in hudson.model.Hudson.instance.slaves) { | |
| if (aSlave.getComputer().isOffline() /* || aSlave.getComputer().isOnline() */) { | |
| aSlave.getComputer().setTemporarilyOffline(true,null); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -vkG 'https://<influxdb_url>/query?db=<DATABASE>&epoch=ns' \ | |
| -u *****:******** \ | |
| --data-urlencode "q=SELECT * FROM jenkins_data WHERE prefix='hero'" |\ | |
| jq -r "(.results[0].series[0].values[][0])" > delete_timestamps.txt | |
| for i in $(cat delete_timestamps.txt); do | |
| echo $i; | |
| curl -G 'https://<influxdb_url>/query?db=<DATABASE>=ns' \ | |
| -u ****:******** \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo sqlite3 /data/grafana/grafana.db | |
| update user set is_admin = 1 where login="blahblah"; | |
| .exit | |
| sudo systemctl restart grafana-server |
OlderNewer