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
/* | |
* Copyright 2020 Spotify AB | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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 jenkins.model.Jenkins; | |
import com.cloudbees.hudson.plugins.folder.Folder | |
import com.cloudbees.plugins.credentials.Credentials | |
import com.cloudbees.plugins.credentials.CredentialsProvider | |
def folderName = "folder/subfolder/subsubfolder" | |
def credentialId = "credential-id" | |
def folder = Jenkins.getInstance().getAllItems(Folder.class).find({ it -> it.getFullName().contains(folderName) }) |
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
fdisk -l | |
# Expansão do disco | |
1. Liste os discos e encontre o novo disco | |
``` | |
lsblk | |
``` |
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 jenkins.model.Jenkins | |
import hudson.model.Job | |
import jenkins.model.BuildDiscarderProperty | |
import hudson.tasks.LogRotator | |
def total = 0 | |
// LogRotator ( daysToKeep, numToKeep, artifactDaysToKeep, artifactNumToKeep) | |
// daysToKeep: If not -1, history is only kept up to this days. | |
// numToKeep: If not -1, only this number of build logs are kept. |
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
pipeline { | |
agent any | |
options { | |
preserveStashes(buildCount: 10) | |
buildDiscarder(logRotator(numToKeepStr:'10')) | |
} |
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
<?php declare(strict_types=1); | |
require_once 'vendor/autoload.php'; | |
use Siler\Swoole; | |
use Siler\GraphQL; | |
use Siler\Http\Response; | |
// Enable CORS for GraphiQL |
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 org.jenkinsci.plugins.credentialsbinding.impl.CredentialNotFoundException | |
import hudson.util.Secret | |
import com.cloudbees.plugins.credentials.CredentialsScope | |
import org.jenkinsci.plugins.plaincredentials.impl.StringCredentialsImpl | |
import com.cloudbees.plugins.credentials.domains.Domain | |
node { | |
try{ | |
withCredentials([ |
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
def total = 0 | |
def findInScript = "" | |
def findInName = "" | |
Jenkins.getInstance().getAllItems().each { | |
if(it?.getDescriptor().getDisplayName() == "Pipeline") { | |
if ( | |
it.getDefinition()?.getScript()?.contains(findInScript) && | |
it.getFullName().contains(findInName) | |
){ | |
println "${it.getFullName()}" |
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
Jenkins.getInstance().getAllItems().each { | |
if(it?.getDescriptor().getDisplayName() == "Pipeline") { | |
if ( | |
it.getFullName().contains('JOB_NAME') | |
){ | |
println "Deleting... ${it.getFullName()}" | |
it.delete() | |
} | |
} | |
} |