Skip to content

Commit

Permalink
build: add ability to configure runtime path (#1713)
Browse files Browse the repository at this point in the history
* allow runtime folder to be configurable

* remove dead server webpack config

* remove unused dev dependencies

* add simple e2e check for docker

* add sleep to wait for docker-compose to start up

* run docker build on all platforms

* add missing runs-on property

* do not run docker build on mac

apparently docker is not installed on the github mac agents /shrug

* only run on ubuntu-latest

it wasn't working with the windows vm either 😭
  • Loading branch information
a-b-r-o-w-n authored and boydc2014 committed Dec 9, 2019
1 parent cde21e2 commit 7677101
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 89 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,20 @@ jobs:

docker-build:
name: Docker Build
runs-on: ubuntu-latest
timeout-minutes: 20
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v1
- name: docker-compose build
run: docker-compose build
- name: Health check
run: |
docker-compose up -d
sleep 10
curl -Is http://localhost:3000 | grep -q "200 OK"
shell: bash
- name: Cleanup
if: always()
run: docker-compose down
3 changes: 0 additions & 3 deletions Composer/packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"lint:fix": "yarn lint --fix"
},
"author": "",
"license": "ISC",
"nodemonConfig": {
"exec": "cross-env TS_NODE_FILES=true node --inspect=9228 -r ts-node/register src/server.ts",
"watch": [
Expand All @@ -46,8 +45,6 @@
"@types/morgan": "^1.7.35",
"@types/node": "^11.9.6",
"@types/rimraf": "^2.0.2",
"clean-webpack-plugin": "^2.0.1",
"copy-webpack-plugin": "^5.0.2",
"mock-fs": "^4.10.1",
"nodemon": "^1.18.11",
"rimraf": "^2.6.3",
Expand Down
5 changes: 3 additions & 2 deletions Composer/packages/server/src/settings/env.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import path from 'path';
import { Path } from '../utility/path';

export const absHosted = process.env.COMPOSER_AUTH_PROVIDER === 'abs-h';
export const absHostRoot = process.env.WEBSITE_HOSTNAME
Expand All @@ -16,4 +16,5 @@ if (folder && folder.endsWith(':')) {
export const environment = process.env.NODE_ENV || 'development';
export const botsFolder = folder;
export const botEndpoint = process.env.BOT_ENDPOINT || 'http://localhost:3979';
export const appDataPath = process.env.COMPOSER_APP_DATA || path.resolve(__dirname, '../../data.json');
export const appDataPath = process.env.COMPOSER_APP_DATA || Path.resolve(__dirname, '../../data.json');
export const runtimeFolder = process.env.COMPOSER_RUNTIME_FOLDER || Path.resolve('../../../BotProject/Templates');
4 changes: 2 additions & 2 deletions Composer/packages/server/src/settings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import merge from 'lodash/merge';
import log from '../logger';
import { Path } from '../utility/path';

import { botsFolder, botEndpoint, appDataPath, environment } from './env';
import { botsFolder, botEndpoint, appDataPath, environment, runtimeFolder } from './env';

interface Settings {
botAdminEndpoint: string;
Expand All @@ -24,8 +24,8 @@ const envSettings: { [env: string]: Settings } = {
botAdminEndpoint: botEndpoint,
botEndpoint: 'http://localhost:3979', //botEndpoint,
assetsLibray: Path.resolve('./assets'),
runtimeFolder: Path.resolve('../../../BotProject/Templates'),
botsFolder: botsFolder || Path.join(os.homedir(), 'Documents', 'Composer'),
runtimeFolder,
appDataPath,
},
};
Expand Down
30 changes: 0 additions & 30 deletions Composer/packages/server/webpack.config.js

This file was deleted.

54 changes: 3 additions & 51 deletions Composer/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4683,7 +4683,7 @@ [email protected]:
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6"
integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==

cacache@^11.0.2, cacache@^11.3.1:
cacache@^11.0.2:
version "11.3.2"
resolved "https://registry.yarnpkg.com/cacache/-/cacache-11.3.2.tgz#2d81e308e3d258ca38125b676b98b2ac9ce69bfa"
integrity sha512-E0zP4EPGDOaT2chM08Als91eYnf8Z+eH1awwwVsngUmgppfM5jjJ8l3z5vO5p5w/I3LsiXawb1sW0VY65pQABg==
Expand Down Expand Up @@ -5102,13 +5102,6 @@ clean-stack@^2.0.0:
resolved "https://botbuilder.myget.org/F/botbuilder-declarative/npm/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b"
integrity sha1-7oRy27Ep5yezHooQpCfe6d/kAIs=

clean-webpack-plugin@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/clean-webpack-plugin/-/clean-webpack-plugin-2.0.1.tgz#2241526b0030aa0249e78714471298f867fc2829"
integrity sha512-vway5pXGVd91bicwjaf8j188Al6VMf9R9Ekl6q0qeiaWStRsOOXuh4qtjX1UrUvmz5XevQVCdjBuzr4Tzsnpog==
dependencies:
del "^4.0.0"

cli-boxes@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143"
Expand Down Expand Up @@ -5508,23 +5501,6 @@ copy-descriptor@^0.1.0:
resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=

copy-webpack-plugin@^5.0.2:
version "5.0.2"
resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-5.0.2.tgz#56186dfddbf9aa1b29c97fa4c796c1be98870da4"
integrity sha512-7nC7EynPrnBTtBwwbG1aTqrfNS1aTb9eEjSmQDqFtKAsJrR3uDb+pCDIFT2LzhW+SgGJxQcYzThrmXzzZ720uw==
dependencies:
cacache "^11.3.1"
find-cache-dir "^2.0.0"
glob-parent "^3.1.0"
globby "^7.1.1"
is-glob "^4.0.0"
loader-utils "^1.1.0"
minimatch "^3.0.4"
normalize-path "^3.0.0"
p-limit "^2.1.0"
serialize-javascript "^1.4.0"
webpack-log "^2.0.0"

copyfiles@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/copyfiles/-/copyfiles-2.1.0.tgz#0e2a4188162d6b2f3c5adfe34e9c0bd564d23164"
Expand Down Expand Up @@ -6760,18 +6736,6 @@ del@^3.0.0:
pify "^3.0.0"
rimraf "^2.2.8"

del@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/del/-/del-4.0.0.tgz#4fa27e92c366cb45b9bdaa56a9b8703dced17437"
integrity sha512-/BnSJ+SuZyLu7xMn48kZY0nMXDi+5KNmR4g8n21Wivsl8+B9njV6/5kcTNE9juSprp0zRWBU28JuHUq0FqK1Nw==
dependencies:
globby "^6.1.0"
is-path-cwd "^2.0.0"
is-path-in-cwd "^2.0.0"
p-map "^2.0.0"
pify "^4.0.1"
rimraf "^2.6.2"

del@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/del/-/del-4.1.1.tgz#9e8f117222ea44a31ff3a156c049b99052a9f0b4"
Expand Down Expand Up @@ -6873,7 +6837,7 @@ [email protected]:
arrify "^1.0.1"
path-type "^3.0.0"

dir-glob@^2.0.0, dir-glob@^2.2.1:
dir-glob@^2.2.1:
version "2.2.2"
resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.2.2.tgz#fa09f0694153c8918b18ba0deafae94769fc50c4"
integrity sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw==
Expand Down Expand Up @@ -8553,18 +8517,6 @@ globby@^6.1.0:
pify "^2.0.0"
pinkie-promise "^2.0.0"

globby@^7.1.1:
version "7.1.1"
resolved "https://registry.yarnpkg.com/globby/-/globby-7.1.1.tgz#fb2ccff9401f8600945dfada97440cca972b8680"
integrity sha1-+yzP+UAfhgCUXfral0QMypcrhoA=
dependencies:
array-union "^1.0.1"
dir-glob "^2.0.0"
glob "^7.1.2"
ignore "^3.3.5"
pify "^3.0.0"
slash "^1.0.0"

got@^6.7.1:
version "6.7.1"
resolved "https://registry.yarnpkg.com/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0"
Expand Down Expand Up @@ -12452,7 +12404,7 @@ p-limit@^1.1.0:
dependencies:
p-try "^1.0.0"

p-limit@^2.0.0, p-limit@^2.1.0:
p-limit@^2.0.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2"
integrity sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
- ./.appdata:/appdata
environment:
COMPOSER_BOTS_FOLDER: /Bots
COMPOSER_RUNTIME_FOLDER: /BotProject/Templates
COMPOSER_APP_DATA: /appdata/data.json
BOT_ENDPOINT: http://botruntime:80
PORT: 3000
Expand Down

0 comments on commit 7677101

Please sign in to comment.