Skip to content

Commit

Permalink
fix: bundle inputs and outputs explicitly before deploy (#87)
Browse files Browse the repository at this point in the history
Former-commit-id: 4254c0d
Former-commit-id: ccc76f58d52f9961d9deb34e9ee53c50f2a0a9ad
  • Loading branch information
jpoehnelt authored Dec 9, 2019
1 parent 0618987 commit 7ec1132
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 8 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ cache:
- ".firebase"
- ".cache/bazel-disk-cache"
script:
- yarn run ci
- yarn run build
- yarn run test
before_deploy:
- yarn run deploy:extract
deploy:
- provider: script
skip_cleanup: true
script: yarn run deploy:ci
on:
branch: dev
- provider: pages
local_dir: dist/bin
local_dir: public
target_branch: master
skip_cleanup: true
github_token: "$GITHUB_TOKEN"
Expand Down
12 changes: 11 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ load("@npm//eslint:index.bzl", "eslint", "eslint_test")
load("@npm//license-check-and-add:index.bzl", "license_check_and_add_test")
load("@npm//http-server:index.bzl", "http_server")
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary", "nodejs_test")
load("@rules_pkg//:pkg.bzl", "pkg_deb", "pkg_tar")

exports_files(
[
Expand Down Expand Up @@ -66,7 +67,6 @@ genrule(
tools = ["@npm//nunjucks-cli/bin:nunjucks"],
)


eslint_test(
name = "eslint",
args = ["samples/**/*.js"],
Expand Down Expand Up @@ -97,3 +97,13 @@ license_check_and_add_test(
"//samples:inputs",
],
)

pkg_tar(
name = "public",
srcs = [
"//:index.html",
"//samples:inputs",
"//samples:outputs",
],
strip_prefix = ".",
)
12 changes: 11 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,14 @@ rules_sass_dependencies()
# Setup repositories which are needed for the Sass rules.
load("@io_bazel_rules_sass//:defs.bzl", "sass_repositories")

sass_repositories()
sass_repositories()

http_archive(
name = "rules_pkg",
sha256 = "4ba8f4ab0ff85f2484287ab06c0d871dcb31cc54d439457d28fd4ae14b18450a",
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz",
)

load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")

rules_pkg_dependencies()
2 changes: 1 addition & 1 deletion firebase.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"hosting": {
"public": "dist/bin",
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@
"ci": "yarn run build && yarn run test",
"defaults:data:merge": "lerna exec '../../build/merge_default_data.sh'",
"defaults:package:merge": "lerna exec '../../build/merge_default_package.sh'",
"deploy": "yarn run build && firebase deploy",
"deploy:ci": "yarn run build && firebase deploy --token $FIREBASE_TOKEN",
"deploy": "firebase deploy",
"deploy:ci": "firebase deploy --token $FIREBASE_TOKEN",
"deploy:extract": "mkdir -p public && rm -rf public/* && tar -xf dist/bin/public.tar -C public",
"format": "yarn run format:root && lerna run format",
"format:dist": "lerna run format:dist",
"format:root": "sort-package-json && prettier *.json *.js shared/**/*.scss --write --loglevel error",
"serve": "bazel run :serve",
"serve:firebase": "yarn run build && firebase serve",
"serve:firebase": "yarn run build && yarn run deploy:extract && firebase serve",
"test": "lerna run test && yarn run test:tags && bazel test //...",
"test:tags": "./build/test_tags.sh"
},
Expand Down

0 comments on commit 7ec1132

Please sign in to comment.