Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,15 @@ bind(
actual = "@gflags_git//:gflags",
)

git_repository(
name = "tools",
commit = "3327bae27498025ef8d33709f37182ae407fc517",
remote = "https://github.com/cloudendpoints/endpoints-tools",
)

#
# Python rules
#

git_repository(
name = "io_bazel_rules_pex",
commit = "d4af3ca0a015e8b2d2a81a4df1df51bb0fa0bba0",
Expand Down
109 changes: 51 additions & 58 deletions src/nginx/main/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
#
###############################################################################
#

load("@io_bazel_rules_pex//pex:pex_rules.bzl", "pex_binary")

cc_binary(
name = "nginx-google",
srcs = [
Expand Down Expand Up @@ -191,13 +194,9 @@ genrule(
)

pkg_tar(
name = "esp-bin",
name = "nginx-bin",
files = [
":debug_nginx.sh",
":fetch_service_config.sh",
":nginx",
":nginx-debug",
":start_esp",
],
mode = "0755",
package_dir = "/usr/sbin",
Expand All @@ -214,36 +213,6 @@ pkg_tar(
strip_prefix = ".",
)

pkg_tar(
name = "nginx-initd-override",
files = [
"nginx-init.d/nginx",
],
mode = "0755",
package_dir = "/etc/init.d",
)

pkg_tar(
name = "nginx-conf-template",
files = [
"//src/nginx/main:nginx-auto.conf.template",
"//src/nginx/main:server_config.pb.txt",
],
mode = "0644",
package_dir = "/etc/nginx",
strip_prefix = ".",
)

pkg_tar(
name = "trusted-ca-certificates",
files = [
"//src/nginx/main:trusted-ca-certificates.crt",
],
mode = "0644",
package_dir = "/etc/nginx",
strip_prefix = ".",
)

pkg_tar(
name = "esp-data",
extension = "tar.gz",
Expand All @@ -252,13 +221,56 @@ pkg_tar(
# The first occurrence of the duplicate file will be picked. In other
# words, /etc/nginx/nginx.conf from ":nginx-conf-override" will
# override that from "@nginx_pkgoss//:debian_overlay".
":nginx-conf-template",
":nginx-initd-override",
":start_esp_tar",
"@tools//start_esp:nginx-conf-template",
"@tools//start_esp:nginx-initd-override",
"@nginx_pkgoss//:debian_overlay",
":esp-bin",
"@tools//start_esp:esp-bin",
":nginx-bin",
":esp-copyright",
":trusted-ca-certificates",
"@tools//start_esp:trusted-ca-certificates",
],
)

# Due to an issue with external repository and PEX rules, we need to move these files here

genrule(
name = "import_start_esp",
srcs = ["@tools//start_esp:start_esp.py"],
outs = ["start_esp.py"],
cmd = "cat $(location @tools//start_esp:start_esp.py) > $@",
)

genrule(
name = "import_fetch_service_config",
srcs = ["@tools//start_esp:fetch_service_config.py"],
outs = ["fetch_service_config.py"],
cmd = "cat $(location @tools//start_esp:fetch_service_config.py) > $@",
)

pex_binary(
name = "start_esp",
srcs = [
":fetch_service_config.py",
":start_esp.py",
],
main = ":start_esp.py",
reqs = [
"certifi",
"mako>=1.0.4",
"oauth2client>=3.0.0",
"pyasn1>=0.1.9",
"pyasn1-modules>=0.0.8",
"urllib3>=1.16",
],
)

pkg_tar(
name = "start_esp_tar",
files = [":start_esp"],
mode = "0755",
package_dir = "/usr/sbin",
strip_prefix = ".",
)

pkg_deb(
Expand Down Expand Up @@ -301,22 +313,3 @@ sh_test(
":endpoints-server-proxy.deb",
],
)

load("@io_bazel_rules_pex//pex:pex_rules.bzl", "pex_binary")

pex_binary(
name = "start_esp",
srcs = [
"fetch_service_config.py",
"start_esp.py",
],
main = "start_esp.py",
reqs = [
"certifi",
"mako>=1.0.4",
"oauth2client>=3.0.0",
"pyasn1>=0.1.9",
"pyasn1-modules>=0.0.8",
"urllib3>=1.16",
],
)
78 changes: 0 additions & 78 deletions src/nginx/main/debug_nginx.sh

This file was deleted.

Loading