Skip to content

Commit

Permalink
Add playground build job to the CI (#1793)
Browse files Browse the repository at this point in the history
**What this PR does / why we need it**:

**Which issue(s) this PR fixes**:

Ref #1617 

**Does this PR introduce a user-facing change?**:
<!--
If no, just write "NONE" in the release-note block below.
-->
```release-note
NONE
```

This PR was merged by Kapetanios.
  • Loading branch information
cakecatz authored Mar 29, 2021
1 parent 71017da commit 5a1e38a
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .kapetanios/postsubmit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,31 @@ spec:
commands:
- docker tag pipecd-site gcr.io/pipecd/site:$(git describe --tags --always --abbrev=7)
- docker push gcr.io/pipecd/site:$(git describe --tags --always --abbrev=7)

- name: push-play-image
branches:
- master
dockerAuth:
address: https://gcr.io
secret:
name: container_registry_service_account
type: PROJECT
steps:
- name: web-build
description: Build static files
runner: gcr.io/pipecd/runner:1.0.0
commands:
- bazelisk build //pkg/app/web:public_files --action_env=ENABLE_MOCK=true
- cp -rf $(bazelisk info bazel-bin)/pkg/app/web/public_files ./play/public
- name: docker-build
description: Build docker image
runner: gcr.io/cloud-builders/docker
commands:
- cd play
- docker build -t pipecd-play .
- name: docker-push
description: Push docker image
runner: gcr.io/cloud-builders/docker
commands:
- docker tag pipecd-play gcr.io/pipecd/play:$(git describe --tags --always --abbrev=7)
- docker push gcr.io/pipecd/play:$(git describe --tags --always --abbrev=7)
1 change: 1 addition & 0 deletions pkg/app/web/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ webpack(
"model",
"webpack.common.js",
"webpack.config.js",
"public/mockServiceWorker.js",
"@npm//:node_modules",
] + glob(["assets/**/*"]),
output_dir = True,
Expand Down
1 change: 1 addition & 0 deletions pkg/app/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@typescript-eslint/eslint-plugin": "^3.3.0",
"@typescript-eslint/parser": "^3.3.0",
"babel-loader": "^8.1.0",
"copy-webpack-plugin": "^6",
"eslint": "^7.3.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-jest": "^23.16.0",
Expand Down
9 changes: 9 additions & 0 deletions pkg/app/web/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const HtmlWebpackPlugin = require("html-webpack-plugin");
const path = require("path");
const webpack = require("webpack");
const CopyPlugin = require("copy-webpack-plugin");

module.exports = (_, argv) => {
return {
Expand Down Expand Up @@ -47,6 +48,14 @@ module.exports = (_, argv) => {
template: argv.htmlTemplate,
favicon: path.join(__dirname, "assets/favicon.ico"),
}),
process.env.ENABLE_MOCK &&
new CopyPlugin({
patterns: [
{
from: path.join(__dirname, "public/mockServiceWorker.js"),
},
],
}),
new webpack.EnvironmentPlugin(["ENABLE_MOCK"]),
].filter(Boolean),
};
Expand Down
55 changes: 55 additions & 0 deletions pkg/app/web/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5371,6 +5371,23 @@ copy-to-clipboard@^3.0.8, copy-to-clipboard@^3.3.1:
dependencies:
toggle-selection "^1.0.6"

copy-webpack-plugin@^6:
version "6.4.1"
resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-6.4.1.tgz#138cd9b436dbca0a6d071720d5414848992ec47e"
integrity sha512-MXyPCjdPVx5iiWyl40Va3JGh27bKzOTNY3NjUTrosD2q7dR/cLD0013uqJ3BpFbUjyONINjb6qI7nDIJujrMbA==
dependencies:
cacache "^15.0.5"
fast-glob "^3.2.4"
find-cache-dir "^3.3.1"
glob-parent "^5.1.1"
globby "^11.0.1"
loader-utils "^2.0.0"
normalize-path "^3.0.0"
p-limit "^3.0.2"
schema-utils "^3.0.0"
serialize-javascript "^5.0.1"
webpack-sources "^1.4.3"

core-js-compat@^3.7.0:
version "3.7.0"
resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.7.0.tgz#8479c5d3d672d83f1f5ab94cf353e57113e065ed"
Expand Down Expand Up @@ -6836,6 +6853,18 @@ fast-glob@^3.1.1:
micromatch "^4.0.2"
picomatch "^2.2.1"

fast-glob@^3.2.4:
version "3.2.5"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.5.tgz#7939af2a656de79a4f1901903ee8adcaa7cb9661"
integrity sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==
dependencies:
"@nodelib/fs.stat" "^2.0.2"
"@nodelib/fs.walk" "^1.2.3"
glob-parent "^5.1.0"
merge2 "^1.3.0"
micromatch "^4.0.2"
picomatch "^2.2.1"

fast-json-parse@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/fast-json-parse/-/fast-json-parse-1.0.3.tgz#43e5c61ee4efa9265633046b770fb682a7577c4d"
Expand Down Expand Up @@ -7376,6 +7405,13 @@ glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@~5.1.0:
dependencies:
is-glob "^4.0.1"

glob-parent@^5.1.1:
version "5.1.2"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
dependencies:
is-glob "^4.0.1"

glob-promise@^3.4.0:
version "3.4.0"
resolved "https://registry.yarnpkg.com/glob-promise/-/glob-promise-3.4.0.tgz#b6b8f084504216f702dc2ce8c9bc9ac8866fdb20"
Expand Down Expand Up @@ -7483,6 +7519,18 @@ [email protected]:
pify "^3.0.0"
slash "^1.0.0"

globby@^11.0.1:
version "11.0.3"
resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.3.tgz#9b1f0cb523e171dd1ad8c7b2a9fb4b644b9593cb"
integrity sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==
dependencies:
array-union "^2.1.0"
dir-glob "^3.0.1"
fast-glob "^3.1.1"
ignore "^5.1.4"
merge2 "^1.3.0"
slash "^3.0.0"

globby@^11.0.2:
version "11.0.2"
resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.2.tgz#1af538b766a3b540ebfb58a32b2e2d5897321d83"
Expand Down Expand Up @@ -12725,6 +12773,13 @@ serialize-javascript@^4.0.0:
dependencies:
randombytes "^2.1.0"

serialize-javascript@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-5.0.1.tgz#7886ec848049a462467a97d3d918ebb2aaf934f4"
integrity sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==
dependencies:
randombytes "^2.1.0"

serve-favicon@^2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/serve-favicon/-/serve-favicon-2.5.0.tgz#935d240cdfe0f5805307fdfe967d88942a2cbcf0"
Expand Down
3 changes: 3 additions & 0 deletions play/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM gcr.io/pipecd/static:0.0.1

COPY public /public

0 comments on commit 5a1e38a

Please sign in to comment.