Skip to content

Commit 682bada

Browse files
author
Tamás Hódi
committed
github
1 parent 13e465e commit 682bada

File tree

8 files changed

+65
-32
lines changed

8 files changed

+65
-32
lines changed

materials/gitProxy/src/package.json

Lines changed: 0 additions & 28 deletions
This file was deleted.

materials/github/deployment.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: apps/v1beta2 # for versions after 1.9.0 use apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: github
5+
labels:
6+
app: github
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: github
12+
template:
13+
metadata:
14+
labels:
15+
app: github
16+
spec:
17+
containers:
18+
- name: github
19+
image: k8s/github:v1
20+
ports:
21+
- containerPort: 5000

materials/github/service.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: github
5+
labels:
6+
run: github
7+
spec:
8+
ports:
9+
- port: 5000
10+
protocol: TCP
11+
selector:
12+
run: github
File renamed without changes.

materials/github/src/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM node:8.9.4-alpine
2+
3+
ENV PORT 5000
4+
5+
COPY package.json package.json
6+
RUN npm install
7+
8+
COPY . .
9+
10+
CMD ["node", "."]
11+
EXPOSE $PORT

materials/gitProxy/src/package-lock.json renamed to materials/github/src/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

materials/github/src/package.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "github",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "server.js",
6+
"scripts": {
7+
"start": "docker run -p 5000:5000 k8s/github:v1",
8+
"build": "docker build -t k8s/github:v1 ."
9+
},
10+
"author": "",
11+
"license": "ISC",
12+
"dependencies": {
13+
"express": "4.16.2",
14+
"request": "2.83.0",
15+
"request-promise-native": "1.0.5"
16+
}
17+
}

materials/gitProxy/src/server.js renamed to materials/github/src/server.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
const request = require('request-promise-native')
12
const express = require('express')
23
const app = express()
3-
const request = require('request-promise-native')
44

5-
const PORT = process.env.PORT || 8888
5+
const PORT = process.env.PORT
66

77
app.get('/healthz', (req, res) => res.sendStatus(200))
88
app.get('/api/v1', async (req, res) => {
@@ -19,4 +19,4 @@ app.get('/api/v1', async (req, res) => {
1919
res.send(items[0])
2020
})
2121

22-
const server = app.listen(PORT, () => console.log('Git proxy listening on port ' + PORT + '!'))
22+
app.listen(PORT, () => console.log(`Example app listening on port ${PORT}!`))

0 commit comments

Comments
 (0)