Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
build(barista): Change build target of barista to the server side ren…
Browse files Browse the repository at this point in the history
…dering.

Changes the default `build` target of the barista-design-system to the generating of the static pages to be part of the `nx affected:build` command that is running on the circle ci.
This should prevent us of merging code that is not compatible with the universal rendering.
  • Loading branch information
Lukas Holzer authored and lukasholzer committed Apr 2, 2020
1 parent acfecbc commit 72d9a35
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 36 deletions.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ jobs:
command: npx ngcc
- run:
name: Generate examples for the demo application
command: npm run examples-tools
command: |
npm run examples-tools
npm run barista-tools
- run: yarn nx affected:build ${AFFECTED_ARGS} --configuration=production --parallel --exclude=examples-tools
- persist_to_workspace:
root: ~/barista
Expand Down
26 changes: 8 additions & 18 deletions .github/workflows/barista-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,23 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
container: designops/workspace-base:latest
env:
CI: true
WORKSPACE_DIR: /dynatrace
steps:
- uses: actions/checkout@v2

- name: Cache node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Use node 12.x
uses: actions/setup-node@v1
with:
node-version: '12.x'

- name: Install dependencies
run: npm ci
- name: Link the node_modules and the builders in the current working directory
run : |
cp -R "$WORKSPACE_DIR/dist/tmp/workspace" "$WORKSPACE_DIR/node_modules/@dynatrace/workspace"
ln -s "$WORKSPACE_DIR/node_modules" "$PWD/node_modules"
- name: Build Barista Design System
run: |
npm run examples-tools
npm run barista-tools
npm run ng build workspace
npm run ng run barista-design-system:render:production
npm run ng run barista-design-system:build:production
- name: ZEIT Now Deployment
id: now-deployment
Expand Down
34 changes: 17 additions & 17 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,19 @@
"projectType": "application",
"architect": {
"build": {
"builder": "@dynatrace/workspace:build-barista",
"options": {
"devServerTarget": "barista-design-system:serve-ssr",
"outputPath": "dist/apps/barista-design-system/browser",
"routesFile": "dist/barista-data/routes.txt"
},
"configurations": {
"production": {
"devServerTarget": "barista-design-system:serve-ssr:production"
}
}
},
"build-frontend": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/apps/barista-design-system/browser",
Expand Down Expand Up @@ -539,23 +552,23 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "barista-design-system:build"
"browserTarget": "barista-design-system:build-frontend"
},
"configurations": {
"production": {
"browserTarget": "barista-design-system:build:production"
"browserTarget": "barista-design-system:build-frontend:production"
}
}
},
"serve-ssr": {
"builder": "@nguniversal/builders:ssr-dev-server",
"options": {
"browserTarget": "barista-design-system:build",
"browserTarget": "barista-design-system:build-frontend",
"serverTarget": "barista-design-system:build-server"
},
"configurations": {
"production": {
"browserTarget": "barista-design-system:build:production",
"browserTarget": "barista-design-system:build-frontend:production",
"serverTarget": "barista-design-system:build-server:production"
}
}
Expand Down Expand Up @@ -587,19 +600,6 @@
"setupFile": "apps/barista-design-system/src/test-setup.ts",
"passWithNoTests": true
}
},
"render": {
"builder": "@dynatrace/workspace:build-barista",
"options": {
"devServerTarget": "barista-design-system:serve-ssr",
"outputPath": "dist/apps/barista-design-system/browser",
"routesFile": "dist/barista-data/routes.txt"
},
"configurations": {
"production": {
"devServerTarget": "barista-design-system:serve-ssr:production"
}
}
}
}
},
Expand Down

0 comments on commit 72d9a35

Please sign in to comment.