This is an automated email from the ASF dual-hosted git repository. duanzhengqiang pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/shardingsphere-on-cloud.git
commit d6051adbacd1070087151625a32fbbd684a91444 Author: Ghoul_Lee <[email protected]> AuthorDate: Wed Jul 20 12:22:05 2022 +0800 feat(ci): add image build && check license ci (#15) * feat(ci): add a ci to build image to github package * fix(ci): fix ci runs-on * fix(ci): fix imagename * fix(ci): add ci env for REGISTRY && IMAGE_NAME * fix(ci): add new ci file to build images * fix(ci): change the conditions * fix(ci): change docker file * feat(ci): add license check * fix(ci): update license * fix(ci): ignore deepcopy file --- .github/workflows/build.yaml | 64 ++++++++++++++++++++++ .github/workflows/check-license.yml | 34 ++++++++++++ .licenserc.yaml | 39 +++++++++++++ .../crds/shardingsphere.sphere-ex.com_proxies.yaml | 17 ++++++ .../shardingsphere.sphere-ex.com_proxyconfigs.yaml | 17 ++++++ shardingsphere-operator/build/Dockerfile | 19 ++++++- 6 files changed, 189 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..9ac6465 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,64 @@ +## +## Copyright © 2022,Beijing Sifei Software Technology Co., LTD. +## All Rights Reserved. +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## + +name: Create and publish a Docker image + +on: + push: + branches: + - dev** + - release** + - main + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Log in to the Container registry + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + file: shardingsphere-operator/build/Dockerfile + + diff --git a/.github/workflows/check-license.yml b/.github/workflows/check-license.yml new file mode 100644 index 0000000..792a5ef --- /dev/null +++ b/.github/workflows/check-license.yml @@ -0,0 +1,34 @@ +## +## Copyright © 2022,Beijing Sifei Software Technology Co., LTD. +## All Rights Reserved. +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## + +name: check-license + +on: [push, pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + check-license: + name: check-license + timeout-minutes: 10 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Check License Header + uses: apache/[email protected] diff --git a/.licenserc.yaml b/.licenserc.yaml new file mode 100644 index 0000000..f9749e2 --- /dev/null +++ b/.licenserc.yaml @@ -0,0 +1,39 @@ +## +## Copyright © 2022,Beijing Sifei Software Technology Co., LTD. +## All Rights Reserved. +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## + +header: + license: + spdx-id: Apache-2.0 + copyright-owner: Beijing Sifei Software Technology Co., LTD. + + paths-ignore: + - '.github/ISSUE_TEMPLATE/**' + - '.github/PULL_REQUEST_TEMPLATE' + - '**/.gitignore' + - 'docs/**' + - '**/*.md' + - '**/.helmignore' + - 'LICENSE' + - '**/*.toml' + - '**/Makefile' + - 'shardingsphere-operator/PROJECT' + - '**/go.mod' + - '**/go.sum' + - 'shardingsphere-operator/build/.dockerignore' + - 'shardingsphere-operator/api/v1alpha1/zz_generated.deepcopy.go' + + comment: on-failure \ No newline at end of file diff --git a/charts/shardingsphere-operator/crds/shardingsphere.sphere-ex.com_proxies.yaml b/charts/shardingsphere-operator/crds/shardingsphere.sphere-ex.com_proxies.yaml index a759332..a620305 100644 --- a/charts/shardingsphere-operator/crds/shardingsphere.sphere-ex.com_proxies.yaml +++ b/charts/shardingsphere-operator/crds/shardingsphere.sphere-ex.com_proxies.yaml @@ -1,3 +1,20 @@ +## +## Copyright © 2022,Beijing Sifei Software Technology Co., LTD. +## All Rights Reserved. +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## + --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition diff --git a/charts/shardingsphere-operator/crds/shardingsphere.sphere-ex.com_proxyconfigs.yaml b/charts/shardingsphere-operator/crds/shardingsphere.sphere-ex.com_proxyconfigs.yaml index e81bafd..8d1a380 100644 --- a/charts/shardingsphere-operator/crds/shardingsphere.sphere-ex.com_proxyconfigs.yaml +++ b/charts/shardingsphere-operator/crds/shardingsphere.sphere-ex.com_proxyconfigs.yaml @@ -1,3 +1,20 @@ +## +## Copyright © 2022,Beijing Sifei Software Technology Co., LTD. +## All Rights Reserved. +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## + --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition diff --git a/shardingsphere-operator/build/Dockerfile b/shardingsphere-operator/build/Dockerfile index 3fbb2b7..f9ffd5a 100644 --- a/shardingsphere-operator/build/Dockerfile +++ b/shardingsphere-operator/build/Dockerfile @@ -1,3 +1,20 @@ +## +## Copyright © 2022,Beijing Sifei Software Technology Co., LTD. +## All Rights Reserved. +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## + # Build the manager binary FROM golang:1.17 as builder @@ -8,7 +25,7 @@ COPY shardingsphere-operator/go.mod go.mod COPY shardingsphere-operator/go.sum go.sum # cache deps before building and copying source so that we don't need to re-download as much # and so that source changes don't invalidate our downloaded layer -ENV GOPROXY=https://proxy.golang.com.cn +#ENV GOPROXY=https://proxy.golang.com.cn RUN go mod download # Copy the go source
