Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
React
react-workshop
Commits
c24d5f85
Commit
c24d5f85
authored
Jan 30, 2018
by
jnsone11
Browse files
add api
parent
2102975d
Changes
21
Expand all
Hide whitespace changes
Inline
Side-by-side
.vscode/database.json
0 → 100644
View file @
c24d5f85
{}
\ No newline at end of file
content-repository/api/Dockerfile
0 → 100644
View file @
c24d5f85
FROM
node:alpine
ARG
NODE_ENV=production
WORKDIR
/app
COPY
package.json .
RUN
npm
install
CMD
[ "npm" , "start" ]
\ No newline at end of file
content-repository/api/chart/.helmignore
0 → 100644
View file @
c24d5f85
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
content-repository/api/chart/Chart.yaml
0 → 100644
View file @
c24d5f85
apiVersion
:
v1
description
:
Graphql Api
name
:
graphqlapi
version
:
0.1.0
content-repository/api/chart/templates/_helpers.tpl
0 → 100644
View file @
c24d5f85
{{
/*
vim
:
set
filetype
=
mustache
:
*/
}}
{
{
/*
Expand
the
name
of
the
chart
.
*/
}
}
{{- define "name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{
{
/*
Create
a
default
fully
qualified
app
name
.
We
truncate
at
63
chars
because
some
Kubernetes
name
fields
are
limited
to
this
(
by
the
DNS
naming
spec
).
*/
}
}
{{- define "fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
content-repository/chart/templates/deployment.yaml
→
content-repository/
api/
chart/templates/deployment.yaml
View file @
c24d5f85
apiVersion
:
extensions/v1beta1
kind
:
Deployment
metadata
:
name
:
{{
template "
chart.
fullname" .
}}
name
:
{{
template "fullname" .
}}
labels
:
app
:
{{
template "
chart.
name" .
}}
app
:
{{
template "name" .
}}
chart
:
{{
.Chart.Name
}}
-{{ .Chart.Version | replace "+" "_" }}
release
:
{{
.Release.Name
}}
heritage
:
{{
.Release.Service
}}
...
...
@@ -12,7 +12,7 @@ spec:
template
:
metadata
:
labels
:
app
:
{{
template "
chart.
name" .
}}
app
:
{{
template "name" .
}}
release
:
{{
.Release.Name
}}
spec
:
containers
:
...
...
content-repository/api/chart/templates/service.yaml
0 → 100644
View file @
c24d5f85
apiVersion
:
v1
kind
:
Service
metadata
:
name
:
{{
template "fullname" .
}}
labels
:
app
:
{{
template "name" .
}}
chart
:
{{
.Chart.Name
}}
-{{ .Chart.Version | replace "+" "_" }}
release
:
{{
.Release.Name
}}
heritage
:
{{
.Release.Service
}}
spec
:
type
:
{{
.Values.service.type
}}
ports
:
-
port
:
{{
.Values.service.externalPort
}}
targetPort
:
{{
.Values.service.internalPort
}}
protocol
:
TCP
name
:
http
selector
:
app
:
{{
template "name" .
}}
release
:
{{
.Release.Name
}}
content-repository/api/chart/values.yaml
0 → 100644
View file @
c24d5f85
# Default values for chart.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount
:
1
image
:
repository
:
workshop/graphqlapi
tag
:
latest
pullPolicy
:
IfNotPresent
service
:
name
:
graphqlapi
type
:
ClusterIP
externalPort
:
5000
internalPort
:
5000
content-repository/api/package-lock.json
0 → 100644
View file @
c24d5f85
This diff is collapsed.
Click to expand it.
content-repository/api/package.json
View file @
c24d5f85
...
...
@@ -4,11 +4,14 @@
"description"
:
""
,
"main"
:
"index.js"
,
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
,
"build"
:
"docker build -t workshop/graphqlapi ."
,
"showImages"
:
"docker images"
,
"start"
:
"node_modules/.bin/postgraphile -c postgresql://postgres@backend-database-postgresql/postgres -s workshop -w"
},
"author"
:
"Jens Neuse <jens.neuse@gmx.de>"
,
"license"
:
"ISC"
,
"de
vDe
pendencies"
:
{
"dependencies"
:
{
"postgraphile"
:
"^4.0.0-alpha2.28"
}
}
\ No newline at end of file
}
content-repository/chart/.helmignore
→
content-repository/
backend-database/
chart/.helmignore
View file @
c24d5f85
File moved
content-repository/chart/Chart.yaml
→
content-repository/
backend-database/
chart/Chart.yaml
View file @
c24d5f85
File moved
content-repository/chart/templates/NOTES.txt
→
content-repository/
backend-database/
chart/templates/NOTES.txt
View file @
c24d5f85
File moved
content-repository/chart/templates/_helpers.tpl
→
content-repository/
backend-database/
chart/templates/_helpers.tpl
View file @
c24d5f85
File moved
content-repository/backend-database/chart/templates/configmap.yaml
0 → 100644
View file @
c24d5f85
apiVersion
:
v1
kind
:
ConfigMap
metadata
:
name
:
{{
.Release.Name
}}
-configmap
data
:
v1.sql
:
|-
{{
.Files.Get "v1.sql" | indent 4
}}
\ No newline at end of file
content-repository/backend-database/chart/templates/deployment.yaml
0 → 100644
View file @
c24d5f85
apiVersion
:
extensions/v1beta1
kind
:
Deployment
metadata
:
name
:
{{
template "chart.fullname" .
}}
labels
:
app
:
{{
template "chart.name" .
}}
chart
:
{{
.Chart.Name
}}
-{{ .Chart.Version | replace "+" "_" }}
release
:
{{
.Release.Name
}}
heritage
:
{{
.Release.Service
}}
spec
:
replicas
:
{{
.Values.replicaCount
}}
template
:
metadata
:
labels
:
app
:
{{
template "chart.name" .
}}
release
:
{{
.Release.Name
}}
spec
:
containers
:
-
name
:
{{
.Chart.Name
}}
image
:
"
{{
.Values.image.repository
}}:{{
.Values.image.tag
}}"
imagePullPolicy
:
{{
.Values.image.pullPolicy
}}
ports
:
-
containerPort
:
{{
.Values.service.internalPort
}}
volumeMounts
:
-
name
:
sql
mountPath
:
/docker-entrypoint-initdb.d
volumes
:
-
name
:
sql
configMap
:
name
:
{{
.Release.Name
}}
-configmap
content-repository/chart/templates/service.yaml
→
content-repository/
backend-database/
chart/templates/service.yaml
View file @
c24d5f85
File moved
content-repository/backend-database/chart/v1.sql
0 → 100644
View file @
c24d5f85
create
schema
if
not
EXISTS
workshop
;
CREATE
EXTENSION
IF
NOT
EXISTS
"uuid-ossp"
;
CREATE
EXTENSION
IF
NOT
EXISTS
"pgcrypto"
;
create
table
if
not
EXISTS
workshop
.
author
(
id
UUID
default
uuid_generate_v1mc
(),
name
text
NOT
NULL
,
PRIMARY
KEY
(
id
)
);
create
table
if
NOT
EXISTS
workshop
.
article
(
id
UUID
default
uuid_generate_v1mc
(),
title
text
default
null
,
description
text
default
null
,
content
JSONB
default
null
,
author_id
UUID
not
null
REFERENCES
workshop
.
author
(
id
),
PRIMARY
KEY
(
id
)
);
insert
into
workshop
.
author
(
name
)
VALUES
(
'Jens'
);
insert
into
workshop
.
article
(
title
,
description
,
content
,
author_id
)
VALUES
(
'My First Article'
,
'This article is awesome!'
,
'{"bigButton":"on my desk"}'
,
(
select
id
from
workshop
.
author
where
name
=
'Jens'
)
);
insert
into
workshop
.
article
(
title
,
description
,
content
,
author_id
)
VALUES
(
'My Second Article'
,
'This article is awesome too! amazing!!'
,
'{"thisButton":"even Bigger!"}'
,
(
select
id
from
workshop
.
author
where
name
=
'Jens'
)
);
\ No newline at end of file
content-repository/chart/values.yaml
→
content-repository/
backend-database/
chart/values.yaml
View file @
c24d5f85
...
...
@@ -7,7 +7,7 @@ image:
tag
:
9.6
pullPolicy
:
IfNotPresent
service
:
name
:
backend-d
b
name
:
backend-d
atabase
type
:
ClusterIP
externalPort
:
5432
internalPort
:
5432
internalPort
:
5432
\ No newline at end of file
front-end/renderine/package.json
0 → 100644
View file @
c24d5f85
{
"name"
:
"renderine"
,
"version"
:
"1.0.0"
,
"description"
:
""
,
"main"
:
"index.js"
,
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
},
"author"
:
""
,
"license"
:
"ISC"
}
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment