This file contains 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
#!/bin/bash | |
pmt='apt' | |
pkgs=('python3-pip') | |
# Check the distribution | |
if [[ -f /etc/os-release ]]; then | |
source /etc/os-release | |
if [[ -n "$PRETTY_NAME" ]]; then | |
echo "Distribution: $PRETTY_NAME" |
This file contains 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
#!/bin/bash | |
version=$1 | |
service=$2 | |
function print_help() | |
{ | |
echo "Usage:" | |
echo "./installFrp.sh version serviceName" | |
echo "example ./installFrp.sh 0.49.0 frps" |
This file contains 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
wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh | |
chmod +x ubuntu-mainline-kernel.sh | |
mv ubuntu-mainline-kernel.sh /usr/local/bin/ | |
# search kernel match 5 | |
ubuntu-mainline-kernel.sh -r 5 | |
# install kernel v5.15.74 | |
ubuntu-mainline-kernel.sh -i v5.15.74 | |
This file contains 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 com.cloudbees.plugins.credentials.impl.* | |
import com.cloudbees.plugins.credentials.* | |
import com.cloudbees.plugins.credentials.domains.* | |
import com.cloudbees.jenkins.plugins.sshcredentials.impl.* | |
import groovy.json.JsonSlurper | |
def createCredentialsByJsonStr(credsJsonStr) { | |
jsonSlurper = new JsonSlurper() | |
creds = jsonSlurper.parseText(credsJsonStr) | |
creds.each{cred-> |
This file contains 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 groovy.json.JsonOutput | |
def get_credentials() { | |
def creds = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials( | |
com.cloudbees.plugins.credentials.common.StandardUsernameCredentials.class, | |
Jenkins.instance, | |
null, | |
null | |
) | |
credentials = [] | |
for(c in creds) { |
This file contains 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.* | |
import hudson.slaves.* | |
import hudson.slaves.EnvironmentVariablesNodeProperty.Entry | |
import hudson.plugins.sshslaves.verifiers.* | |
import groovy.json.JsonSlurper | |
// https://docs.cloudbees.com/docs/cloudbees-ci-kb/latest/client-and-managed-masters/create-agent-node-from-groovy | |
def createSlave(name, homeDir, host, port, credential, nodeDescription, numExecutors, labelString, mode, retentionStrategy) { | |
// Pick one of the strategies from the comments below this line |
This file contains 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.Hudson.instance.slaves | |
import groovy.json.JsonOutput | |
def getSlaves() { | |
slaves = [] | |
hudson.model.Hudson.instance.slaves.each{val-> | |
slave = [:] | |
slave['name'] = val.getNodeName() | |
slave['home_dir'] = val.getRemoteFS() | |
launcher = val.getLauncher() | |
slave['host'] = launcher.getHost() |
This file contains 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.* | |
import org.csanchez.jenkins.plugins.kubernetes.* | |
import org.csanchez.jenkins.plugins.kubernetes.volumes.workspace.EmptyDirWorkspaceVolume | |
import org.csanchez.jenkins.plugins.kubernetes.volumes.HostPathVolume | |
//since kubernetes-1.0 | |
//import org.csanchez.jenkins.plugins.kubernetes.model.KeyValueEnvVar | |
import org.csanchez.jenkins.plugins.kubernetes.PodEnvVar | |
//change after testing | |
ConfigObject conf = new ConfigSlurper().parse(new File(System.getenv("JENKINS_HOME") + '/jenkins_config/kubernetes.txt').text) |