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/sh | |
# install needed curl package | |
sudo apt install --no-install-recommends curl -y | |
# install kubectl | |
# https://github.com/kubernetes/minikube/issues/3437#issuecomment-449408316, maybe use https://storage.googleapis.com/minikube/releases/v0.30.0/docker-machine-driver-kvm2 | |
curl -Lo /tmp/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \ | |
chmod +x /tmp/kubectl && \ | |
sudo mv /tmp/kubectl /usr/local/bin/kubectl | |
# kubectl tab completion | |
sudo sh -c 'echo "source <(kubectl completion bash)" > /etc/bash_completion.d/kubectl' |
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 | |
node { | |
// Need to replace the '%2F' used by Jenkins to deal with / in the path (e.g. story/...) | |
// because tests that do getResource will escape the % again, and the test files can't be found | |
ws("workspace/${env.JOB_NAME}/${env.BRANCH_NAME}".replace('%2F', '_')) { | |
// Mark the code checkout 'stage'.... | |
stage 'Checkout' | |
checkout scm | |
// Mark the code build 'stage'.... |
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 jenkins.model.Jenkins; | |
import hudson.model.FreeStyleProject; | |
import hudson.tasks.Shell; | |
job = Jenkins.instance.createProject(FreeStyleProject, 'job-name') | |
job.buildersList.add(new Shell('echo hello world')) | |
job.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
/* | |
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp | |
server, but for some reason omit a client connecting to it. I added an | |
example at the bottom. | |
Save the following server in example.js: | |
*/ | |
var net = require('net'); |
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
if [[ $BUILD_STATUS == "success" ]] | |
then | |
export STATUS="success" | |
else | |
export STATUS="failure" | |
fi | |
curl "https://api.github.com/repos/justincampbell/my_repo/statuses/$GIT_COMMIT?access_token=abc123" \ | |
-H "Content-Type: application/json" \ | |
-X POST \ |