Skip to content

Commit

Permalink
chore(console): gen proto on npm postinstall, ignore generated output (
Browse files Browse the repository at this point in the history
…#266)

* proto gen

* fix: remove type from project lists (#256)

* fix: remove type from project lists

* Update user-detail.component.ts

* fix: remove add project

Co-authored-by: Livio Amstutz <livio.a@gmail.com>

* fix project view model

* regen mgmt proto

* rm orgid from route, switch to project view

* chore(deps-dev): bump @types/jasmine from 3.5.10 to 3.5.11 in /console (#252)

Bumps [@types/jasmine](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jasmine) from 3.5.10 to 3.5.11.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jasmine)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump @angular-devkit/build-angular in /console (#251)

Bumps [@angular-devkit/build-angular](https://github.com/angular/angular-cli) from 0.901.7 to 0.901.9.
- [Release notes](https://github.com/angular/angular-cli/releases)
- [Commits](https://github.com/angular/angular-cli/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump moment from 2.26.0 to 2.27.0 in /console (#250)

Bumps [moment](https://github.com/moment/moment) from 2.26.0 to 2.27.0.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](moment/moment@2.26.0...2.27.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump karma from 5.0.9 to 5.1.0 in /console (#218)

Bumps [karma](https://github.com/karma-runner/karma) from 5.0.9 to 5.1.0.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](karma-runner/karma@v5.0.9...v5.1.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump ngx-moment from 3.5.0 to 4.0.1 in /console (#219)

Bumps [ngx-moment](https://github.com/urish/ngx-moment) from 3.5.0 to 4.0.1.
- [Release notes](https://github.com/urish/ngx-moment/releases)
- [Changelog](https://github.com/urish/ngx-moment/blob/master/CHANGELOG.md)
- [Commits](urish/ngx-moment@3.5.0...4.0.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Peintner <max@caos.ch>

* chore(deps-dev): bump @angular/language-service in /console (#217)

Bumps [@angular/language-service](https://github.com/angular/angular/tree/HEAD/packages/language-service) from 9.1.10 to 9.1.11.
- [Release notes](https://github.com/angular/angular/releases)
- [Changelog](https://github.com/angular/angular/blob/master/CHANGELOG.md)
- [Commits](https://github.com/angular/angular/commits/9.1.11/packages/language-service)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Peintner <max@caos.ch>

* chore(deps-dev): bump @angular/cli from 9.1.7 to 9.1.9 in /console (#249)

Bumps [@angular/cli](https://github.com/angular/angular-cli) from 9.1.7 to 9.1.9.
- [Release notes](https://github.com/angular/angular-cli/releases)
- [Commits](angular/angular-cli@v9.1.7...v9.1.9)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Peintner <max@caos.ch>

* set partial user profile

* fix org routing

* auth user loginnames, i18n

* fix clipboard, secret regeneration

* project role required field

* show change editor

* show granted project grid, remove add button

* hide meta overflow

* username validation

* common pwd validators

* fix org create pwd validation

* show 2fa error

* add postinstall script

* fix: postinstall script ref

* setup go env for proto gen

* revert i18n

* set gopath manually

* test

* test

* test

* trial

* test

* hop

* protoc

* test

* test

* path

* path

* path

* wat

* path

* try a hardcoded approach

* remove failing steps

* test

* test

* chore: gitignore

* chore: build file for grpc-web

* chore: delete files

* chore: reduce package.json

* chore: test angular build

* download protoc

* use sudo

* full pipeline

* test

* protoc in lint

* remove lint

Co-authored-by: Fabi <38692350+fgerschwiler@users.noreply.github.com>
Co-authored-by: Livio Amstutz <livio.a@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Florian Forster <florian@caos.ch>
  • Loading branch information
5 people committed Jul 7, 2020
1 parent fb2091e commit 8a098bb
Show file tree
Hide file tree
Showing 21 changed files with 43 additions and 68,511 deletions.
29 changes: 19 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,23 @@ env:

jobs:

angular-lint: # will be added later on
## Angular test, will be added later

angular-lint:
runs-on: ubuntu-18.04
defaults:
run:
working-directory: ./console
steps:
- uses: actions/checkout@v2
- name: Install Protoc
uses: arduino/setup-protoc@master
with:
version: '3.x'
- run: wget -O protoc-gen-grpc-web https://github.com/grpc/grpc-web/releases/download/1.2.0/protoc-gen-grpc-web-1.2.0-linux-x86_64
- run: sudo mv protoc-gen-grpc-web /usr/local/bin/protoc-gen-grpc-web
- run: sudo chmod +x /usr/local/bin/protoc-gen-grpc-web
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
Expand All @@ -30,6 +40,13 @@ jobs:
working-directory: ./console
steps:
- uses: actions/checkout@v2
- name: Install Protoc
uses: arduino/setup-protoc@master
with:
version: '3.x'
- run: wget -O protoc-gen-grpc-web https://github.com/grpc/grpc-web/releases/download/1.2.0/protoc-gen-grpc-web-1.2.0-linux-x86_64
- run: sudo mv protoc-gen-grpc-web /usr/local/bin/protoc-gen-grpc-web
- run: sudo chmod +x /usr/local/bin/protoc-gen-grpc-web
- uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
Expand Down Expand Up @@ -57,15 +74,7 @@ jobs:
file: ./profile.cov
name: codecov-go

go-lint:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2-beta
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/checkout@v2
- run: echo "replace me with real lint"
## go lint, will be added later

go-build:
runs-on: ubuntu-18.04
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ cockroach-data/*
#binaries
cmd/zitadel/zitadel
**/statik/statik.go

# buildfolders and generated js
tmp/
console/src/app/proto/generated/
28 changes: 16 additions & 12 deletions build/console/generate-grpc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,34 @@

set -eux

GEN_PATH=${GOPATH}/src/github.com/caos/zitadel/console/src/app/proto/generated
GEN_PATH=src/app/proto/generated

echo "Remove old files"
rm -rf $GEN_PATH

echo "Create folders"
mkdir -p $GEN_PATH

echo "Download additional protofiles"
wget -P tmp/validate https://raw.githubusercontent.com/envoyproxy/protoc-gen-validate/v0.4.0/validate/validate.proto
wget -P tmp/protoc-gen-swagger/options https://raw.githubusercontent.com/grpc-ecosystem/grpc-gateway/v1.14.6/protoc-gen-swagger/options/annotations.proto
wget -P tmp/protoc-gen-swagger/options https://raw.githubusercontent.com/grpc-ecosystem/grpc-gateway/v1.14.6/protoc-gen-swagger/options/openapiv2.proto

echo "Generate grpc"

protoc \
-I=/usr/local/include \
-I=${GOPATH}/src/github.com/caos/zitadel/pkg/management/api/proto \
-I=${GOPATH}/src/github.com/caos/zitadel/pkg/auth/api/proto \
-I=${GOPATH}/src/github.com/caos/zitadel/pkg/admin/api/proto \
-I=${GOPATH}/src/github.com/caos/zitadel/internal/protoc/protoc-gen-authoption \
-I=${GOPATH}/src/github.com/caos/zitadel/console/node_modules/google-proto-files \
-I=${GOPATH}/src/github.com/envoyproxy/protoc-gen-validate \
-I=${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway \
-I=../pkg/management/api/proto \
-I=../pkg/auth/api/proto \
-I=../pkg/admin/api/proto \
-I=../internal/protoc/protoc-gen-authoption \
-I=node_modules/google-proto-files \
-I=tmp \
--js_out=import_style=commonjs,binary:$GEN_PATH \
--grpc-web_out=import_style=commonjs+dts,mode=grpcweb:$GEN_PATH \
${GOPATH}/src/github.com/caos/zitadel/pkg/management/api/proto/*.proto \
${GOPATH}/src/github.com/caos/zitadel/pkg/admin/api/proto/*.proto \
${GOPATH}/src/github.com/caos/zitadel/pkg/auth/api/proto/*.proto
../pkg/management/api/proto/*.proto \
../pkg/admin/api/proto/*.proto \
../pkg/auth/api/proto/*.proto

echo "Generate annotations js file (compatibility)"

Expand All @@ -43,4 +47,4 @@ echo "export {}" > $GEN_PATH/protoc-gen-swagger/options/annotations_pb.d.ts

mkdir -p $GEN_PATH/authoption
touch $GEN_PATH/authoption/options_pb.js
echo "export {}" > $GEN_PATH/authoption/options_pb.d.ts
echo "export {}" > $GEN_PATH/authoption/options_pb.d.ts
3 changes: 3 additions & 0 deletions console/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ testem.log
.DS_Store
Thumbs.db
.vscode/settings.json

# Proto generated js files
src/app/proto
5 changes: 1 addition & 4 deletions console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@
"version": "0.0.0",
"scripts": {
"ng": "ng",
"prestart": "npm run proto",
"start": "ng serve",
"build": "ng build",
"prodbuild": "ng build --prod",
"test": "ng test",
"lint": "ng lint && stylelint './projects/**/*.scss' --syntax scss",
"e2e": "ng e2e",
"proto": "./etc/generate-grpc.sh || echo 'could not generate grpc'"
"postinstall": "../build/console/generate-grpc.sh"
},
"private": true,
"dependencies": {
Expand Down

0 comments on commit 8a098bb

Please sign in to comment.