Skip to content

Instantly share code, notes, and snippets.

View xcoulon's full-sized avatar

Xavier Coulon xcoulon

View GitHub Profile
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "1"
creationTimestamp: "2020-05-29T09:09:16Z"
generation: 2
labels:
app: try1
managedFields:
apiVersion: v1
items:
- apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: kompose convert -f docker-compose.yaml -o localregistry.yaml
kompose.version: 1.1.0 (36652f6)
creationTimestamp: null
labels:
$ make test-e2e-host-local
error: no token is currently in use for this session
/Library/Developer/CommandLineTools/usr/bin/make test-e2e HOST_REPO_PATH=/Users/xcoulon/code/go/src/github.com/codeready-toolchain/toolchain-e2e/../host-operator
error: no token is currently in use for this session
CGO_ENABLED=0 GOARCH=amd64 GOOS=linux \
go build \
-ldflags "-X github.com/codeready-toolchain/toolchain-e2e/cmd/manager.Commit=73b2d4d3a38af7fe340db3e015ef28b7dafba81a-dirty -X github.com/codeready-toolchain/toolchain-e2e/cmd/manager.BuildTime=`date -u '+%Y-%m-%dT%H:%M:%SZ'`" \
-o ./build/_output/bin/toolchain-e2e \
cmd/manager/main.go
const (
// Constants for viper variable names. Will be used to set
// default values as well as to get each value
...
varLogLevel = "log.level"
)
func New() *Configuration {
c := Configuration{
v: viper.New(),
package configuration
var (
// BuildCommit lastest build commit (set by build script)
BuildCommit = "unknown"
// BuildTime set by build script
BuildTime = "unknown"
)
...
# build image
FROM centos:7 as builder
...
ARG BUILD_COMMIT=unknown
ARG BUILD_TIME=unknown
RUN go build -ldflags "-X github.com/xcoulon/go-url-shortener/configuration.BuildCommit=${BUILD_COMMIT} -X github.com/xcoulon/go-url-shortener/configuration.BuildTime=${BUILD_TIME}" -o bin/go-url-shortener
...
# final image
FROM centos:7
$(eval BUILD_COMMIT:=$(shell git rev-parse --short HEAD))
$(eval BUILD_TIME:=$(shell date -u '+%Y-%m-%dT%H:%M:%SZ'))
docker build --build-arg POSTGRES_HOST=`cat .tmp/postgres.host` \
--build-arg POSTGRES_PORT=`cat .tmp/postgres.port` \
--build-arg POSTGRES_PASSWORD=$(POSTGRES_PASSWORD) \
--build-arg BUILD_COMMIT=$(BUILD_COMMIT) \
--build-arg BUILD_TIME=$(BUILD_TIME) \
. \
-t xcoulon/go-url-shortener:$(BUILD_COMMIT)
docker tag xcoulon/go-url-shortener:$(BUILD_COMMIT) xcoulon/go-url-shortener:latest
@xcoulon
xcoulon / Makefile
Last active January 16, 2018 19:16
Makefile for the go-url-shortener app
# If nothing was specified, run all targets as if in a fresh clone
.PHONY: all
## Default target
all: start-db build kill-db clean
POSTGRES_PASSWORD:=mysecretpassword
UNAME_S := $(shell uname -s)
.PHONY: init
init:
@xcoulon
xcoulon / Dockefile.dockerfile
Created January 16, 2018 19:02
Dockerfile for multistage build of the go-url-shortener app.
# build image
FROM centos:7 as builder
LABEL author="Xavier Coulon"
ENV LANG=en_US.utf8
# Install wget and git
RUN yum --enablerepo=centosplus install -y \
wget \
git
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: webapp
spec:
template:
metadata:
labels:
app: webapp
spec: