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
#!/usr/bin/env groovy | |
/** | |
* List all Git branches of a repo. | |
* @author [email protected] | |
* @since Jenkins 2.204.1 | |
* @params String url for Git repo URL, String credentialID, Bool activeChoice if ActiveChoice plugin used, String defaultBranch | |
* @return String array of branch names | |
* | |
* Dependencies: |
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
#!/usr/bin/env groovy | |
/** | |
* Gets last successful build number | |
* @author [email protected] | |
* @since Jenkins 2.204.1 | |
* @param String job name | |
* @return String number of build number | |
* | |
*/ |
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
#!/usr/bin/env groovy | |
/** | |
* Reads environment variables from a property file, and loads them into Jenkins ENV | |
* @author [email protected] | |
* @since Jenkins 2.204.1 | |
* @param String path | |
* @return String array | |
* | |
* Example property file: |
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
#!/usr/bin/env groovy | |
/** | |
* Lists all enabled Jenkins jobs by name. | |
* @author [email protected] | |
* @since Jenkins 2.204.1 | |
* @param Bool includeDisabled to include also disabled jobs, default false (No). | |
* @return String array of jenkins jobs names | |
* | |
*/ |
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
#!/usr/bin/env groovy | |
/** | |
* Returns an emoji from a pool based on the build status, can be used with Slack notifications | |
* @author [email protected] | |
* @since Jenkins 2.204.1 | |
* @param String status default 'success' | |
* @return String emoji | |
* | |
*/ |
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
#!/usr/bin/env groovy | |
/** | |
* Checks URL availability via curl | |
* @author [email protected] | |
* @since Jenkins 2.204.1 | |
* @param String url | |
* @return String Zero if succeeded, error if not. | |
* | |
*/ |
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
# installs gems then serves web on http://0.0.0.0:4000 | |
# | |
## you may want to exclude vendor/bundle in _config.xml | |
# | |
## For Github pages, refer to https://pages.github.com/versions/ to find supported Jekyll version | |
## as in your Gemfile. | |
# | |
export JEKYLL_VERSION=3.8.5 | |
docker run --rm -it \ | |
-v "$(pwd):/srv/jekyll" \ |
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 | |
# Either to compile single file passed in args | |
# OR to go over all .tex files in directory - in batch mode. | |
# compile the tex file in arguments | |
[ -f "$1" ] && { docker run -i -w "/doc" -v "$PWD":/doc thomasweise/texlive xelatex -interaction=nonstopmode -halt-on-error $1; exit 0; } | |
# batch mode - compile all tex files | |
docker run -i -w "/doc" -v "$PWD":/doc thomasweise/texlive bash -c 'for file in $(find . -maxdepth 1 -name "*.tex"); do echo "Generating pdf for $file ..." && xelatex -interaction=batchmode -halt-on-error $file; done' |
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 | |
# Runs Jnekins in Docker container. | |
# TODO: auto add plugins and default configs. | |
# Logs customization from https://hub.docker.com/_/jenkins/ | |
mkdir data | |
cat > data/log.properties <<EOF | |
handlers=java.util.logging.ConsoleHandler | |
jenkins.level=FINEST | |
java.util.logging.ConsoleHandler.level=FINEST |
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
AWS_BUCKET="xyz" | |
AWS_REGION="eu-central-1" | |
AWS_ID="11111111111" | |
AWS_USER="s3-user" | |
# TODO: review access | |
cat > policy.json << EOL | |
{ | |
"Version": "2012-10-17", | |
"Id": "Policy1554206237047", |
OlderNewer