Skip to content

Commit

Permalink
feat(examples): upgrade rules_docker to 0.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Wiles committed Jan 26, 2020
1 parent b28e39a commit d6828b3
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 57 deletions.
3 changes: 0 additions & 3 deletions examples/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,6 @@ example_integration_test(
"@rayman1104",
"@siberex",
],
# Breaks on Windows with `rules_docker requires a python interpreter installed. Please set
# BAZEL_PYTHON, or put it on your path.`
tags = ["fix-windows"],
)

example_integration_test(
Expand Down
20 changes: 11 additions & 9 deletions examples/angular/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ workspace(
)

# These rules are built-into Bazel but we need to load them first to download more rules
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# Fetch rules_nodejs so we can install our npm dependencies
Expand Down Expand Up @@ -112,10 +111,9 @@ http_archive(

http_archive(
name = "io_bazel_rules_docker",
patches = ["//:rules_docker.patch"],
sha256 = "7d453450e1eb70e238eea6b31f4115607ec1200e91afea01c25f9804f37e39c8",
strip_prefix = "rules_docker-0.10.0",
urls = ["https://github.com/bazelbuild/rules_docker/archive/v0.10.0.tar.gz"],
sha256 = "df13123c44b4a4ff2c2f337b906763879d94871d16411bf82dcfeba892b58607",
strip_prefix = "rules_docker-cda964418102ac1f63dce6ed988d14b9d1b9f075",
urls = ["https://github.com/bazelbuild/rules_docker/archive/cda964418102ac1f63dce6ed988d14b9d1b9f075.tar.gz"],
)

load("@io_bazel_rules_docker//repositories:repositories.bzl", container_repositories = "repositories")
Expand All @@ -130,17 +128,21 @@ nodejs_image_repos()
# Kubernetes setup, for deployment to Google Cloud #
####################################################

git_repository(
http_archive(
name = "io_bazel_rules_k8s",
commit = "36ae5b534cc51ab0815c9bc723760469a9f7175c",
remote = "https://github.com/bazelbuild/rules_k8s.git",
shallow_since = "1545317854 -0500",
sha256 = "cc75cf0d86312e1327d226e980efd3599704e01099b58b3c2fc4efe5e321fcd9",
strip_prefix = "rules_k8s-0.3.1",
urls = ["https://github.com/bazelbuild/rules_k8s/releases/download/v0.3.1/rules_k8s-v0.3.1.tar.gz"],
)

load("@io_bazel_rules_k8s//k8s:k8s.bzl", "k8s_defaults", "k8s_repositories")

k8s_repositories()

load("@io_bazel_rules_k8s//k8s:k8s_go_deps.bzl", k8s_go_deps = "deps")

k8s_go_deps()

k8s_defaults(
# This creates a rule called "k8s_deploy" that we can call later
name = "k8s_deploy",
Expand Down
13 changes: 0 additions & 13 deletions examples/angular/rules_docker.patch

This file was deleted.

6 changes: 1 addition & 5 deletions examples/angular/src/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,10 @@ history_server(

nodejs_image(
name = "nodejs_image",
data = [":prodapp"],
entry_point = "@npm//:node_modules/history-server/modules/cli.js",
node_modules = "@npm//:node_modules",
binary = ":prodserver",
# Actions created by this rule are I/O-bound,
# so there is no benefit to running them remotely
tags = ["local"],
templated_args = ["src/prodapp"],
)

container_image(
Expand All @@ -230,5 +227,4 @@ container_image(
# Actions created by this rule are I/O-bound,
# so there is no benefit to running them remotely
tags = ["local"],
workdir = "/app/src/nodejs_image.binary.runfiles/examples_angular",
)
7 changes: 3 additions & 4 deletions examples/nestjs/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ install_bazel_dependencies()

http_archive(
name = "io_bazel_rules_docker",
patches = ["//:rules_docker.patch"],
sha256 = "7d453450e1eb70e238eea6b31f4115607ec1200e91afea01c25f9804f37e39c8",
strip_prefix = "rules_docker-0.10.0",
urls = ["https://github.com/bazelbuild/rules_docker/archive/v0.10.0.tar.gz"],
sha256 = "497037c5af1952b0a3fed626e80f979837cf224232f0bb6f87039a0bb394a8cf",
strip_prefix = "rules_docker-cda964418102ac1f63dce6ed988d14b9d1b9f075",
urls = ["https://github.com/bazelbuild/rules_docker/archive/cda964418102ac1f63dce6ed988d14b9d1b9f075.tar.gz"],
)

load(
Expand Down
1 change: 1 addition & 0 deletions examples/nestjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
},
"devDependencies": {
"@bazel/typescript": "^1.2.0",
"@bazel/bazel": "^1.2.0",
"@types/node": "12.6.3",
"typescript": "3.5.3"
},
Expand Down
13 changes: 0 additions & 13 deletions examples/nestjs/rules_docker.patch

This file was deleted.

8 changes: 1 addition & 7 deletions examples/nestjs/src/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,5 @@ load("@io_bazel_rules_docker//nodejs:image.bzl", "nodejs_image")
# bazel build --platforms=@build_bazel_rules_nodejs//toolchains/node:linux_amd64 //src:docker
nodejs_image(
name = "docker",
data = [
":app",
],
entry_point = ":main.ts",
# TODO: switch to fine grained deps -- see bazelbuild/rules_docker#1000
# and add test for docker image
node_modules = "@npm//:node_modules",
binary = ":server",
)
6 changes: 3 additions & 3 deletions examples/nestjs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"@bazel/bazel-win32_x64" "2.0.0"

"@bazel/hide-bazel-files@latest":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@bazel/hide-bazel-files/-/hide-bazel-files-1.0.1.tgz#bfba5c73f307cd69c25411084023f60cdd89ef01"
integrity sha512-3unoDYZIGxtePTa/bhsWZ0pxtI/G9LYr41Kkb1ZpSaSz27ZDvj6Aysbc0u9TNGTZhqkcr/w66OC9pvmeys4YnQ==
version "1.0.0"
resolved "https://registry.yarnpkg.com/@bazel/hide-bazel-files/-/hide-bazel-files-1.0.0.tgz#779070dcb5ae121ff6c72d73bf3fb7bf68285d75"
integrity sha512-dfw2W7xDUPlRMcDMVO8gDkX9Xb7Thy3sP4PDODv+eiHOvwIi116X/wwy7mQUZISkJdEJ1zWy9ydpzvfetpYh4w==

"@bazel/ibazel@^0.11.1":
version "0.11.1"
Expand Down

0 comments on commit d6828b3

Please sign in to comment.