Skip to content

Commit de01833

Browse files
authored
Add License headers to make files (#2)
Signed-off-by: Tamal Saha <tamal@appscode.com>
1 parent cc3ee32 commit de01833

File tree

4 files changed

+89
-14
lines changed

4 files changed

+89
-14
lines changed

Makefile

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# Copyright 2019 AppsCode Inc.
2+
# Copyright 2016 The Kubernetes Authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
116
SHELL=/bin/bash -o pipefail
217

318
# The binary to build (just the basename).
@@ -54,7 +69,7 @@ TAG := $(VERSION)_$(OS)_$(ARCH)
5469
TAG_PROD := $(TAG)
5570
TAG_DBG := $(VERSION)-dbg_$(OS)_$(ARCH)
5671

57-
GO_VERSION ?= 1.12.5
72+
GO_VERSION ?= 1.12.7
5873
BUILD_IMAGE ?= appscode/golang-dev:$(GO_VERSION)-stretch
5974

6075
OUTBIN = bin/$(OS)_$(ARCH)/$(BIN)
@@ -111,7 +126,7 @@ version:
111126
@echo commit_timestamp=$(commit_timestamp)
112127

113128
gen:
114-
./hack/codegen.sh
129+
@true
115130

116131
fmt: $(BUILD_DIRS)
117132
@docker run \
@@ -164,9 +179,21 @@ $(OUTBIN): .go/$(OUTBIN).stamp
164179
commit_timestamp=$(commit_timestamp) \
165180
./hack/build.sh \
166181
"
167-
@if [ $(COMPRESS) = yes ] && [ $(OS) != windows ]; then \
168-
echo "compressing $(OUTBIN)"; \
169-
upx --brute .go/$(OUTBIN); \
182+
@if [ $(COMPRESS) = yes ] && [ $(OS) != darwin ]; then \
183+
echo "compressing $(OUTBIN)"; \
184+
docker run \
185+
-i \
186+
--rm \
187+
-u $$(id -u):$$(id -g) \
188+
-v $$(pwd):/src \
189+
-w /src \
190+
-v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin \
191+
-v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin/$(OS)_$(ARCH) \
192+
-v $$(pwd)/.go/cache:/.cache \
193+
--env HTTP_PROXY=$(HTTP_PROXY) \
194+
--env HTTPS_PROXY=$(HTTPS_PROXY) \
195+
$(BUILD_IMAGE) \
196+
upx --brute /go/$(OUTBIN); \
170197
fi
171198
@if ! cmp -s .go/$(OUTBIN) $(OUTBIN); then \
172199
mv .go/$(OUTBIN) $(OUTBIN); \
@@ -188,7 +215,7 @@ bin/.container-$(DOTFILE_IMAGE)-%: bin/$(OS)_$(ARCH)/$(BIN) $(DOCKERFILE_%)
188215
-e 's|{RESTIC_VER}|$(RESTIC_VER)|g' \
189216
-e 's|{NEW_RESTIC_VER}|$(NEW_RESTIC_VER)|g' \
190217
$(DOCKERFILE_$*) > bin/.dockerfile-$*-$(OS)_$(ARCH)
191-
@docker build -t $(IMAGE):$(TAG_$*) -f bin/.dockerfile-$*-$(OS)_$(ARCH) .
218+
@docker build --pull -t $(IMAGE):$(TAG_$*) -f bin/.dockerfile-$*-$(OS)_$(ARCH) .
192219
@docker images -q $(IMAGE):$(TAG_$*) > $@
193220
@echo
194221

@@ -255,28 +282,28 @@ dev: gen fmt push
255282
ci: lint test build #cover
256283

257284
.PHONY: qa
258-
qa: docker-manifest
285+
qa:
259286
@if [ "$$APPSCODE_ENV" = "prod" ]; then \
260287
echo "Nothing to do in prod env. Are you trying to 'release' binaries to prod?"; \
261288
exit 1; \
262289
fi
263-
@if [ "$(version_strategy)" = "git_tag" ]; then \
290+
@if [ "$(version_strategy)" = "tag" ]; then \
264291
echo "Are you trying to 'release' binaries to prod?"; \
265292
exit 1; \
266293
fi
267-
@$(MAKE) clean all-push --no-print-directory
294+
@$(MAKE) clean all-push docker-manifest --no-print-directory
268295

269296
.PHONY: release
270-
release: docker-manifest
297+
release:
271298
@if [ "$$APPSCODE_ENV" != "prod" ]; then \
272299
echo "'release' only works in PROD env."; \
273300
exit 1; \
274301
fi
275-
@if [ "$(version_strategy)" != "git_tag" ]; then \
276-
echo "'apply_tag' to release binaries and/or docker images."; \
277-
exit 1; \
302+
@if [ "$(version_strategy)" != "tag" ]; then \
303+
echo "apply tag to release binaries and/or docker images."; \
304+
exit 1; \
278305
fi
279-
@$(MAKE) clean all-push --no-print-directory
306+
@$(MAKE) clean all-push docker-manifest --no-print-directory
280307

281308
.PHONY: clean
282309
clean:

hack/build.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
#!/usr/bin/env bash
2+
3+
# Copyright 2019 AppsCode Inc.
4+
# Copyright 2016 The Kubernetes Authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
218
set -eou pipefail
319

420
if [ -z "${OS:-}" ]; then

hack/fmt.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
#!/usr/bin/env bash
2+
3+
# Copyright 2019 AppsCode Inc.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
217
set -eou pipefail
318

419
export CGO_ENABLED=0
@@ -20,3 +35,4 @@ echo
2035
echo "Running gofmt:"
2136
cmd="gofmt -s -w ${TARGETS}"
2237
echo $cmd; $cmd
38+
echo

hack/test.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
#!/usr/bin/env bash
2+
3+
# Copyright 2019 AppsCode Inc.
4+
# Copyright 2016 The Kubernetes Authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
218
set -eou pipefail
319

420
export CGO_ENABLED=0

0 commit comments

Comments
 (0)