Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nfs-subdir-external-provisioner
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rancher商店
nfs-subdir-external-provisioner
Commits
be902f40
Unverified
Commit
be902f40
authored
Jun 03, 2020
by
Kubernetes Prow Robot
Committed by
GitHub
Jun 03, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #88 from pohly/multiarch-windows-fix
multiarch windows fix
parents
17dde9ef
340e082f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
build.make
build.make
+12
-4
No files found.
build.make
View file @
be902f40
...
@@ -71,7 +71,7 @@ BUILD_PLATFORMS =
...
@@ -71,7 +71,7 @@ BUILD_PLATFORMS =
# This builds each command (= the sub-directories of ./cmd) for the target platform(s)
# This builds each command (= the sub-directories of ./cmd) for the target platform(s)
# defined by BUILD_PLATFORMS.
# defined by BUILD_PLATFORMS.
build-%
:
check-go-version-go
$(CMDS
:
%=build-%):
build-%: check-go-version-go
mkdir
-p
bin
mkdir
-p
bin
echo
'
$(BUILD_PLATFORMS)
'
|
tr
';'
'\n'
|
while
read
-r
os
arch
suffix
;
do
\
echo
'
$(BUILD_PLATFORMS)
'
|
tr
';'
'\n'
|
while
read
-r
os
arch
suffix
;
do
\
if
!
(
set
-x
;
CGO_ENABLED
=
0
GOOS
=
"
$$
os"
GOARCH
=
"
$$
arch"
go build
$(GOFLAGS_VENDOR)
-a
-ldflags
'-X main.version=
$(REV)
-extldflags "-static"'
-o
"./bin/
$*$$
suffix"
./cmd/
$*
)
;
then
\
if
!
(
set
-x
;
CGO_ENABLED
=
0
GOOS
=
"
$$
os"
GOARCH
=
"
$$
arch"
go build
$(GOFLAGS_VENDOR)
-a
-ldflags
'-X main.version=
$(REV)
-extldflags "-static"'
-o
"./bin/
$*$$
suffix"
./cmd/
$*
)
;
then
\
...
@@ -80,10 +80,10 @@ build-%: check-go-version-go
...
@@ -80,10 +80,10 @@ build-%: check-go-version-go
fi
;
\
fi
;
\
done
done
container-%
:
build-%
$(CMDS
:
%=container-%):
container-%: build-%
docker build
-t
$*
:latest
-f
$(
shell
if
[
-e
./cmd/
$*
/Dockerfile
]
;
then
echo
./cmd/
$*
/Dockerfile
;
else
echo
Dockerfile
;
fi
)
--label
revision
=
$(REV)
.
docker build
-t
$*
:latest
-f
$(
shell
if
[
-e
./cmd/
$*
/Dockerfile
]
;
then
echo
./cmd/
$*
/Dockerfile
;
else
echo
Dockerfile
;
fi
)
--label
revision
=
$(REV)
.
push-%
:
container-%
$(CMDS
:
%=push-%):
push-%: container-%
set
-ex
;
\
set
-ex
;
\
push_image
()
{
\
push_image
()
{
\
docker tag
$*
:latest
$(IMAGE_NAME)
:
$$
tag
;
\
docker tag
$*
:latest
$(IMAGE_NAME)
:
$$
tag
;
\
...
@@ -117,10 +117,14 @@ DOCKER_BUILDX_CREATE_ARGS ?=
...
@@ -117,10 +117,14 @@ DOCKER_BUILDX_CREATE_ARGS ?=
# Docker Buildx is included in Docker 19.03.
# Docker Buildx is included in Docker 19.03.
#
#
# ./cmd/<command>/Dockerfile[.Windows] is used if found, otherwise Dockerfile[.Windows].
# ./cmd/<command>/Dockerfile[.Windows] is used if found, otherwise Dockerfile[.Windows].
# It is currently optional: if no such file exists, Windows images are not included,
# even when Windows is listed in BUILD_PLATFORMS. That way, projects can test that
# Windows binaries can be built before adding a Dockerfile for it.
#
# BUILD_PLATFORMS determines which individual images are included in the multiarch image.
# BUILD_PLATFORMS determines which individual images are included in the multiarch image.
# PULL_BASE_REF must be set to 'master', 'release-x.y', or a tag name, and determines
# PULL_BASE_REF must be set to 'master', 'release-x.y', or a tag name, and determines
# the tag for the resulting multiarch image.
# the tag for the resulting multiarch image.
push-multiarch-%
:
check-pull-base-ref build-%
$(CMDS
:
%=push-multiarch-%):
push-multiarch-%: check-pull-base-ref build-%
set
-ex
;
\
set
-ex
;
\
DOCKER_CLI_EXPERIMENTAL
=
enabled
;
\
DOCKER_CLI_EXPERIMENTAL
=
enabled
;
\
export
DOCKER_CLI_EXPERIMENTAL
;
\
export
DOCKER_CLI_EXPERIMENTAL
;
\
...
@@ -129,6 +133,9 @@ push-multiarch-%: check-pull-base-ref build-%
...
@@ -129,6 +133,9 @@ push-multiarch-%: check-pull-base-ref build-%
dockerfile_linux
=
$$
(
if
[
-e
./cmd/
$*
/Dockerfile
]
;
then
echo
./cmd/
$*
/Dockerfile
;
else
echo
Dockerfile
;
fi
)
;
\
dockerfile_linux
=
$$
(
if
[
-e
./cmd/
$*
/Dockerfile
]
;
then
echo
./cmd/
$*
/Dockerfile
;
else
echo
Dockerfile
;
fi
)
;
\
dockerfile_windows
=
$$
(
if
[
-e
./cmd/
$*
/Dockerfile.Windows
]
;
then
echo
./cmd/
$*
/Dockerfile.Windows
;
else
echo
Dockerfile.Windows
;
fi
)
;
\
dockerfile_windows
=
$$
(
if
[
-e
./cmd/
$*
/Dockerfile.Windows
]
;
then
echo
./cmd/
$*
/Dockerfile.Windows
;
else
echo
Dockerfile.Windows
;
fi
)
;
\
if
[
'
$(BUILD_PLATFORMS)
'
]
;
then
build_platforms
=
'
$(BUILD_PLATFORMS)
'
;
else
build_platforms
=
"linux amd64"
;
fi
;
\
if
[
'
$(BUILD_PLATFORMS)
'
]
;
then
build_platforms
=
'
$(BUILD_PLATFORMS)
'
;
else
build_platforms
=
"linux amd64"
;
fi
;
\
if
!
[
-f
"
$$
dockerfile_windows"
]
;
then
\
build_platforms
=
"
$$
(echo "
$$
build_platforms
" | sed -e 's/windows *[^ ]* *.exe//g' -e 's/; *;/;/g')"
;
\
fi
;
\
pushMultiArch
()
{
\
pushMultiArch
()
{
\
tag
=
$$
1
;
\
tag
=
$$
1
;
\
echo
"
$$
build_platforms"
|
tr
';'
'\n'
|
while
read
-r
os
arch
suffix
;
do
\
echo
"
$$
build_platforms"
|
tr
';'
'\n'
|
while
read
-r
os
arch
suffix
;
do
\
...
@@ -166,6 +173,7 @@ check-pull-base-ref:
...
@@ -166,6 +173,7 @@ check-pull-base-ref:
exit
1
;
\
exit
1
;
\
fi
fi
.PHONY
:
push-multiarch
push-multiarch
:
$(CMDS:%=push-multiarch-%)
push-multiarch
:
$(CMDS:%=push-multiarch-%)
clean
:
clean
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment