mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
skip all pipelines based on what is in the PR (#6996)
* add droneignore, make trivial change to README for testing, updating drone config to use droneignore to skip CI when files are all matched Signed-off-by: matttrach <matttrach@gmail.com>
This commit is contained in:
parent
977a85559e
commit
8503d0143c
117
.drone.yml
117
.drone.yml
@ -7,6 +7,22 @@ platform:
|
|||||||
arch: amd64
|
arch: amd64
|
||||||
|
|
||||||
steps:
|
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
|
- name: build
|
||||||
image: rancher/dapper:v0.5.0
|
image: rancher/dapper:v0.5.0
|
||||||
secrets: [ AWS_SECRET_ACCESS_KEY-k3s-ci-uploader, AWS_ACCESS_KEY_ID-k3s-ci-uploader, unprivileged_github_token ]
|
secrets: [ AWS_SECRET_ACCESS_KEY-k3s-ci-uploader, AWS_ACCESS_KEY_ID-k3s-ci-uploader, unprivileged_github_token ]
|
||||||
@ -179,6 +195,22 @@ platform:
|
|||||||
arch: arm64
|
arch: arm64
|
||||||
|
|
||||||
steps:
|
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
|
- name: build
|
||||||
image: rancher/dapper:v0.5.0
|
image: rancher/dapper:v0.5.0
|
||||||
secrets: [ AWS_SECRET_ACCESS_KEY-k3s-ci-uploader, AWS_ACCESS_KEY_ID-k3s-ci-uploader ]
|
secrets: [ AWS_SECRET_ACCESS_KEY-k3s-ci-uploader, AWS_ACCESS_KEY_ID-k3s-ci-uploader ]
|
||||||
@ -265,6 +297,22 @@ platform:
|
|||||||
arch: arm
|
arch: arm
|
||||||
|
|
||||||
steps:
|
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
|
- name: build
|
||||||
image: rancher/dapper:v0.5.0
|
image: rancher/dapper:v0.5.0
|
||||||
secrets: [ AWS_SECRET_ACCESS_KEY-k3s-ci-uploader, AWS_ACCESS_KEY_ID-k3s-ci-uploader ]
|
secrets: [ AWS_SECRET_ACCESS_KEY-k3s-ci-uploader, AWS_ACCESS_KEY_ID-k3s-ci-uploader ]
|
||||||
@ -365,6 +413,22 @@ steps:
|
|||||||
- git fetch origin $DRONE_COMMIT_REF
|
- git fetch origin $DRONE_COMMIT_REF
|
||||||
- git checkout $DRONE_COMMIT -b origin/$DRONE_TARGET_BRANCH
|
- 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
|
- name: build
|
||||||
image: rancher/dapper:v0.5.8
|
image: rancher/dapper:v0.5.8
|
||||||
secrets: [ AWS_SECRET_ACCESS_KEY-k3s-ci-uploader, AWS_ACCESS_KEY_ID-k3s-ci-uploader ]
|
secrets: [ AWS_SECRET_ACCESS_KEY-k3s-ci-uploader, AWS_ACCESS_KEY_ID-k3s-ci-uploader ]
|
||||||
@ -455,7 +519,23 @@ platform:
|
|||||||
arch: amd64
|
arch: amd64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: validate_go_mods
|
- 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
|
image: rancher/dapper:v0.5.0
|
||||||
commands:
|
commands:
|
||||||
- docker build --target test-mods -t k3s:mod -f Dockerfile.test .
|
- docker build --target test-mods -t k3s:mod -f Dockerfile.test .
|
||||||
@ -464,8 +544,9 @@ steps:
|
|||||||
volumes:
|
volumes:
|
||||||
- name: docker
|
- name: docker
|
||||||
path: /var/run/docker.sock
|
path: /var/run/docker.sock
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: docker
|
- name: docker
|
||||||
host:
|
host:
|
||||||
path: /var/run/docker.sock
|
path: /var/run/docker.sock
|
||||||
|
|
||||||
@ -478,6 +559,22 @@ platform:
|
|||||||
arch: amd64
|
arch: amd64
|
||||||
|
|
||||||
steps:
|
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
|
- name: manifest
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
environment:
|
environment:
|
||||||
@ -518,6 +615,22 @@ platform:
|
|||||||
arch: amd64
|
arch: amd64
|
||||||
|
|
||||||
steps:
|
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
|
- name: dispatch
|
||||||
image: curlimages/curl:7.74.0
|
image: curlimages/curl:7.74.0
|
||||||
user: root
|
user: root
|
||||||
|
9
.droneignore
Normal file
9
.droneignore
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
^.*\.md$
|
||||||
|
^install\.sh$
|
||||||
|
^\.droneignore$
|
||||||
|
^\.github/*$
|
||||||
|
^MAINTAINERS$
|
||||||
|
^CODEOWNERS$
|
||||||
|
^LICENSE$
|
||||||
|
^DCO$
|
||||||
|
^channel\.yaml$
|
@ -160,4 +160,5 @@ Please check out our [contributing guide](CONTRIBUTING.md) if you're interested
|
|||||||
Security
|
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.
|
||||||
|
Loading…
Reference in New Issue
Block a user