git clone https://gist.github.com/dd6f95398c1bdc9f1038.git vault
cd vault
docker-compose up -d
export VAULT_ADDR=http://192.168.99.100:8200
Initializing a vault:
vault init
git clone https://gist.github.com/dd6f95398c1bdc9f1038.git vault
cd vault
docker-compose up -d
export VAULT_ADDR=http://192.168.99.100:8200
Initializing a vault:
vault init
Also works across git branches if you keep the intermediate build images around, e.g. those <none>
images in the docker images
output.
FROM golang:1.12 AS builder
# enable Go modules support
ENV GO111MODULE=on
WORKDIR $GOPATH/src/github.com/myrepo/myapp
http { | |
log_format bodylog '$remote_addr - $remote_user [$time_local] ' | |
'"$request" $status $body_bytes_sent ' | |
'"$http_referer" "$http_user_agent" $request_time ' | |
'<"$request_body" >"$resp_body"'; | |
lua_need_request_body on; | |
set $resp_body ""; | |
body_filter_by_lua ' |
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
) | |
func dumpMap(space string, m map[string]interface{}) { | |
for k, v := range m { | |
if mv, ok := v.(map[string]interface{}); ok { |
#!/usr/bin/env bash | |
set -e | |
CONTEXT="$1" | |
if [[ -z ${CONTEXT} ]]; then | |
echo "Usage: $0 KUBE-CONTEXT" | |
exit 1 | |
fi |
export TF_CREDS=~/.config/gcloud/terraform-admin.json | |
# create service account in Terraform Admin Project | |
gcloud iam service-accounts create terraform \ | |
--display-name "Terraform Admin Account" | |
# download JSON credentials | |
gcloud iam service-accounts keys create ${TF_CREDS} \ | |
--iam-account terraform@${TF_ADMIN}.iam.gserviceaccount.com |
export TF_CREDS=~/.config/gcloud/terraform-admin.json | |
# create service account in Terraform Admin Project | |
gcloud iam service-accounts create terraform \ | |
--display-name "Terraform Admin Account" | |
# download JSON credentials | |
gcloud iam service-accounts keys create ${TF_CREDS} \ | |
--iam-account terraform@${TF_ADMIN}.iam.gserviceaccount.com |
variables: | |
GCP_ZONE: us-central1-a | |
stages: | |
- npm-install | |
- push | |
npm-install: | |
image: node:8-alpine | |
stage: npm-install |
# create a new service account with a descriptive name | |
# I chose 'hello-spring-cloud-gcp-app' for mine, but it can be any name you like | |
# just know that a service account name must be between 6 and 30 characters (inclusive), must begin with | |
# a lowercase letter, and consist of lowercase alphanumeric characters that can be separated by hyphens. | |
$ gcloud iam service-accounts create hello-spring-cloud-gcp-app | |
# add the appropriate roles to your service account | |
# for more info on roles, check https://cloud.google.com/iam/docs/understanding-roles | |
# for our app, we only need the Pub/Sub Publisher and Subscriber roles |