Skip to content

Commit

Permalink
Merge pull request kubevirt#3979 from EdDev/timestamps
Browse files Browse the repository at this point in the history
 Makefile: Add timestamps to make targets
  • Loading branch information
kubevirt-bot authored Aug 27, 2020
2 parents d3f3126 + 623b098 commit b26a286
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
export GO15VENDOREXPERIMENT := 1

ifeq (${TIMESTAMP}, 1)
$(info "Timestamp is enabled")
SHELL = ./hack/timestamps.sh
endif

all:
hack/dockerized "DOCKER_PREFIX=${DOCKER_PREFIX} DOCKER_TAG=${DOCKER_TAG} IMAGE_PULL_POLICY=${IMAGE_PULL_POLICY} VERBOSITY=${VERBOSITY} ./hack/build-manifests.sh && \
Expand Down Expand Up @@ -135,7 +139,7 @@ builder-publish:
olm-verify:
hack/dockerized "./hack/olm.sh verify"

current-dir := $(shell pwd)
current-dir := $(realpath .)

build-prom-spec-dumper:
hack/dockerized "go build -o rule-spec-dumper ./hack/prom-rule-ci/rule-spec-dumper.go"
Expand Down
2 changes: 2 additions & 0 deletions automation/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

set -ex

export TIMESTAMP=${TIMESTAMP:-1}

export WORKSPACE="${WORKSPACE:-$PWD}"
readonly ARTIFACTS_PATH="${ARTIFACTS-$WORKSPACE/exported-artifacts}"
readonly TEMPLATES_SERVER="https://templates.ovirt.org/kubevirt/"
Expand Down
2 changes: 2 additions & 0 deletions automation/travisci-test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash -e

export TIMESTAMP=${TIMESTAMP:-1}

# when not on a release do extensive checks
if [ -z "$TRAVIS_TAG" ]; then
make bazel-build-verify
Expand Down
12 changes: 12 additions & 0 deletions hack/timestamps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

function timestamps::time_wrapper() {
while IFS= read -r line; do
printf "%(%T)T: %s\n" "-1" "$line"
done
}

if [[ "${BASH_SOURCE[0]}" -ef "$0" ]]; then
set -o pipefail
/bin/sh "$@" 2>&1 | timestamps::time_wrapper
fi

0 comments on commit b26a286

Please sign in to comment.