Skip to content

Commit 0066f89

Browse files
committed
initial commit and working with nodeshift
1 parent 0d3752a commit 0066f89

23 files changed

+8738
-2
lines changed

.babelrc

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"presets": [
3+
["@babel/env", {
4+
"targets": {
5+
"browsers": [
6+
">0.25%",
7+
"not ie 11",
8+
"not op_mini all"
9+
]
10+
},
11+
"modules": false
12+
}]
13+
],
14+
}

.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# System and IDE files
2+
Thumbs.db
3+
.DS_Store
4+
.idea
5+
*.suo
6+
*.sublime-project
7+
*.sublime-workspace
8+
9+
# Vendors
10+
node_modules/
11+
12+
# Build
13+
dist/
14+
/npm-debug.log
15+
tmp/

README.md

100644100755
+37-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,37 @@
1-
# openshiftexamples-phaser-game
2-
:memo: Basic example of running a phaser app in OpenShift
1+
# OpenShift Example - Phaser Game
2+
3+
A Phaser 3 project with ES6 support via [Babel 7](https://babeljs.io/) and [Webpack 4](https://webpack.js.org/)
4+
that includes hot-reloading for development and production-ready builds primed for OpenShift.
5+
6+
## Available Commands
7+
8+
| Command | Description |
9+
|---------|-------------|
10+
| `npm install` | Install project dependencies |
11+
| `npm start` | Build project and open webserver for running project locally |
12+
| `npm run build` | Builds code as a bundle for production (minification, uglification, etc..) |
13+
14+
15+
## Running Locally
16+
Simple, that's just this:
17+
> `npm install; npm start`
18+
19+
**(edit files all you want and hotdeploy will watch/update for you)**
20+
21+
22+
## Deploying from Local Dir to OpenShift
23+
When you run the `npm run build` command, your code will be built into a single bundle located at `dist/bundle.min.js` along with any other assets you project depends upon.
24+
25+
Containerizing and pushing this app into your OpenShift cluster is easy with the help of [NodeShift](https://nodeshift.dev/). It will create the OpenShift configuration needed, do a build inside the cluster, then deploy the app, and expose a port into it. Just run this command
26+
>`npx nodeshift --web-app --build.env OUTPUT_DIR=dist --expose`
27+
28+
**(edit files and rerun `npx nodeshift` and it will update OpenShift for you)**
29+
30+
31+
## Deploying from GitHub to OpenShift
32+
This is also pretty easy with the help of Source 2 Image (aka s2i). Runt the following (after replacing the github URL with yours):
33+
>`oc new-app nodeshift/ubi8-s2i-web-app:latest~https://github.com/dudash/openshiftexamples-phaser-game`
34+
35+
36+
## Credit & Thanks
37+
Thanks to Richard Davey @ Phaser for the [tutorial here](http://phaser.io/tutorials/retro-highscore-table) that this was initially based upon.

icon.png

62.7 KB
Loading

index.html

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<style>
7+
* {
8+
margin: 0;
9+
padding: 0;
10+
}
11+
</style>
12+
</head>
13+
14+
<body>
15+
</body>
16+
17+
</html>

0 commit comments

Comments
 (0)