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 | |
# Change the date under CUTOFF_DATE to change how far back you want to delete | |
# Install the GitHub CLI tool by following the instructions in the official documentation: https://cli.github.com/manual/installation | |
# Make sure you auth first to github with 'gh auth login' | |
REPO_OWNER="OWNER" | |
REPO_NAME="REPO_NAME" | |
CUTOFF_DATE=$(date --date='30 days ago' +'%Y-%m-%dT%H:%M:%SZ') | |
PAGE=1 |
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
node { | |
// First parameter represents additional docker run options, second parameter is arguments passed to the image | |
// docker run [OPTIONS|<First parameter>] IMAGE [COMMAND] [ARG...|<Second parameter>] | |
docker.image('mesosphere/aws-cli').withRun('--entrypoint /bin/sh', '') { | |
stage('Build') { | |
sh 'aws --version' | |
} | |
} | |
} |
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
# Change the path below to your own audit log path. | |
/var/log/vault/audit.log { | |
rotate 30 | |
daily | |
# Do not execute rotate if the log file is empty. | |
notifempty | |
missingok | |
compress | |
# Set compress on next rotate cycl to prevent entry loss when performing compression. | |
delaycompress |
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
#!groovy | |
// imports | |
import com.cloudbees.jenkins.plugins.sshcredentials.impl.* | |
import com.cloudbees.plugins.credentials.* | |
import com.cloudbees.plugins.credentials.common.* | |
import com.cloudbees.plugins.credentials.domains.Domain | |
import com.cloudbees.plugins.credentials.impl.* | |
import hudson.util.Secret | |
import java.nio.file.Files |
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
def manager = org.jenkins.plugins.lockableresources.LockableResourcesManager.get() | |
def resources = manager.getResources().findAll{ | |
!it.locked | |
} | |
resources.each{ | |
manager.getResources().remove(it) | |
} | |
manager.save() |
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
// Harden Jenkins and remove all the nagging warnings in the web interface | |
import jenkins.model.Jenkins | |
import jenkins.security.s2m.* | |
Jenkins jenkins = Jenkins.getInstance() | |
// Disable remoting | |
jenkins.getDescriptor("jenkins.CLI").get().setEnabled(false) | |
// Enable Agent to master security subsystem |
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
node { | |
try { | |
stage('common build stage'){ | |
echo 'build ...' | |
} | |
currentBuild.result = "SUCCESS" | |
} catch(e) { | |
currentBuild.result = "FAIL" | |
} | |
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
""" | |
MIT License | |
Copyright (c) 2017 Michał Bultrowicz | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
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
--- | |
- name: Update apt cache | |
apt: update_cache=yes | |
- name: Install Ruby | |
apt: pkg=ruby2.0 state=present | |
- block: | |
- name: Get CodeDeploy version | |
set_fact: |
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
// The ArrayList of slaves is not serializable, so fetching them should be marked as @NonCPS so that | |
// no attempt is made to serialize and save the local state of the function. See here for details: | |
// https://github.com/jenkinsci/pipeline-plugin/blob/master/TUTORIAL.md#serializing-local-variables | |
@NonCPS | |
def getSlaves() { | |
def slaves = [] | |
hudson.model.Hudson.instance.slaves.each { | |
slaves << it.name | |
} | |
return slaves |
NewerOlder