sudo apt-get install openjdk-8-jdk
# don't worry, you can apt-get multiple java versions
sudo apt-get install openjdk-11-jdk
#sudo apt-get install openjdk-... <tab complete to see all available versions>
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 | |
brew tap AdoptOpenJDK/openjdk | |
# can install adoptopenjdk8 or adoptopenjdk11 | |
brew cask install adoptopenjdk8 | |
# list all installed | |
# /usr/libexec/java_home -V | |
# switch java version, use 1.8, or 11 |
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 | |
# install | |
brew cask install graalvm/tap/graalvm-ce-java11 | |
# update | |
# brew cask upgrade graalvm/tap/graalvm-ce-java11 | |
# update JAVA_HOME | |
export JAVA_HOME=/Library/Java/JavaVirtualMachines/graalvm-ce-java11-20.1.0/Contents/Home |
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 xml.etree.ElementTree as ET | |
import re | |
def find_reports_dir(pom_file): | |
""" Return the report directory specified in the pom """ | |
# extract and set namespace | |
root = ET.parse(pom_file).getroot() | |
m = re.findall(r'{(.*?)}', root.tag) | |
namespace = m[0] if m else '' | |
ns = {'maven': namespace} |
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
"""StepImplementer for the upload-container-image step using curl. | |
TODO: doc me | |
Mandatory Inputs: | |
1. | |
# entire file path of where the signature is | |
#includes temporary directory where signature is located | |
'container-image-signature-file-path' |
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
kind: "BuildConfig" | |
apiVersion: "build.openshift.io/v1" | |
metadata: | |
name: "nodejs-sample-pipeline" | |
spec: | |
strategy: | |
jenkinsPipelineStrategy: | |
jenkinsfile: |- | |
// path of the template to use | |
def templatePath = 'nodejs-mongodb-example' |
- Valid image in some registry, say something like
docker.io:/jonnyman9/hello-node:latest
- Valid signature being served by some signature server, say something like
https://sigserver.com
- You have access to the public PGP key used to sign the image, say something like
pubring.gpg
There really only is 1 important file we need, the machine-config.yaml
that forces the host to verify the image against some signature when pulling it in. This one file however is made up of 3 smaller components:
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 | |
# Taken from: https://superuser.com/questions/153245/how-can-i-open-google-chrome-via-command-line-with-a-url-in-incognito-mode | |
url() { | |
url=$([[ $1 =~ ^[a-zA-Z]{1,}: ]] && printf '%s\n' "$1" || printf '%s\n' "http://$1") | |
open -a 'Google Chrome' "$url" | |
} |
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 | |
cat ~/.kube/config | yq e '.clusters.[].name' - | while read -r line; do oc config unset contexts.$line; done | |
cat ~/.kube/config | yq e '.contexts.[].name' - | while read -r line; do oc config unset contexts.$line; done | |
cat ~/.kube/config | yq e '.users.[].name' - | while read -r line; do oc config unset contexts.$line; done | |
echo 'done' |