Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 125 additions & 12 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@ platform:
arch: amd64

steps:
- name: skipfiles
image: plugins/git
commands:
- export NAME=$(test $DRONE_BUILD_EVENT = pull_request && echo remotes/origin/${DRONE_COMMIT_BRANCH:-master} || echo ${DRONE_COMMIT_SHA}~)
- export DIFF=$(git --no-pager diff --name-only $NAME | grep -v -f .droneignore);
- if [ -z "$DIFF" ]; then
echo "All files in PR are on ignore list";
exit 78;
else
echo "Some files in PR are not ignored, $DIFF";
fi;
when:
event:
- push
- pull_request

- name: build
image: rancher/dapper:v0.5.0
secrets: [ AWS_SECRET_ACCESS_KEY-k3s-ci-uploader, AWS_ACCESS_KEY_ID-k3s-ci-uploader, unprivileged_github_token ]
Expand Down Expand Up @@ -137,6 +153,22 @@ platform:
arch: arm64

steps:
- name: skipfiles
image: plugins/git
commands:
- export NAME=$(test $DRONE_BUILD_EVENT = pull_request && echo remotes/origin/${DRONE_COMMIT_BRANCH:-master} || echo ${DRONE_COMMIT_SHA}~)
- export DIFF=$(git --no-pager diff --name-only $NAME | grep -v -f .droneignore);
- if [ -z "$DIFF" ]; then
echo "All files in PR are on ignore list";
exit 78;
else
echo "Some files in PR are not ignored, $DIFF";
fi;
when:
event:
- push
- pull_request

- name: build
image: rancher/dapper:v0.5.0
secrets: [ AWS_SECRET_ACCESS_KEY-k3s-ci-uploader, AWS_ACCESS_KEY_ID-k3s-ci-uploader ]
Expand Down Expand Up @@ -223,6 +255,22 @@ platform:
arch: arm

steps:
- name: skipfiles
image: plugins/git
commands:
- export NAME=$(test $DRONE_BUILD_EVENT = pull_request && echo remotes/origin/${DRONE_COMMIT_BRANCH:-master} || echo ${DRONE_COMMIT_SHA}~)
- export DIFF=$(git --no-pager diff --name-only $NAME | grep -v -f .droneignore);
- if [ -z "$DIFF" ]; then
echo "All files in PR are on ignore list";
exit 78;
else
echo "Some files in PR are not ignored, $DIFF";
fi;
when:
event:
- push
- pull_request

- name: build
image: rancher/dapper:v0.5.0
secrets: [ AWS_SECRET_ACCESS_KEY-k3s-ci-uploader, AWS_ACCESS_KEY_ID-k3s-ci-uploader ]
Expand Down Expand Up @@ -323,6 +371,22 @@ steps:
- git fetch origin $DRONE_COMMIT_REF
- git checkout $DRONE_COMMIT -b origin/$DRONE_TARGET_BRANCH

- name: skipfiles
image: alpine/git:v2.30.2-s390x
commands:
- export NAME=$(test $DRONE_BUILD_EVENT = pull_request && echo remotes/origin/${DRONE_COMMIT_BRANCH:-master} || echo ${DRONE_COMMIT_SHA}~)
- export DIFF=$(git --no-pager diff --name-only $NAME | grep -v -f .droneignore);
- if [ -z "$DIFF" ]; then
echo "All files in PR are on ignore list";
exit 78;
else
echo "Some files in PR are not ignored, $DIFF";
fi;
when:
event:
- push
- pull_request

- name: build
image: rancher/dapper:v0.5.8
secrets: [ AWS_SECRET_ACCESS_KEY-k3s-ci-uploader, AWS_ACCESS_KEY_ID-k3s-ci-uploader ]
Expand Down Expand Up @@ -413,19 +477,36 @@ platform:
arch: amd64

steps:
- name: validate_go_mods
image: rancher/dapper:v0.5.0
commands:
- docker build --target test-mods -t k3s:mod -f Dockerfile.test .
- docker run -i k3s:mod

volumes:
- name: docker
path: /var/run/docker.sock
volumes:
- name: skipfiles
image: plugins/git
commands:
- export NAME=$(test $DRONE_BUILD_EVENT = pull_request && echo remotes/origin/${DRONE_COMMIT_BRANCH:-master} || echo ${DRONE_COMMIT_SHA}~)
- export DIFF=$(git --no-pager diff --name-only $NAME | grep -v -f .droneignore);
- if [ -z "$DIFF" ]; then
echo "All files in PR are on ignore list";
exit 78;
else
echo "Some files in PR are not ignored, $DIFF";
fi;
when:
event:
- push
- pull_request

- name: validate_go_mods
image: rancher/dapper:v0.5.0
commands:
- docker build --target test-mods -t k3s:mod -f Dockerfile.test .
- docker run -i k3s:mod

volumes:
- name: docker
host:
path: /var/run/docker.sock
path: /var/run/docker.sock

volumes:
- name: docker
host:
path: /var/run/docker.sock

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the diff is unclear here, but if you look at the file I just removed some spacing here to conform to the way the rest of the yaml is written (lists have same spacing as parent)


---
kind: pipeline
Expand All @@ -436,6 +517,22 @@ platform:
arch: amd64

steps:
- name: skipfiles
image: plugins/git
commands:
- export NAME=$(test $DRONE_BUILD_EVENT = pull_request && echo remotes/origin/${DRONE_COMMIT_BRANCH:-master} || echo ${DRONE_COMMIT_SHA}~)
- export DIFF=$(git --no-pager diff --name-only $NAME | grep -v -f .droneignore);
- if [ -z "$DIFF" ]; then
echo "All files in PR are on ignore list";
exit 78;
else
echo "Some files in PR are not ignored, $DIFF";
fi;
when:
event:
- push
- pull_request

- name: manifest
image: plugins/docker
environment:
Expand Down Expand Up @@ -476,6 +573,22 @@ platform:
arch: amd64

steps:
- name: skipfiles
image: plugins/git
commands:
- export NAME=$(test $DRONE_BUILD_EVENT = pull_request && echo remotes/origin/${DRONE_COMMIT_BRANCH:-master} || echo ${DRONE_COMMIT_SHA}~)
- export DIFF=$(git --no-pager diff --name-only $NAME | grep -v -f .droneignore);
- if [ -z "$DIFF" ]; then
echo "All files in PR are on ignore list";
exit 78;
else
echo "Some files in PR are not ignored, $DIFF";
fi;
when:
event:
- push
- pull_request

- name: dispatch
image: curlimages/curl:7.74.0
user: root
Expand Down
9 changes: 9 additions & 0 deletions .droneignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
^.*\.md$
^install\.sh$
^\.droneignore$
^\.github/*$
^MAINTAINERS$
^CODEOWNERS$
^LICENSE$
^DCO$
^channel\.yaml$
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,5 @@ Please check out our [contributing guide](CONTRIBUTING.md) if you're interested
Security
--------

Security issues in K3s can be reported by sending an email to [security@k3s.io](mailto:security@k3s.io). Please do not file issues about security issues.
Security issues in K3s can be reported by sending an email to [security@k3s.io](mailto:security@k3s.io).
Please do not file issues about security issues.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a trivial spacing change to validate that .md files are ignored.