2021-01-29 11:18:22 +03:00
|
|
|
load("@io_bazel_rules_docker//container:container.bzl", "container_push")
|
|
|
|
load("@io_bazel_rules_docker//nodejs:image.bzl", "nodejs_image")
|
2022-03-28 17:39:36 +03:00
|
|
|
load("@npm//nuxt3:index.bzl", "nuxi")
|
2021-04-25 15:11:06 +03:00
|
|
|
|
2022-03-28 17:39:36 +03:00
|
|
|
files = [
|
|
|
|
"app.vue",
|
|
|
|
"nuxt.config.ts",
|
|
|
|
] + glob([
|
2021-04-25 15:11:06 +03:00
|
|
|
"components/**/*.vue",
|
2022-03-28 17:39:36 +03:00
|
|
|
"layouts/**/*.vue",
|
|
|
|
"plugins/**/*.js",
|
2021-04-25 15:11:06 +03:00
|
|
|
])
|
2021-01-29 11:18:22 +03:00
|
|
|
|
|
|
|
deps = [
|
2022-03-28 17:39:36 +03:00
|
|
|
"@npm//axios",
|
|
|
|
"@npm//bootstrap-vue-3",
|
2021-01-29 11:18:22 +03:00
|
|
|
"@npm//pug",
|
|
|
|
"@npm//pug-plain-loader",
|
|
|
|
"@npm//sass",
|
|
|
|
"@npm//sass-loader",
|
|
|
|
"@npm//vue",
|
2022-03-28 17:39:36 +03:00
|
|
|
"@npm//@types/node",
|
2021-04-23 18:23:02 +03:00
|
|
|
"//nexus/meta_api/js/client",
|
2021-04-30 16:05:39 +03:00
|
|
|
"//nexus/views/js",
|
2021-01-29 11:18:22 +03:00
|
|
|
]
|
|
|
|
|
2022-03-28 17:39:36 +03:00
|
|
|
nuxi(
|
2021-04-25 15:11:06 +03:00
|
|
|
name = "web-dev",
|
2021-01-29 11:18:22 +03:00
|
|
|
args = [
|
2022-03-28 17:39:36 +03:00
|
|
|
"dev",
|
|
|
|
"nexus/cognitron/web",
|
2021-01-29 11:18:22 +03:00
|
|
|
],
|
2021-04-30 16:05:39 +03:00
|
|
|
data = files + deps,
|
2021-01-29 11:18:22 +03:00
|
|
|
)
|
|
|
|
|
2022-03-28 17:39:36 +03:00
|
|
|
nuxi(
|
|
|
|
name = ".output",
|
2021-01-29 11:18:22 +03:00
|
|
|
args = [
|
|
|
|
"build",
|
2022-03-28 17:39:36 +03:00
|
|
|
"nexus/cognitron/web",
|
2021-01-29 11:18:22 +03:00
|
|
|
"--buildDir=$(@D)",
|
|
|
|
],
|
2021-04-25 15:11:06 +03:00
|
|
|
data = files + deps,
|
2021-01-29 11:18:22 +03:00
|
|
|
output_dir = True,
|
|
|
|
)
|
|
|
|
|
|
|
|
nodejs_image(
|
|
|
|
name = "image",
|
|
|
|
base = "//images/production:base-nodejs-image",
|
2022-03-28 17:39:36 +03:00
|
|
|
data = [":.output"],
|
|
|
|
entry_point = ".output/server/index.mjs",
|
2021-01-29 11:18:22 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
container_push(
|
|
|
|
name = "push-public-latest",
|
|
|
|
format = "Docker",
|
|
|
|
image = ":image",
|
|
|
|
registry = "registry.hub.docker.com",
|
2021-04-30 16:05:39 +03:00
|
|
|
repository = "thesuperpirate/nexus-cognitron-web",
|
2021-01-29 11:18:22 +03:00
|
|
|
tag = "latest",
|
|
|
|
)
|
|
|
|
|
|
|
|
container_push(
|
|
|
|
name = "push-public-testing",
|
|
|
|
format = "Docker",
|
|
|
|
image = ":image",
|
|
|
|
registry = "registry.hub.docker.com",
|
2021-04-30 16:05:39 +03:00
|
|
|
repository = "thesuperpirate/nexus-cognitron-web",
|
2021-01-29 11:18:22 +03:00
|
|
|
tag = "testing",
|
|
|
|
)
|
2021-04-30 16:05:39 +03:00
|
|
|
|