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
1942d184
Commit
1942d184
authored
Dec 22, 2021
by
Luther Monson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code to remove vendor dir
Signed-off-by:
Luther Monson
<
luther.monson@gmail.com
>
parent
d47e38e0
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
30 deletions
+35
-30
.golangci.json
.golangci.json
+0
-0
Dockerfile.dapper
Dockerfile.dapper
+1
-2
data.go
pkg/data/data.go
+1
-0
build
scripts/build
+16
-17
ci
scripts/ci
+1
-4
validate
scripts/validate
+16
-7
No files found.
.golangci.json
View file @
1942d184
Dockerfile.dapper
View file @
1942d184
...
@@ -26,7 +26,7 @@ RUN if [ "$(go env GOARCH)" = "arm64" ]; then
...
@@ -26,7 +26,7 @@ RUN if [ "$(go env GOARCH)" = "arm64" ]; then
mv trivy /usr/local/bin; \
mv trivy /usr/local/bin; \
fi
fi
# this works for both go 1.15 and 1.16
# this works for both go 1.15 and 1.16
RUN GO
111MODULE=on GO
PROXY=direct go get golang.org/x/tools/cmd/goimports@gopls/v0.6.9
RUN GOPROXY=direct go get golang.org/x/tools/cmd/goimports@gopls/v0.6.9
RUN rm -rf /go/src /go/pkg
RUN rm -rf /go/src /go/pkg
RUN if [ "$(go env GOARCH)" = "amd64" ]; then \
RUN if [ "$(go env GOARCH)" = "amd64" ]; then \
...
@@ -39,7 +39,6 @@ RUN wget -O - ${YQ_URL}_$(go env GOARCH) > /usr/bin/yq && chmod +x /usr/bin/yq
...
@@ -39,7 +39,6 @@ RUN wget -O - ${YQ_URL}_$(go env GOARCH) > /usr/bin/yq && chmod +x /usr/bin/yq
ARG SELINUX=true
ARG SELINUX=true
ENV SELINUX $SELINUX
ENV SELINUX $SELINUX
ENV GO111MODULE off
ENV DAPPER_RUN_ARGS --privileged -v k3s-cache:/go/src/github.com/rancher/k3s/.cache -v trivy-cache:/root/.cache/trivy
ENV DAPPER_RUN_ARGS --privileged -v k3s-cache:/go/src/github.com/rancher/k3s/.cache -v trivy-cache:/root/.cache/trivy
ENV DAPPER_ENV REPO TAG DRONE_TAG IMAGE_NAME SKIP_VALIDATE GCLOUD_AUTH GITHUB_TOKEN GOLANG
ENV DAPPER_ENV REPO TAG DRONE_TAG IMAGE_NAME SKIP_VALIDATE GCLOUD_AUTH GITHUB_TOKEN GOLANG
ENV DAPPER_SOURCE /go/src/github.com/rancher/k3s/
ENV DAPPER_SOURCE /go/src/github.com/rancher/k3s/
...
...
pkg/data/data.go
0 → 100644
View file @
1942d184
package
data
scripts/build
View file @
1942d184
...
@@ -16,26 +16,25 @@ PKG_K8S_CLIENT="k8s.io/client-go/pkg"
...
@@ -16,26 +16,25 @@ PKG_K8S_CLIENT="k8s.io/client-go/pkg"
buildDate
=
$(
date
-u
'+%Y-%m-%dT%H:%M:%SZ'
)
buildDate
=
$(
date
-u
'+%Y-%m-%dT%H:%M:%SZ'
)
VENDOR_PREFIX
=
"
${
PKG
}
/vendor/"
VERSIONFLAGS
=
"
VERSIONFLAGS
=
"
-X
${
PKG
}
/pkg/version.Version=
${
VERSION
}
-X
${
PKG
}
/pkg/version.Version=
${
VERSION
}
-X
${
PKG
}
/pkg/version.GitCommit=
${
COMMIT
:0:8
}
-X
${
PKG
}
/pkg/version.GitCommit=
${
COMMIT
:0:8
}
-X
${
VENDOR_PREFIX
}${
PKG_K8S_CLIENT
}
/version.gitVersion=
${
VERSION
}
-X
${
PKG_K8S_CLIENT
}
/version.gitVersion=
${
VERSION
}
-X
${
VENDOR_PREFIX
}${
PKG_K8S_CLIENT
}
/version.gitCommit=
${
COMMIT
}
-X
${
PKG_K8S_CLIENT
}
/version.gitCommit=
${
COMMIT
}
-X
${
VENDOR_PREFIX
}${
PKG_K8S_CLIENT
}
/version.gitTreeState=
${
TREE_STATE
}
-X
${
PKG_K8S_CLIENT
}
/version.gitTreeState=
${
TREE_STATE
}
-X
${
VENDOR_PREFIX
}${
PKG_K8S_CLIENT
}
/version.buildDate=
${
buildDate
}
-X
${
PKG_K8S_CLIENT
}
/version.buildDate=
${
buildDate
}
-X
${
VENDOR_PREFIX
}${
PKG_K8S_BASE
}
/version.gitVersion=
${
VERSION
}
-X
${
PKG_K8S_BASE
}
/version.gitVersion=
${
VERSION
}
-X
${
VENDOR_PREFIX
}${
PKG_K8S_BASE
}
/version.gitCommit=
${
COMMIT
}
-X
${
PKG_K8S_BASE
}
/version.gitCommit=
${
COMMIT
}
-X
${
VENDOR_PREFIX
}${
PKG_K8S_BASE
}
/version.gitTreeState=
${
TREE_STATE
}
-X
${
PKG_K8S_BASE
}
/version.gitTreeState=
${
TREE_STATE
}
-X
${
VENDOR_PREFIX
}${
PKG_K8S_BASE
}
/version.buildDate=
${
buildDate
}
-X
${
PKG_K8S_BASE
}
/version.buildDate=
${
buildDate
}
-X
${
VENDOR_PREFIX
}${
PKG_CRICTL
}
/version.Version=
${
VERSION_CRICTL
}
-X
${
PKG_CRICTL
}
/version.Version=
${
VERSION_CRICTL
}
-X
${
VENDOR_PREFIX
}${
PKG_CONTAINERD
}
/version.Version=
${
VERSION_CONTAINERD
}
-X
${
PKG_CONTAINERD
}
/version.Version=
${
VERSION_CONTAINERD
}
-X
${
VENDOR_PREFIX
}${
PKG_CONTAINERD
}
/version.Package=
${
PKG_K3S_CONTAINERD
}
-X
${
PKG_CONTAINERD
}
/version.Package=
${
PKG_K3S_CONTAINERD
}
-X
${
VENDOR_PREFIX
}${
PKG_CRICTL
}
/pkg/version.Version=
${
VERSION_CRICTL
}
-X
${
PKG_CRICTL
}
/pkg/version.Version=
${
VERSION_CRICTL
}
"
"
LDFLAGS
=
"
LDFLAGS
=
"
-w -s"
-w -s"
...
@@ -96,7 +95,7 @@ if [ ! -x ${INSTALLBIN}/cni ]; then
...
@@ -96,7 +95,7 @@ if [ ! -x ${INSTALLBIN}/cni ]; then
WORKDIR
=
$TMPDIR
/src/github.com/containernetworking/plugins
WORKDIR
=
$TMPDIR
/src/github.com/containernetworking/plugins
git clone
-b
$VERSION_CNIPLUGINS
https://github.com/rancher/plugins.git
$WORKDIR
git clone
-b
$VERSION_CNIPLUGINS
https://github.com/rancher/plugins.git
$WORKDIR
cd
$WORKDIR
cd
$WORKDIR
GOPATH
=
$TMPDIR
CGO_ENABLED
=
0
"
${
GO
}
"
build
-tags
"
$TAGS
"
-ldflags
"
$LDFLAGS
$STATIC
"
-o
$INSTALLBIN
/cni
GO
111MODULE
=
off
GO
PATH
=
$TMPDIR
CGO_ENABLED
=
0
"
${
GO
}
"
build
-tags
"
$TAGS
"
-ldflags
"
$LDFLAGS
$STATIC
"
-o
$INSTALLBIN
/cni
)
)
fi
fi
...
@@ -113,15 +112,15 @@ ln -s containerd ./bin/ctr
...
@@ -113,15 +112,15 @@ ln -s containerd ./bin/ctr
echo
Building runc
echo
Building runc
rm
-f
./build/src/github.com/opencontainers/runc/runc
rm
-f
./build/src/github.com/opencontainers/runc/runc
make
GOPATH
=
$(
pwd
)
/build
EXTRA_LDFLAGS
=
"-w -s"
BUILDTAGS
=
"
$RUNC_TAGS
"
-C
./build/src/github.com/opencontainers/runc
$RUNC_STATIC
GO111MODULE
=
off
make
GOPATH
=
$(
pwd
)
/build
EXTRA_LDFLAGS
=
"-w -s"
BUILDTAGS
=
"
$RUNC_TAGS
"
-C
./build/src/github.com/opencontainers/runc
$RUNC_STATIC
cp
-f
./build/src/github.com/opencontainers/runc/runc ./bin/runc
cp
-f
./build/src/github.com/opencontainers/runc/runc ./bin/runc
echo
Building containerd-shim
echo
Building containerd-shim
rm
-f
./vendor/github.com/containerd/containerd/bin/containerd-shim
rm
-f
./vendor/github.com/containerd/containerd/bin/containerd-shim
make
-C
./vendor/github.com/containerd/containerd bin/containerd-shim
GO111MODULE
=
off
make
-C
./vendor/github.com/containerd/containerd bin/containerd-shim
cp
-f
./vendor/github.com/containerd/containerd/bin/containerd-shim ./bin/containerd-shim
cp
-f
./vendor/github.com/containerd/containerd/bin/containerd-shim ./bin/containerd-shim
echo
Building containerd-shim-runc-v2
echo
Building containerd-shim-runc-v2
rm
-f
./vendor/github.com/containerd/containerd/bin/containerd-shim-runc-v2
rm
-f
./vendor/github.com/containerd/containerd/bin/containerd-shim-runc-v2
make
-C
./vendor/github.com/containerd/containerd bin/containerd-shim-runc-v2
GO111MODULE
=
off
make
-C
./vendor/github.com/containerd/containerd bin/containerd-shim-runc-v2
cp
-f
./vendor/github.com/containerd/containerd/bin/containerd-shim-runc-v2 ./bin/containerd-shim-runc-v2
cp
-f
./vendor/github.com/containerd/containerd/bin/containerd-shim-runc-v2 ./bin/containerd-shim-runc-v2
scripts/ci
View file @
1942d184
...
@@ -5,10 +5,7 @@ SCRIPT_DIR=$(dirname $0)
...
@@ -5,10 +5,7 @@ SCRIPT_DIR=$(dirname $0)
pushd
$SCRIPT_DIR
pushd
$SCRIPT_DIR
./download
./download
if
[
-z
"
$SKIP_VALIDATE
"
]
;
then
./validate
./validate
fi
./build
./build
./package
./package
...
...
scripts/validate
View file @
1942d184
...
@@ -3,27 +3,36 @@ set -e
...
@@ -3,27 +3,36 @@ set -e
cd
$(
dirname
$0
)
/..
cd
$(
dirname
$0
)
/..
GO
=
${
GO
-go
}
echo
Running: go mod tidy
go mod tidy
echo
Running: go generate
go generate
echo
Running: go mod vendor
go mod vendor
if
[
-n
"
$SKIP_VALIDATE
"
]
;
then
echo
Skipping validation
exit
fi
if
!
command
-v
golangci-lint
;
then
if
!
command
-v
golangci-lint
;
then
echo
Skipping validation: no golangci-lint available
echo
Skipping validation: no golangci-lint available
exit
exit
fi
fi
echo
Running validation
echo
Running validation
echo
Running: go mod verify
go mod verify
if
[
!
-e
build/data
]
;
then
if
[
!
-e
build/data
]
;
then
mkdir
-p
build/data
mkdir
-p
build/data
fi
fi
echo
Running:
"
${
GO
}
"
generate
"
${
GO
}
"
generate
echo
Running: golangci-lint
echo
Running: golangci-lint
golangci-lint run
-v
golangci-lint run
-v
GO111MODULE
=
on go mod tidy
GO111MODULE
=
on go mod vendor
.
./scripts/version.sh
.
./scripts/version.sh
if
[
-n
"
$DIRTY
"
]
;
then
if
[
-n
"
$DIRTY
"
]
;
then
...
...
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