File tree 13 files changed +71
-248
lines changed
13 files changed +71
-248
lines changed Original file line number Diff line number Diff line change 8
8
branches :
9
9
- master
10
10
11
- env :
12
- HELM_VERSION : 3.8.2
13
-
14
11
jobs :
15
12
backend :
16
13
name : Backend
40
37
- uses : actions/setup-node@v2
41
38
with :
42
39
node-version : ' 16.13.0'
43
-
44
40
- name : Get yarn cache directory path
45
41
id : yarn-cache-dir-path
46
42
run : echo "::set-output name=dir::$(yarn cache dir)"
@@ -51,12 +47,17 @@ jobs:
51
47
key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
52
48
restore-keys : |
53
49
${{ runner.os }}-yarn-
50
+ - name : Yarn install
51
+ working-directory : web
52
+ run : yarn install --prefer-offline
54
53
- name : Build web static
55
- run : make build-frontend
54
+ run : make web-build
56
55
57
56
chart :
58
57
name : Helm Chart
59
58
runs-on : ubuntu-latest
59
+ env :
60
+ HELM_VERSION : 3.8.2
60
61
steps :
61
62
- uses : actions/checkout@v2
62
63
with :
Original file line number Diff line number Diff line change 39
39
run : make build-go GO_BUILD_COMPONENT=helloworld
40
40
41
41
# Building frontend.
42
+ - uses : actions/setup-node@v2
43
+ with :
44
+ node-version : ' 16.13.0'
45
+ - name : Get yarn cache directory path
46
+ id : yarn-cache-dir-path
47
+ run : echo "::set-output name=dir::$(yarn cache dir)"
48
+ - uses : actions/cache@v2
49
+ id : yarn-cache
50
+ with :
51
+ path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
52
+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
53
+ restore-keys : |
54
+ ${{ runner.os }}-yarn-
55
+ - name : Yarn install
56
+ working-directory : web
57
+ run : yarn install
42
58
- name : Build web static
43
- run : make build-frontend
59
+ run : |
60
+ make web-build
61
+ rm -rf .artifacts/web-static
62
+ mkdir -p .artifacts/web-static
63
+ cp -rf web/dist/. .artifacts/web-static
44
64
45
65
# Login to push container images.
46
66
- name : Log in to the container registry
Original file line number Diff line number Diff line change 28
28
- uses : actions/setup-node@v2
29
29
with :
30
30
node-version : ' 16.13.0'
31
-
32
31
- name : Get yarn cache directory path
33
32
id : yarn-cache-dir-path
34
33
run : echo "::set-output name=dir::$(yarn cache dir)"
39
38
key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
40
39
restore-keys : |
41
40
${{ runner.os }}-yarn-
42
-
43
41
- name : Yarn install
44
42
working-directory : web
45
- run : yarn install
43
+ run : yarn install --prefer-offline
46
44
- name : Run unit tests
47
- working-directory : web
48
- run : echo "WIP"
45
+ run : make web-test
Original file line number Diff line number Diff line change 57
57
secrets :
58
58
- name : bazel_cache_service_account
59
59
type : PROJECT
60
-
61
- - name : web-test
62
- timeout : 30m
63
- whenChanged :
64
- - web/**
65
- steps :
66
- - name : restore-cache
67
- description : Restore node modules cache
68
- runner : kapetanios@restore-cache
69
- params :
70
- - key=node_modules
71
- - path=/workspace/.yarn
72
- - name : install-dependencies
73
- runner : gcr.io/kapetanios/node:16.13.1
74
- commands :
75
- - cd web
76
- - yarn install --frozen-lockfile
77
- - description : Save node modules cache
78
- runner : kapetanios@save-cache
79
- params :
80
- - key=node_modules
81
- - path=/workspace/.yarn
82
- - name : generate-client
83
- description : Generate API client code
84
- runner : gcr.io/pipecd/runner:1.0.0
85
- commands :
86
- - bazelisk --output_base=/workspace/bazel_out build --config=ci //web:build_api //web:build_model
87
- secrets :
88
- - name : bazel_cache_service_account
89
- type : PROJECT
90
- - name : test
91
- description : Run all web tests
92
- runner : gcr.io/kapetanios/node:16.13.1
93
- commands :
94
- - cd web
95
- - yarn test:coverage --coverageDirectory=/artifact --runInBand
96
- - yarn typecheck
97
- requires :
98
- - generate-client
99
- - install-dependencies
Original file line number Diff line number Diff line change @@ -86,6 +86,10 @@ web-dep:
86
86
web-dev :
87
87
cd web; yarn dev
88
88
89
+ .PHONY : web-build
90
+ web-build :
91
+ cd web; yarn build
92
+
89
93
.PHONY : web-test
90
94
web-test :
91
95
cd web; yarn test:coverage --runInBand
@@ -131,14 +135,6 @@ update-docsy:
131
135
codegen :
132
136
docker run --rm -v ${PWD} :/repo -it gcr.io/pipecd/codegen:0.7.0 /repo
133
137
134
- .PHONY : build-frontend
135
- build-frontend :
136
- rm -rf .artifacts/web-static
137
- mkdir -p .artifacts/web-static
138
- bazelisk ${BAZEL_FLAGS} build ${BAZEL_COMMAND_FLAGS} -- //web:static
139
- cp -rf bazel-bin/web/static/. .artifacts/web-static
140
-
141
-
142
138
GO_BUILD_VERSION ?= $(shell git describe --tags --always --dirty --abbrev=7)
143
139
GO_BUILD_COMMIT ?= $(shell git rev-parse HEAD)
144
140
GO_BUILD_DATE ?= $(shell date -u '+% Y% m% d-% H% M% S')
@@ -157,3 +153,4 @@ package-chart: VERSION ?= $(shell git describe --tags --always --dirty --abbrev=
157
153
package-chart :
158
154
mkdir -p .artifacts
159
155
helm package manifests/$(CHART ) --version $(VERSION ) --app-version $(VERSION ) --dependency-update --destination .artifacts
156
+
Original file line number Diff line number Diff line change 1
1
workspace (
2
2
name = "pipecd" ,
3
- managed_directories = {"@npm" : ["web/node_modules" ]},
4
3
)
5
4
6
5
load (
87
86
88
87
buildifier_dependencies ()
89
88
90
- ### web
91
-
92
- http_archive (
93
- name = "build_bazel_rules_nodejs" ,
94
- sha256 = "cfc289523cf1594598215901154a6c2515e8bf3671fd708264a6f6aefe02bf39" ,
95
- urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.4.6/rules_nodejs-4.4.6.tar.gz" ],
96
- )
97
-
98
- load (
99
- "@build_bazel_rules_nodejs//:index.bzl" ,
100
- "node_repositories" ,
101
- "yarn_install" ,
102
- )
103
-
104
- ### https://bazelbuild.github.io/rules_nodejs/Built-ins.html#usage
105
- node_repositories (
106
- node_version = "16.13.0" ,
107
- package_json = ["//web:package.json" ],
108
- yarn_version = "1.22.4" ,
109
- )
110
-
111
- yarn_install (
112
- name = "npm" ,
113
- frozen_lockfile = False ,
114
- package_json = "//web:package.json" ,
115
- yarn_lock = "//web:yarn.lock" ,
116
- )
117
-
118
- load ("@npm//@bazel/labs:package.bzl" , "npm_bazel_labs_dependencies" )
119
-
120
- npm_bazel_labs_dependencies ()
121
-
122
89
# gazelle:repository_macro repositories.bzl%go_repositories
Original file line number Diff line number Diff line change @@ -64,9 +64,6 @@ go_library(
64
64
65
65
go_binary (
66
66
name = "pipecd" ,
67
- data = [
68
- "//web:static" ,
69
- ],
70
67
embed = [":go_default_library" ],
71
68
visibility = ["//visibility:public" ],
72
69
)
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ module.exports = {
6
6
"<rootDir>/file-transformer.js" ,
7
7
} ,
8
8
moduleNameMapper : {
9
- "^pipecd/(.*)$" : "<rootDir>/../bazel-bin/ $1" ,
9
+ "^pipecd/(.*)$" : "<rootDir>/../$1" ,
10
10
"^~/(.*)$" : "<rootDir>/src/$1" ,
11
11
"^~~/(.*)$" : "<rootDir>/$1" ,
12
12
} ,
Original file line number Diff line number Diff line change 5
5
"private" : true ,
6
6
"license" : " Apache-2.0" ,
7
7
"scripts" : {
8
+ "build" : " webpack build --mode production --env htmlTemplate=./base.html --config ./webpack.config.js" ,
8
9
"dev" : " STABLE_VERSION=`git describe --tags --always --dirty --abbrev=7` webpack serve --env htmlTemplate=./base.html --config ./webpack.config.dev.js" ,
9
10
"gen" : " scaffdog generate" ,
10
11
"test" : " TZ=Asia/Tokyo jest --config jest.config.local.js" ,
You can’t perform that action at this time.
0 commit comments