Skip to content

Commit

Permalink
Added OBO sample
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurnford committed Feb 16, 2020
1 parent cc5f275 commit 88c77b4
Show file tree
Hide file tree
Showing 82 changed files with 25,078 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"lerna": "3.19.0",
"packages": [
"packages/*"
"packages/*",
"samples/07.advanced-web-chat-apps/e.soo-on-behalf-of-authentication/app"
],
"version": "0.0.0"
}
1 change: 1 addition & 0 deletions packages/component/src/hooks/useSetNotification.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import useWebChatUIContext from './internal/useWebChatUIContext';

export default function useSetNotification() {
console.log(useWebChatUIContext());
return useWebChatUIContext().setNotification;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/app/build
/app/node_modules
/bot/.env
/bot/node_modules
/rest-api/.env
/rest-api/node_modules
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This container is for simplifying CI when using Azure Pipelines

# The first builder image will build HTML and JavaScript code out of the create-react-app project
FROM node:12 AS builder-react
WORKDIR /var/build/react/

# Copy the web app code to /var/build/react/
# We excluded /.env and /node_modules/ via .dockerignore
ADD app/ /var/build/react/

# Doing a fresh "npm install" on build to make sure the image is reproducible
RUN npm ci

# Build the web app code via create-react-app and react-scripts
RUN npm run build

# The second builder image will aggregate all code into a single Docker image for export
FROM node:12

# Copy the bot code to /var/bot/
ADD bot/ /var/build/bot/

# Copy the web server code to /var/web/
ADD rest-api/ /var/build/web/

# Copy SSH configuration and startup script to /var/
# Adopted from https://github.com/Azure-App-Service/node/blob/master/10.14/sshd_config
ADD init.sh /var/build/
ADD sshd_config /var/build/

# Copy static React app to /var/web/public/, to be consumed by web server
COPY --from=builder-react /var/build/react/build/ /var/build/web/public/

# Doing a fresh "npm install" on build to make sure the image is reproducible
WORKDIR /var/build/bot/
RUN npm ci

# Doing a fresh "npm install" on build to make sure the image is reproducible
WORKDIR /var/build/web/
RUN npm ci

# Pack "concurrently" to make sure the image is reproducible
WORKDIR /var/build/
RUN npm install [email protected]

# Pack the build content as a "build.tgz" and export it out
RUN tar -cf build.tgz *
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This is the container for running the demo under Azure Web App
FROM node:12 AS builder-web

# Expose both port 80 and 2222 (SSH for Azure Web App)
EXPOSE 80 2222

WORKDIR /var/

# Extract build image to /var/
ADD build.tgz /var/

# Setup OpenSSH for debugging thru Azure Web App
# https://docs.microsoft.com/en-us/azure/app-service/containers/app-service-linux-ssh-support#ssh-support-with-custom-docker-images
# https://docs.microsoft.com/en-us/azure/app-service/containers/tutorial-custom-docker-image
ENV SSH_PASSWD "root:Docker!"
ENV SSH_PORT 2222
RUN \
apt-get update \
&& apt-get install -y --no-install-recommends dialog \
&& apt-get update \
&& apt-get install -y --no-install-recommends openssh-server \
&& echo "$SSH_PASSWD" | chpasswd \
&& mv /var/sshd_config /etc/ssh/ \
&& mv /var/init.sh /usr/local/bin/ \
&& chmod u+x /usr/local/bin/init.sh

# Set up entrypoint
ENTRYPOINT init.sh

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SKIP_PREFLIGHT_CHECK=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
Loading

0 comments on commit 88c77b4

Please sign in to comment.