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
+(wf:12): main(): [[ 0 -eq 0 ]] | |
+(wf:12): main(): __oo__presetShellOpts=hxBE | |
+(wf:12): main(): __oo__insideTryCatch+=1 | |
+(wf:12): main(): set -e | |
+(wf:12): main(): true | |
+(wf:13): main(): ls /root2 | |
ls: /root2: No such file or directory | |
++(wf:13): main(): __EXCEPTION_TYPE__=/root2 | |
++(wf:13): main(): command_not_found_handle ls /root2 | |
++(exception.sh:30): command_not_found_handle(): local 'IFS= |
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: | |
- build | |
- test | |
- deploy | |
variables: | |
GIT_STRATEGY: clone | |
cache: | |
key: ${CI_PROJECT_ID} |
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 bash | |
secret_name="$(kubectl get serviceaccount helm -o json | jq -Mr '.secrets[].name')" | |
kubectl get secrets ${secret_name} -o json | jq -Mr '.data["ca.crt"]' | base64 -D > ca.crt | |
curl --cacert ca.crt -H "Authorization: Bearer $(kubectl get secrets ${secret_name} -o json | jq -Mr '.data.token' | base64 -D)" "https://$(minikube ip):8443" |
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 bash | |
export MACHINE_DRIVER="digitalocean" | |
export DIGITALOCEAN_IMAGE="centos-7-x64" | |
export DIGITALOCEAN_PRIVATE_NETWORKING="true" | |
export DIGITALOCEAN_REGION="fra1" | |
export DIGITALOCEAN_SIZE="s-1vcpu-1gb" | |
export DIGITALOCEAN_SSH_KEY_FINGERPRINT="56:46:4b:c0:d0:fd:5b:7f:94:91:6d:39:30:ea:ef:df" | |
export DIGITALOCEAN_MONITORING="true" |
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
``` | |
[root@node-01 ~]# iptables-save | |
# Generated by iptables-save v1.4.21 on Thu May 3 20:27:51 2018 | |
*nat | |
:PREROUTING ACCEPT [0:0] | |
:INPUT ACCEPT [0:0] | |
:OUTPUT ACCEPT [0:0] | |
:POSTROUTING ACCEPT [0:0] | |
:DOCKER - [0:0] | |
-A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER |
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 bash | |
set -u | |
set -e | |
set -o pipefail | |
GCP_PROJECT="$(gcloud config list --format 'value(core.project)')" | |
GCP_SERVICES=( | |
"storage-api.googleapis.com" |
- У нас есть один GCP проект в рамках которого необходимо реализовать отдельную инфраструктуру для
production
иqa
(staging
иreview
) окружений. - Необходимо разделить жизненые циклы инфраструктуры от кода самого сервиса.
- В рамках сервиса мы оперируем следующими окружениями:
production
– название говорит само за себя.staging
– окружение в котором проверяем релиз перед тем как разварачивать его вproduction
окружении.review
– динамическое окружение в котором разработчик может посмотреть результат своей работы не дожидаясь мерджа задачи вmaster
.
- В рамках инфраструктуры мы оперируем следующими окружениями:
production
– название говорит само за себя, используется дляproduction
окружения сервиса.
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 | |
SERVICE_DIR=/etc/service/$1 | |
COMMAND=$2 | |
if test ! -d $SERVICE_DIR; then | |
echo "Service not found: $1" >&2 | |
exit 1 | |
fi | |
case $COMMAND in |