Skip to content

Commit 7a083f0

Browse files
authored
Merge pull request #76 from leaseweb/ci-lint-checker
chore(ci): add lint step to GitHub Actions workflow
2 parents 1b76c00 + fad9680 commit 7a083f0

5 files changed

Lines changed: 61 additions & 5 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*Issue #, if available:*
2+
3+
*Description of changes:*
4+
5+
*Testing performed:*
6+
7+
8+
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

.github/workflows/pr-check.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ jobs:
1818

1919
- name: Check out code
2020
uses: actions/checkout@v4
21+
22+
- name: Lint Check
23+
run: make lint
2124

2225
- name: Run Script
2326
run: make test

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
/cloudstack-ccm
2-
2+
/hack/tools/bin

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
# under the License.
1717

1818
FROM golang:1.23 AS builder
19-
COPY . /go/src/github.com/apache/cloudstack-kubernetes-provider
20-
WORKDIR /go/src/github.com/apache/cloudstack-kubernetes-provider
21-
RUN make clean && CGO_ENABLED=0 GOOS=linux make
19+
WORKDIR /app
20+
COPY . .
21+
RUN make clean && GOARCH=amd64 GOOS=linux CGO_ENABLED=0 make all
2222

2323
FROM gcr.io/distroless/static:nonroot
24-
COPY --from=builder /go/src/github.com/apache/cloudstack-kubernetes-provider/cloudstack-ccm /app/cloudstack-ccm
24+
COPY --from=builder /app/cloudstack-ccm /app/cloudstack-ccm
2525
ENTRYPOINT [ "/app/cloudstack-ccm", "--cloud-provider", "cloudstack" ]

hack/go_install.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2021 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+
16+
set -o errexit
17+
set -o nounset
18+
set -o pipefail
19+
20+
if [ -z "${1}" ]; then
21+
echo "must provide module as first parameter"
22+
exit 1
23+
fi
24+
25+
if [ -z "${2}" ]; then
26+
echo "must provide binary name as second parameter"
27+
exit 1
28+
fi
29+
30+
if [ -z "${3}" ]; then
31+
echo "must provide version as third parameter"
32+
exit 1
33+
fi
34+
35+
if [ -z "${GOBIN}" ]; then
36+
echo "GOBIN is not set. Must set GOBIN to install the bin in a specified directory."
37+
exit 1
38+
fi
39+
40+
rm -f "${GOBIN}/${2}"* || true
41+
42+
# install the golang module specified as the first argument
43+
go install "${1}@${3}"
44+
mv "${GOBIN}/${2}" "${GOBIN}/${2}-${3}"
45+
ln -sf "${GOBIN}/${2}-${3}" "${GOBIN}/${2}"

0 commit comments

Comments
 (0)