# How to build oss-web-ui?

**URL:** <https://discourse.sensu.io/t/how-to-build-oss-web-ui/2083>\
**Category:** Getting Started\
**Tags:** sensu-go\
**Created:** [October 9, 2020, 7:19am UTC](https://discourse.sensu.io/t/how-to-build-oss-web-ui/2083 "2020-10-09T07:19:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eshimizu](https://avatars.discourse-cdn.com/v4/letter/e/da6949/32.png) [@eshimizu](https://discourse.sensu.io/u/eshimizu)\
**Post date:** [October 9, 2020, 7:19am UTC](https://discourse.sensu.io/t/how-to-build-oss-web-ui/2083/1 "2020-10-09T07:19:34Z")

</div>

I’m trying to build oss-web-ui from source code.  
[Manual](https://github.com/sensu/web/blob/c0890b2dad7b2599bc656460edf89c2596d74fb4/INSTALL.md) said to use `git clone` to run process.  
I’ll use oss-web-ui at production network that cannot connect github.  
So I have to make any package that not depends on network limitation.  
Have you any idea to make that package?

---

<div class="post-metadata">

**Author:** ![majormoses](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/majormoses/32/62_2.png) [@majormoses](https://discourse.sensu.io/u/majormoses)\
**Post date:** [October 14, 2020, 4:07am UTC](https://discourse.sensu.io/t/how-to-build-oss-web-ui/2083/2 "2020-10-14T04:07:46Z")

</div>

Well you are going to need to download the package from somewhere on the internet or someone sneakernets it to you. Once you have downloaded and compiled it then you can push that executable to whatever artifact management solution exists in your air gapped environment. You then either build that into your images, configuration management, dockerfiles, etc to pull from that location.

---

<div class="post-metadata">

**Author:** ![anatolijd](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/anatolijd/32/507_2.png) [@anatolijd](https://discourse.sensu.io/u/anatolijd)\
**Post date:** [October 14, 2020, 8:25am UTC](https://discourse.sensu.io/t/how-to-build-oss-web-ui/2083/3 "2020-10-14T08:25:49Z")

</div>

That may not work out of the box.

When web app starts, it executes git commands to collect version info (git source url, branch, tag, commit, last log, etc), which means it requires .git/ directory in $CWD to exist.  
If any git command fails then app will not start:

```
root@24c6c7f88e78:/opt/sensu/web# NODE_ENV=production PORT=5000 yarn node scripts serve
yarn node v1.22.5
[HPM] Proxy created: /auth,/graphql,/api -> http://localhost:8080
clean-webpack-plugin: /opt/sensu/web/build/app has been removed.
listening on 5000
(node:170) DeprecationWarning: Tapable.apply is deprecated. Call apply on the plugin directly instead
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:170) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
<i> [webpack-dev-middleware] wait until bundle finished: /index.html
<e> [webpack-dev-middleware] Child "app": 
<e> ERROR in ./src/lib/buildInfo.macro.js
<e> Module build failed (from ./config/macroLoader.js):
<e> Error: ENOENT: no such file or directory, open '/opt/sensu/web/.git/HEAD'
<e> at Object.openSync (fs.js:474:3)
<e> at Object.readFileSync (fs.js:375:35)
<e> at branch (/opt/sensu/web/node_modules/git-rev-sync/index.js:81:17)
<e> at long (/opt/sensu/web/node_modules/git-rev-sync/index.js:92:11)
<e> at Object.short (/opt/sensu/web/node_modules/git-rev-sync/index.js:118:10)
<e> at Module.module.exports.1Icq. __webpack_exports__.default (/opt/sensu/web/src/lib/buildInfo.macro.js:98:34)
<e> at Object.default (/opt/sensu/web/config/macroLoader.js:9:27)
<e> @ ./src/lib/buildInfo.tsx 8:0-37 10:30-34
<e> @ ./src/lib/component/util/useBuildInfo.js
<e> @ ./src/lib/component/util/index.tsx
<e> @ ./src/app/index.js
<e> @ multi ./src/app
<i> [webpack-dev-middleware] Child "app": Failed to compile.

```

Therefore, make sure .git/ is always included when you package app (docker image, npm pkg, .deb).
