Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
de889a00
Unverified
Commit
de889a00
authored
Mar 16, 2022
by
Jossemar Cordero
Committed by
GitHub
Mar 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add cross-compilation as sanity check (#5255)
parent
078da465
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
1 deletion
+72
-1
.drone.yml
.drone.yml
+8
-0
Dockerfile.dapper
Dockerfile.dapper
+6
-1
validate-cross-compilation
scripts/validate-cross-compilation
+58
-0
No files found.
.drone.yml
View file @
de889a00
...
...
@@ -22,6 +22,14 @@ steps:
-
name
:
docker
path
:
/var/run/docker.sock
-
name
:
validate-cross-compilation
image
:
rancher/dapper:v0.5.0
commands
:
-
dapper validate-cross-compilation
volumes
:
-
name
:
docker
path
:
/var/run/docker.sock
-
name
:
fossa
image
:
rancher/drone-fossa:latest
failure
:
ignore
...
...
Dockerfile.dapper
View file @
de889a00
...
...
@@ -11,7 +11,12 @@ ENV no_proxy=$no_proxy
RUN apk -U --no-cache add bash git gcc musl-dev docker vim less file curl wget ca-certificates jq linux-headers \
zlib-dev tar zip squashfs-tools npm coreutils python3 openssl-dev libffi-dev libseccomp libseccomp-dev \
libseccomp-static make libuv-static sqlite-dev sqlite-static libselinux libselinux-dev zlib-dev zlib-static \
zstd pigz alpine-sdk binutils-gold btrfs-progs-dev btrfs-progs-static gawk
zstd pigz alpine-sdk binutils-gold btrfs-progs-dev btrfs-progs-static gawk \
&& \
if [ "$(go env GOARCH)" = "amd64" ]; then \
apk -U --no-cache add mingw-w64-gcc; \
fi
RUN if [ "$(go env GOARCH)" = "arm64" ]; then \
wget https://github.com/aquasecurity/trivy/releases/download/v0.16.0/trivy_0.16.0_Linux-ARM64.tar.gz && \
tar -zxvf trivy_0.16.0_Linux-ARM64.tar.gz && \
...
...
scripts/validate-cross-compilation
0 → 100755
View file @
de889a00
#!/bin/bash
set
-e
-x
cd
$(
dirname
$0
)
/..
.
./scripts/version.sh
GO
=
${
GO
-go
}
PKG
=
"github.com/k3s-io/k3s"
PKG_CONTAINERD
=
"github.com/containerd/containerd"
PKG_K3S_CONTAINERD
=
"github.com/k3s-io/containerd"
PKG_CRICTL
=
"github.com/kubernetes-sigs/cri-tools/pkg"
PKG_K8S_BASE
=
"k8s.io/component-base"
PKG_K8S_CLIENT
=
"k8s.io/client-go/pkg"
buildDate
=
$(
date
-u
'+%Y-%m-%dT%H:%M:%SZ'
)
VERSIONFLAGS
=
"
-X
${
PKG
}
/pkg/version.Version=
${
VERSION
}
-X
${
PKG
}
/pkg/version.GitCommit=
${
COMMIT
:0:8
}
-X
${
PKG_K8S_CLIENT
}
/version.gitVersion=
${
VERSION
}
-X
${
PKG_K8S_CLIENT
}
/version.gitCommit=
${
COMMIT
}
-X
${
PKG_K8S_CLIENT
}
/version.gitTreeState=
${
TREE_STATE
}
-X
${
PKG_K8S_CLIENT
}
/version.buildDate=
${
buildDate
}
-X
${
PKG_K8S_BASE
}
/version.gitVersion=
${
VERSION
}
-X
${
PKG_K8S_BASE
}
/version.gitCommit=
${
COMMIT
}
-X
${
PKG_K8S_BASE
}
/version.gitTreeState=
${
TREE_STATE
}
-X
${
PKG_K8S_BASE
}
/version.buildDate=
${
buildDate
}
-X
${
PKG_CRICTL
}
/version.Version=
${
VERSION_CRICTL
}
-X
${
PKG_CONTAINERD
}
/version.Version=
${
VERSION_CONTAINERD
}
-X
${
PKG_CONTAINERD
}
/version.Package=
${
PKG_K3S_CONTAINERD
}
-X
${
PKG_CONTAINERD
}
/version.Version=
${
VERSION_CONTAINERD
}
-X
${
PKG_CONTAINERD
}
/version.Package=
${
PKG_K3S_CONTAINERD
}
"
LDFLAGS
=
"
-w -s"
STATIC
=
""
TAGS
=
"netcgo osusergo providerless"
mkdir
-p
bin
# Sanity check for downstream dependencies
echo
'Validate K3s cross-compilation on Windows x86_64'
GOOS
=
windows
CGO_ENABLED
=
1
CXX
=
x86_64-w64-mingw32-g++
CC
=
x86_64-w64-mingw32-gcc
\
"
${
GO
}
"
build
-tags
"
${
TAGS
}
"
-ldflags
"
${
VERSIONFLAGS
}
${
LDFLAGS
}
${
STATIC
}
"
-o
bin/k3s.exe ./cmd/server/main.go
if
[
"
${
KEEP_WINDOWS_BIN
}
"
!=
'true'
]
;
then
rm
-rf
bin/k3s.exe
fi
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