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 { | |
def hostname = readFile '/etc/hostname' | |
echo "Local node hostname: $hostname" | |
} | |
node('kubernetes') { | |
def hostname = readFile '/etc/hostname' | |
echo "Kubernetes slave hostname: $hostname" | |
} |
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 | |
KUBE_TOKEN=`cat ~/.kube/config | grep token | awk -F " " '{print $2}'` | |
curl -sSk -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" \ | |
-H "Sec-WebSocket-Key: MKuU3hrynEXL1F00D3ZyOQ==" \ | |
-H "Sec-WebSocket-Version: 13" \ | |
-H "Authorization: Bearer $KUBE_TOKEN" $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
nohup sh -c echo $$$$ > '/home/jenkins/workspace/workspace/test-workflow17/.5fc8d3e8/pid' | |
jsc=durable-d0ccb5e108e2e57946d9472370a62c5f | |
JENKINS_SERVER_COOKIE=$$jsc '/home/jenkins/workspace/workspace/test-workflow17/.5fc8d3e8/script.sh' > '/home/jenkins/workspace/workspace/test-workflow17/.5fc8d3e8/jenkins-log.txt' 2>&1 | |
echo $$? > '/home/jenkins/workspace/workspace/test-workflow17/.5fc8d3e8/jenkins-result.txt' |
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
oadm policy add-scc-to-user privileged admin | |
oadm policy add-scc-to-user privileged system:serviceaccount:fabric8 |
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
bash #oc exec mypod-17817053-320d-4659-8b58-dd45f3c09544 ls | |
Error from server: pods "mypod-17817053-320d-4659-8b58-dd45f3c09544" is forbidden: unable to validate against any security context constraint: [provider restricted: .spec.containers[0].securityContext.privileged: invalid value 'true', Details: Privileged containers are not allowed provider restricted: .spec.containers[0].securityContext.VolumeMounts: invalid value 'workspace', Details: Host Volumes are not allowed to be used] |
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
drwxr-xr-x. 6 root root 101 Dec 1 11:15 . | |
drwxr-xr-x. 3 root root 4096 Dec 1 11:15 .. | |
drwxr-xr-x. 2 root root 22 Dec 1 11:15 .f0a5421a | |
drwxr-xr-x. 7 root root 4096 Dec 1 11:15 .git | |
??????????? ? ? ? ? ? .gitignore | |
drwxr-xr-x. 2 root root 24 Dec 1 11:15 .sti | |
??????????? ? ? ? ? ? README.md | |
??????????? ? ? ? ? ? pom.xml |
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
# with docker workflow | |
node('docker') { | |
docker.image('maven').inside { | |
git 'https://github.com/fabric8io/example-camel-cdi' | |
sh 'mvn clean install' | |
} | |
} | |
#without docker workflow | |
node('maven') { |
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
<?xml version="1.0"?> | |
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns="http://jboss.org/schema/arquillian" | |
xsi:schemaLocation="http://jboss.org/schema/arquillian | |
http://jboss.org/schema/arquillian/arquillian_1_0.xsd"> | |
<extension qualifier="kubernetes"> | |
<property name="dependencies">mvn:groupId/artifactId/version/json</property> | |
</extension> |
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 | |
function cleanup { | |
echo "Cleaning Up!" | |
echo "Container $HOSTNAME exited" > /path/to/volume | |
} | |
echo "My pid is $$" | |
trap 'kill ${!}; cleanup' SIGTERM | |
trap 'kill ${!}; cleanup' SIGKILL |
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 | |
IN=`echo $1 | base64` | |
SUFFIX="::::MAGIC::::" | |
MASTER_KEY=`cat /var/jenkins_home/secrets/master.key` | |
HASHED_MASTER_KEY=`echo -n $MASTER_KEY | sha256sum | cut -d " " -f 1` | |
HASHED_MASTER_KEY_16=${HASHED_MASTER_KEY:0:16} | |
openssl enc -d -aes-128-ecb -in /var/jenkins_home/secrets/hudson.util.Secret -K $HASHED_MASTER_KEY -out /tmp/hudson.key | |
HUDSON_KEY=`cat /tmp/hudson.key` | |
HUDSON_KEY_TRIMMED=${HUDSON_KEY:0:-16} | |
HUDSON_KEY_16=${HUDSON_KEY_TRIMMED:0:16} |