Skip to content

Commit

Permalink
CI script changes to fail on diff (#2364)
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin authored Feb 19, 2023
1 parent c9f3f76 commit f69219f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ All matched files use Prettier code style!
To _fix_ formatting run:

```console
$ npm run check:formatting -- --write
$ npm run prettier:write
```

### Submodule changes
Expand Down
4 changes: 2 additions & 2 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[build]
publish = "public"
command = "npm run build:preview"
command = "npm run s build:preview diff:fail"

[context.production]
command = "npm run build:production"
command = "npm run s build:production diff:fail"

[[redirects]]
from = "https://docs.opentelemetry.io/*"
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,29 @@
"scripts": {
"__check:links": "make --keep-going check-links",
"_build": "hugo --cleanDestinationDir -e dev -DFE",
"_check:formatting": "npx prettier --check .",
"_check:links": "HTMLTEST_ARGS='--log-level 1' npm run __check:links",
"_check:links:internal": "npm run __check:links",
"_get:no": "echo SKIPPING get operation",
"_get:submodule:non-lang": "npm run _get:submodule -- content-modules/opentelemetry-specification themes/docsy",
"_get:submodule": "set -x && git submodule update --init ${DEPTH:- --depth 1}",
"_prebuild": "run-s get:submodule cp:spec",
"_prepare:docsy": "cd themes/docsy && npm install",
"_serve:hugo": "hugo serve --disableFastRender -DFE --minify",
"_serve:hugo": "hugo serve -DFE --minify",
"_serve": "netlify dev -c \"npm run _serve:hugo\"",
"all": "npm-run-all",
"build:preview": "set -x && npm run _build -- --minify --baseURL \"${DEPLOY_PRIME_URL:-/}\"",
"build:production": "hugo --cleanDestinationDir --minify",
"build": "npm run _build",
"cd:public": "cd public &&",
"check": "npm run all -- check:*",
"check:formatting": "npx prettier --check .",
"check:formatting": "npm run _check:formatting || (echo '[help] Run: npm run prettier:write'; exit 1)",
"check:links": "npm run _check:links",
"check:links:internal": "npm run _check:links:internal",
"clean": "make clean",
"cp:spec": "./scripts/content-modules/cp-pages.sh",
"diff:check": "git diff --name-only --exit-code || (echo; echo 'WARNING: the files above have not been committed'; echo)",
"diff:fail": "git diff --name-only --exit-code || (echo; echo 'ERROR: the files above have changed. Locally rerun `npm run test` and commit changes'; echo; exit 1)",
"get:submodule": "npm run _get:${GET:-submodule}",
"make:public": "make public ls-public",
"postbuild:preview": "npm run _check:links",
Expand All @@ -40,6 +43,7 @@
"prepare": "run-s get:submodule _prepare:docsy",
"preserve:hugo": "npm run _prebuild",
"prettier:no-ignore": "npx prettier --ignore-path ''",
"prettier:write": "npm run _check:formatting -- --write",
"preserve": "npm run _prebuild",
"s": "run-s",
"schemas:update": "npm run update:submodule content-modules/opentelemetry-specification",
Expand Down

0 comments on commit f69219f

Please sign in to comment.