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
stages: | |
- deploy | |
deploy_app: | |
image: bitnami/kubectl:latest | |
stage: deploy | |
environment: production | |
script: | |
- USER_TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token) | |
- CERTIFICATE_AUTHORITY_DATA=$(cat /var/run/secrets/kubernetes.io/serviceaccount/ca.crt | base64 -i -w0 -) | |
- kubectl config set-cluster k8s --server="https://kubernetes.default.svc" |
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
apiVersion: v1 | |
data: | |
index.html: | | |
hello default | |
kind: ConfigMap | |
metadata: | |
annotations: | |
kubectl.kubernetes.io/last-applied-configuration: | | |
{"apiVersion":"v1","data":{"index.html":"hello default\n"},"kind":"ConfigMap","metadata":{"annotations":{"qbec.io/component":"hello"},"labels":{"aaaa":"ccccc","qbec.io/application":"test","qbec.io/environment":"default"},"name":"demo-config","namespace":"default"}} | |
qbec.io/component: hello |
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
mkdir -p /tmp/1 | |
cd /tmp/1 | |
cat >Dockerfile <<\EOT | |
FROM i386/ubuntu:12.04 | |
RUN apt-get update \ | |
&& apt-get install -y firefox=11.0+build1-0ubuntu4 icedtea-6-plugin libstdc++5 | |
EOT | |
docker build -t firefox-jre . | |
xhost +local: | |
docker run -ti \ |
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 | |
onehost list -x | xmlstarlet sel -t -v '/HOST_POOL/HOST/VMS/ID' -n | sort | uniq -c | sort | while read dup vm; do | |
if [ "$dup" != "1" ]; then | |
echo "vm $vm duplicated $dup times, on hosts:" | |
onehost list -x | xmlstarlet sel -t -v "/HOST_POOL/HOST[VMS/ID/.=${vm}]/ID" -n | |
fi | |
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 | |
# | |
# Example usage: | |
# ./one_xmlrpc_client.sh one.vmpool.info i4:-1 i4:-1 i4:-1 i4:-1 | |
# | |
print_value() { | |
case "$1" in | |
string:*) echo ' <param><value><string>'${1##string:}'</string></value></param>' ;; | |
i4:*) echo ' <param><value><i4>'${1##i4:}'</i4></value></param>' ;; |
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
local job = { | |
script: ['echo 123'], | |
only: { refs: ['tags'] }, | |
}; | |
local ref(x) = { only+: { refs+: [x] } }; | |
job + ref('prod') |
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
local job = { | |
script: ['echo 123'], | |
only: { refs: ['tags'] }, | |
}; | |
local ref(x) = { only+: { refs: [x] } }; | |
job + ref('prod') |
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 our library | |
local jobs = import 'lib/jobs.libsonnet'; | |
// Define override functions | |
local ref(x) = { only+: { refs: [x] } }; | |
local tag(x) = { tags: [x] }; | |
local submodule(x) = { variables+: { GIT_SUBMODULE_STRATEGY: x } }; | |
{ | |
// Building docker-images |
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
{ | |
// Task for uilding docker-image | |
dockerImage(name):: { | |
tags: ['build'], | |
stage: 'build', | |
image: { | |
name: 'gcr.io/kaniko-project/executor:debug-v0.15.0', | |
entrypoint: [''], | |
}, | |
script: [ |
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
deploy:{{ environment }}:{{ app }}: | |
stage: deploy | |
tags: | |
- {{ environment }} | |
script: | |
- qbec apply {{ environment }} --root deploy/{{ app }} --force:k8s-context __incluster__ --wait --yes | |
only: | |
changes: | |
- deploy/{{ app }}/**/* | |
refs: |