Skip to content

Commit 53c0b27

Browse files
committed
initial commit
1 parent 1433251 commit 53c0b27

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+7761
-25
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Publish scaffolder
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
deploy:
9+
runs-on: [ubuntu-22.04]
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
- name: Setup go
14+
uses: actions/setup-go@v3
15+
with:
16+
go-version-file: 'go.mod'
17+
- name: Build
18+
run: |
19+
mkdir -p bin
20+
for os in linux darwin; do
21+
for arch in amd64 arm64; do
22+
file=bin/scaffold-$os-$arch
23+
echo "Building $file ..."
24+
GOOS=$os GOARCH=$arch go build -o $file -ldflags "-X main.version=${{ github.event.release.tag_name }}" ./scaffold
25+
done
26+
done
27+
- name: Upload
28+
run: |
29+
for os in linux darwin; do
30+
for arch in amd64 arm64; do
31+
upload_url="${{ github.event.release.upload_url }}"
32+
upload_url=${upload_url%%\{*\}}
33+
file=bin/scaffold-$os-$arch
34+
echo "Uploading $file to $upload_url ..."
35+
curl -sSf \
36+
-H "Accept: application/vnd.github+json" \
37+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
38+
-H "Content-Type: $(file -b --mime-type $file)" \
39+
--data-binary @$file \
40+
"$upload_url?name=$(basename $file)"
41+
done
42+
done
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Publish Website
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- website/**
9+
- .github/workflows/publish-website.yaml
10+
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
concurrency:
19+
group: "pages"
20+
cancel-in-progress: false
21+
22+
defaults:
23+
run:
24+
shell: bash
25+
26+
jobs:
27+
build:
28+
runs-on: ubuntu-22.04
29+
env:
30+
HUGO_VERSION: 0.111.2
31+
steps:
32+
- name: Install Hugo
33+
run: |
34+
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
35+
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
36+
- name: Install Dart Sass Embedded
37+
run: |
38+
sudo snap install dart-sass-embedded
39+
- name: Checkout
40+
uses: actions/checkout@v3
41+
with:
42+
submodules: recursive
43+
fetch-depth: 0
44+
- name: Setup Pages
45+
id: pages
46+
uses: actions/configure-pages@v3
47+
- name: Get node version from package.json
48+
id: get_node_version
49+
run: |
50+
node_version=$(cat website/package.json | jq -r '.dependencies.node')
51+
echo "::set-output name=node_version::${node_version}"
52+
- name: Setup Node
53+
uses: actions/setup-node@v3
54+
with:
55+
node-version: '${{ steps.get_node_version.outputs.node_version }}'
56+
- name: Update dependencies
57+
run: |
58+
cd website
59+
npm ci
60+
cd themes/docsy
61+
npm install
62+
- name: Build with Hugo
63+
env:
64+
HUGO_ENVIRONMENT: production
65+
HUGO_ENV: production
66+
run: |
67+
cd website
68+
hugo \
69+
--gc \
70+
--minify \
71+
--baseURL "${{ steps.pages.outputs.base_url }}/"
72+
- name: Upload artifact
73+
uses: actions/upload-pages-artifact@v1
74+
with:
75+
path: ./website/public
76+
77+
deploy:
78+
environment:
79+
name: github-pages
80+
url: ${{ steps.deployment.outputs.page_url }}
81+
runs-on: ubuntu-latest
82+
needs: build
83+
steps:
84+
- name: Deploy to GitHub Pages
85+
id: deployment
86+
uses: actions/deploy-pages@v2

.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
bin
8+
testbin/*
9+
__debug_bin
10+
11+
# Test binary, build with `go test -c`
12+
*.test
13+
14+
# Output of the go coverage tool, specifically when used with LiteIDE
15+
*.out
16+
17+
# Kubernetes Generated files - skip generated files, except for vendored files
18+
19+
!vendor/**/zz_generated.*
20+
21+
# editor and IDE paraphernalia
22+
.idea
23+
*.swp
24+
*.swo
25+
*~
26+
.DS_Store
27+
28+
# temp stuff
29+
/tmp
30+
31+
# Hugo artifacts
32+
.hugo_build.lock
33+
/website/resources
34+
/website/node_modules
35+
/website/public

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "website/themes/docsy"]
2+
path = website/themes/docsy
3+
url = https://github.com/google/docsy.git

LICENSE

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -174,28 +174,3 @@
174174
of your accepting any such warranty or additional liability.
175175

176176
END OF TERMS AND CONDITIONS
177-
178-
APPENDIX: How to apply the Apache License to your work.
179-
180-
To apply the Apache License to your work, attach the following
181-
boilerplate notice, with the fields enclosed by brackets "[]"
182-
replaced with your own identifying information. (Don't include
183-
the brackets!) The text should be enclosed in the appropriate
184-
comment syntax for the file format. We also recommend that a
185-
file or class name and description of purpose be included on the
186-
same "printed page" as the copyright notice for easier
187-
identification within third-party archives.
188-
189-
Copyright [yyyy] [name of copyright owner]
190-
191-
Licensed under the Apache License, Version 2.0 (the "License");
192-
you may not use this file except in compliance with the License.
193-
You may obtain a copy of the License at
194-
195-
http://www.apache.org/licenses/LICENSE-2.0
196-
197-
Unless required by applicable law or agreed to in writing, software
198-
distributed under the License is distributed on an "AS IS" BASIS,
199-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200-
See the License for the specific language governing permissions and
201-
limitations under the License.

Makefile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
2+
ifeq (,$(shell go env GOBIN))
3+
GOBIN=$(shell go env GOPATH)/bin
4+
else
5+
GOBIN=$(shell go env GOBIN)
6+
endif
7+
8+
# Setting SHELL to bash allows bash commands to be executed by recipes.
9+
# Options are set to exit when a recipe line exits non-zero or a piped command fails.
10+
SHELL = /usr/bin/env bash -o pipefail
11+
.SHELLFLAGS = -ec
12+
13+
##@ Development
14+
15+
.PHONY: generate
16+
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
17+
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./pkg/..."
18+
19+
.PHONY: fmt
20+
fmt: ## Run go fmt against code.
21+
go fmt ./...
22+
23+
.PHONY: vet
24+
vet: ## Run go vet against code.
25+
go vet ./...
26+
27+
##@ Build Dependencies
28+
29+
## Location to install dependencies to
30+
LOCALBIN ?= $(shell pwd)/bin
31+
$(LOCALBIN):
32+
mkdir -p $(LOCALBIN)
33+
34+
## Tool Binaries
35+
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
36+
37+
## Tool Versions
38+
CONTROLLER_TOOLS_VERSION ?= v0.9.2
39+
40+
.PHONY: controller-gen
41+
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary.
42+
$(CONTROLLER_GEN): $(LOCALBIN)
43+
test -s $(LOCALBIN)/controller-gen || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)

go.mod

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
module github.com/sap/component-operator-runtime
2+
3+
go 1.19
4+
5+
require (
6+
github.com/Masterminds/sprig/v3 v3.2.3
7+
github.com/pkg/errors v0.9.1
8+
github.com/spf13/pflag v1.0.5
9+
github.tools.sap/cs-devops/go-generics v0.0.2
10+
k8s.io/api v0.26.2
11+
k8s.io/apiextensions-apiserver v0.26.2
12+
k8s.io/apimachinery v0.26.2
13+
k8s.io/client-go v0.26.2
14+
k8s.io/kube-aggregator v0.26.2
15+
sigs.k8s.io/cli-utils v0.34.0
16+
sigs.k8s.io/controller-runtime v0.14.2
17+
sigs.k8s.io/kustomize/api v0.13.2
18+
sigs.k8s.io/kustomize/kyaml v0.14.1
19+
sigs.k8s.io/yaml v1.3.0
20+
)
21+
22+
require (
23+
golang.org/x/net v0.7.0 // indirect
24+
github.com/Masterminds/goutils v1.1.1 // indirect
25+
github.com/Masterminds/semver/v3 v3.2.0 // indirect
26+
github.com/beorn7/perks v1.0.1 // indirect
27+
github.com/cespare/xxhash/v2 v2.1.2 // indirect
28+
github.com/davecgh/go-spew v1.1.1 // indirect
29+
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
30+
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
31+
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
32+
github.com/fsnotify/fsnotify v1.6.0 // indirect
33+
github.com/go-errors/errors v1.4.2 // indirect
34+
github.com/go-logr/logr v1.2.3 // indirect
35+
github.com/go-openapi/jsonpointer v0.19.6 // indirect
36+
github.com/go-openapi/jsonreference v0.20.1 // indirect
37+
github.com/go-openapi/swag v0.22.3 // indirect
38+
github.com/gogo/protobuf v1.3.2 // indirect
39+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
40+
github.com/golang/protobuf v1.5.2 // indirect
41+
github.com/google/gnostic v0.5.7-v3refs // indirect
42+
github.com/google/go-cmp v0.5.9 // indirect
43+
github.com/google/gofuzz v1.2.0 // indirect
44+
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
45+
github.com/google/uuid v1.3.0 // indirect
46+
github.com/huandu/xstrings v1.3.3 // indirect
47+
github.com/imdario/mergo v0.3.12 // indirect
48+
github.com/josharian/intern v1.0.0 // indirect
49+
github.com/json-iterator/go v1.1.12 // indirect
50+
github.com/mailru/easyjson v0.7.7 // indirect
51+
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
52+
github.com/mitchellh/copystructure v1.2.0 // indirect
53+
github.com/mitchellh/reflectwalk v1.0.2 // indirect
54+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
55+
github.com/modern-go/reflect2 v1.0.2 // indirect
56+
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
57+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
58+
github.com/prometheus/client_golang v1.14.0 // indirect
59+
github.com/prometheus/client_model v0.3.0 // indirect
60+
github.com/prometheus/common v0.37.0 // indirect
61+
github.com/prometheus/procfs v0.8.0 // indirect
62+
github.com/shopspring/decimal v1.2.0 // indirect
63+
github.com/spf13/cast v1.3.1 // indirect
64+
github.com/xlab/treeprint v1.1.0 // indirect
65+
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
66+
golang.org/x/crypto v0.5.0 // indirect
67+
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
68+
golang.org/x/sys v0.5.0 // indirect
69+
golang.org/x/term v0.5.0 // indirect
70+
golang.org/x/text v0.7.0 // indirect
71+
golang.org/x/time v0.3.0 // indirect
72+
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
73+
google.golang.org/appengine v1.6.7 // indirect
74+
google.golang.org/protobuf v1.28.1 // indirect
75+
gopkg.in/inf.v0 v0.9.1 // indirect
76+
gopkg.in/yaml.v2 v2.4.0 // indirect
77+
gopkg.in/yaml.v3 v3.0.1 // indirect
78+
k8s.io/component-base v0.26.2 // indirect
79+
k8s.io/klog/v2 v2.80.1 // indirect
80+
k8s.io/kube-openapi v0.0.0-20230109183929-3758b55a6596 // indirect
81+
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
82+
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
83+
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
84+
)

0 commit comments

Comments
 (0)