enable buildkit and timestamped logging
This commit is contained in:
parent
b5c055f436
commit
98a48a0fc6
@ -107,6 +107,8 @@ steps:
|
|||||||
|
|
||||||
- name: docker_build_push_dind
|
- name: docker_build_push_dind
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
|
environment:
|
||||||
|
DOCKER_BUILDKIT: "1"
|
||||||
settings:
|
settings:
|
||||||
repo: rancher/k3d
|
repo: rancher/k3d
|
||||||
tags:
|
tags:
|
||||||
@ -130,6 +132,8 @@ steps:
|
|||||||
- tag
|
- tag
|
||||||
|
|
||||||
- name: docker_build_push_binary
|
- name: docker_build_push_binary
|
||||||
|
environment:
|
||||||
|
DOCKER_BUILDKIT: "1"
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
repo: rancher/k3d
|
repo: rancher/k3d
|
||||||
|
6
Makefile
6
Makefile
@ -124,14 +124,14 @@ build-cross:
|
|||||||
# build a specific docker target ( '%' matches the target as specified in the Dockerfile)
|
# build a specific docker target ( '%' matches the target as specified in the Dockerfile)
|
||||||
build-docker-%:
|
build-docker-%:
|
||||||
@echo "Building Docker image k3d:$(K3D_IMAGE_TAG)-$*"
|
@echo "Building Docker image k3d:$(K3D_IMAGE_TAG)-$*"
|
||||||
docker build . -t k3d:$(K3D_IMAGE_TAG)-$* --target $*
|
DOCKER_BUILDKIT=1 docker build . -t k3d:$(K3D_IMAGE_TAG)-$* --target $*
|
||||||
|
|
||||||
# build helper images
|
# build helper images
|
||||||
build-helper-images:
|
build-helper-images:
|
||||||
@echo "Building docker image rancher/k3d-proxy:$(GIT_TAG)"
|
@echo "Building docker image rancher/k3d-proxy:$(GIT_TAG)"
|
||||||
docker build proxy/ -f proxy/Dockerfile -t rancher/k3d-proxy:$(GIT_TAG)
|
DOCKER_BUILDKIT=1 docker build proxy/ -f proxy/Dockerfile -t rancher/k3d-proxy:$(GIT_TAG)
|
||||||
@echo "Building docker image rancher/k3d-tools:$(GIT_TAG)"
|
@echo "Building docker image rancher/k3d-tools:$(GIT_TAG)"
|
||||||
docker build --no-cache tools/ -f tools/Dockerfile -t rancher/k3d-tools:$(GIT_TAG) --build-arg GIT_TAG=$(GIT_TAG)
|
DOCKER_BUILDKIT=1 docker build --no-cache tools/ -f tools/Dockerfile -t rancher/k3d-tools:$(GIT_TAG) --build-arg GIT_TAG=$(GIT_TAG)
|
||||||
|
|
||||||
##############################
|
##############################
|
||||||
########## Cleaning ##########
|
########## Cleaning ##########
|
||||||
|
20
cmd/root.go
20
cmd/root.go
@ -46,9 +46,10 @@ import (
|
|||||||
|
|
||||||
// RootFlags describes a struct that holds flags that can be set on root level of the command
|
// RootFlags describes a struct that holds flags that can be set on root level of the command
|
||||||
type RootFlags struct {
|
type RootFlags struct {
|
||||||
debugLogging bool
|
debugLogging bool
|
||||||
traceLogging bool
|
traceLogging bool
|
||||||
version bool
|
timestampedLogging bool
|
||||||
|
version bool
|
||||||
}
|
}
|
||||||
|
|
||||||
var flags = RootFlags{}
|
var flags = RootFlags{}
|
||||||
@ -97,6 +98,7 @@ func init() {
|
|||||||
|
|
||||||
rootCmd.PersistentFlags().BoolVar(&flags.debugLogging, "verbose", false, "Enable verbose output (debug logging)")
|
rootCmd.PersistentFlags().BoolVar(&flags.debugLogging, "verbose", false, "Enable verbose output (debug logging)")
|
||||||
rootCmd.PersistentFlags().BoolVar(&flags.traceLogging, "trace", false, "Enable super verbose output (trace logging)")
|
rootCmd.PersistentFlags().BoolVar(&flags.traceLogging, "trace", false, "Enable super verbose output (trace logging)")
|
||||||
|
rootCmd.PersistentFlags().BoolVar(&flags.timestampedLogging, "timestamps", false, "Enable Log timestamps")
|
||||||
|
|
||||||
// add local flags
|
// add local flags
|
||||||
rootCmd.Flags().BoolVar(&flags.version, "version", false, "Show k3d and default k3s version")
|
rootCmd.Flags().BoolVar(&flags.version, "version", false, "Show k3d and default k3s version")
|
||||||
@ -161,9 +163,17 @@ func initLogging() {
|
|||||||
log.TraceLevel,
|
log.TraceLevel,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
log.SetFormatter(&log.TextFormatter{
|
|
||||||
|
formatter := &log.TextFormatter{
|
||||||
ForceColors: true,
|
ForceColors: true,
|
||||||
})
|
}
|
||||||
|
|
||||||
|
if flags.timestampedLogging || os.Getenv("LOG_TIMESTAMPS") != "" {
|
||||||
|
formatter.FullTimestamp = true
|
||||||
|
}
|
||||||
|
|
||||||
|
log.SetFormatter(formatter)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func initRuntime() {
|
func initRuntime() {
|
||||||
|
@ -22,6 +22,7 @@ k3de2e=$(docker run -d \
|
|||||||
-e E2E_INCLUDE="$E2E_INCLUDE" \
|
-e E2E_INCLUDE="$E2E_INCLUDE" \
|
||||||
-e E2E_EXCLUDE="$E2E_EXCLUDE" \
|
-e E2E_EXCLUDE="$E2E_EXCLUDE" \
|
||||||
-e E2E_EXTRA="$E2E_EXTRA" \
|
-e E2E_EXTRA="$E2E_EXTRA" \
|
||||||
|
-e LOG_TIMESTAMPS="true" \
|
||||||
--add-host "k3d-registrytest-registry:127.0.0.1" \
|
--add-host "k3d-registrytest-registry:127.0.0.1" \
|
||||||
--name "k3d-e2e-runner-$TIMESTAMP" \
|
--name "k3d-e2e-runner-$TIMESTAMP" \
|
||||||
"k3d:$K3D_IMAGE_TAG")
|
"k3d:$K3D_IMAGE_TAG")
|
||||||
|
Loading…
Reference in New Issue
Block a user