Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
interkit
interkit-experiments
Commits
6b44e835
Commit
6b44e835
authored
3 years ago
by
Holger Heißmeyer
Browse files
Options
Download
Email Patches
Plain Diff
bundler: generate interkit.config.json for new project
parent
e8e6e8d2
v04
138-styling
150-compatibility
153-desktop-fallback
393-chat-scroll-indicator
appvar
auth
defaultthemes
docs-package-lock-test
golden
main
md_images
safe-area-bottom
saveElementProperties
sebquack-v03-patch-83517
template-autobuild
template-autobuild-merge
tests
theming
unseen-publication
update-sml-theme
update-sml-theme-2
v02
v02-nodeeditor
v03
v03-270-unique-pushnotificationregistrationtoken
v03-295-i18n
v03-bundler-vite
v03-carbonupdate
v03-msgmgmt
v03-nodeeditor
v03-pushnotifications
v03-reredaktionssys
v03-reredaktionssys-heavyrefactor
v03-userauth-perstistent-storage
v04-blockly10
v04-bundler-vite
v04-capacitor5
v04-git-server-push
v04-pwahint-496
v04-sites-refactor
No related merge requests found
Pipeline
#77
passed with stages
in 9 minutes and 20 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app-bundler/.env.example
+1
-0
app-bundler/.env.example
app-bundler/src/filesystem.mjs
+48
-1
app-bundler/src/filesystem.mjs
docker-compose.yml
+1
-0
docker-compose.yml
with
50 additions
and
1 deletion
+50
-1
app-bundler/.env.example
+
1
-
0
View file @
6b44e835
PORT=4000
REPOSITORIES_PATH=
ADMIN_PASSWORD=password
INTERKIT_BUNDLER_URL=http://localhost:4000
INTERKIT_SERVER_URL=http://localhost:3000
INTERKIT_SERVER_WEBSOCKETS_URL=ws://localhost:3000/websocket
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app-bundler/src/filesystem.mjs
+
48
-
1
View file @
6b44e835
...
...
@@ -4,6 +4,9 @@ import fse from 'fs-extra'
import
git
from
'
isomorphic-git
'
const
REPOSITORIES_PATH
=
process
.
env
.
REPOSITORIES_PATH
const
INTERKIT_BUNDLER_URL
=
process
.
env
.
INTERKIT_BUNDLER_URL
const
INTERKIT_SERVER_WEBSOCKETS_URL
=
process
.
env
.
INTERKIT_SERVER_WEBSOCKETS_URL
const
INTERKIT_SERVER_URL
=
process
.
env
.
INTERKIT_SERVER_URL
function
getProjectPath
(
projectId
)
{
const
projectPath
=
path
.
join
(
REPOSITORIES_PATH
,
"
projects
"
,
projectId
)
...
...
@@ -22,12 +25,25 @@ function ensureRepositories(projects) {
}
}
function
generateInterkitConfig
(
project
)
{
return
{
project_slug
:
project
.
slug
||
""
,
bundle_version
:
"
0.1
"
,
INTERKIT_BUNDLER_URL
,
INTERKIT_SERVER_WEBSOCKETS_URL
,
INTERKIT_SERVER_URL
,
}
}
async
function
setupNewRepository
(
project
)
{
const
projectId
=
project
.
id
console
.
log
(
"
setup new project
"
+
projectId
)
const
starterPath
=
process
.
env
.
REPOSITORIES_PATH
+
"
/starters/cs1
"
const
projectPath
=
getProjectPath
(
projectId
)
const
interkitConfigJson
=
JSON
.
stringify
(
generateInterkitConfig
(
project
))
console
.
log
(
`setup new project
${
projectId
}
in
${
projectPath
}
. \n
${
interkitConfigJson
}
`
)
// create new directory and initialize repo
try
{
...
...
@@ -35,6 +51,23 @@ async function setupNewRepository(project) {
await
fs
.
promises
.
mkdir
(
projectPath
);
await
git
.
init
({
fs
,
dir
:
projectPath
});
await
fse
.
copySync
(
starterPath
,
projectPath
)
await
fs
.
promises
.
writeFile
(
path
.
join
(
projectPath
,
"
interkit.config.json
"
),
interkitConfigJson
)
await
gitAddAll
(
projectPath
)
let
sha
=
await
git
.
commit
({
fs
,
dir
:
projectPath
,
author
:
{
name
:
'
Interkit System
'
,
email
:
'
info@interkit.app
'
,
},
message
:
'
Initial commit
'
})
console
.
log
(
`initial commit:
${
sha
}
`
)
}
else
{
console
.
log
(
"
Directory already exists.
"
);
...
...
@@ -44,6 +77,20 @@ async function setupNewRepository(project) {
}
}
async
function
gitAddAll
(
projectPath
)
{
const
repo
=
{
fs
,
dir
:
projectPath
}
await
git
.
statusMatrix
(
repo
).
then
((
status
)
=>
Promise
.
all
(
status
.
map
(([
filepath
,
,
worktreeStatus
])
=>
worktreeStatus
?
git
.
add
({
...
repo
,
filepath
})
:
git
.
remove
({
...
repo
,
filepath
})
)
)
)
}
export
{
ensureRepositories
,
getProjectPath
...
...
This diff is collapsed.
Click to expand it.
docker-compose.yml
+
1
-
0
View file @
6b44e835
...
...
@@ -94,6 +94,7 @@ services:
environment
:
PORT
:
4000
ADMIN_PASSWORD
:
${INTERKIT_ADMIN_PASSWORD}
INTERKIT_BUNDLER_URL
:
${INTERKIT_BUNDLER_URL:-http://localhost:4000}
INTERKIT_SERVER_WEBSOCKETS_URL
:
${INTERKIT_SERVER_WEBSOCKETS_URL:-ws://localhost:3000/websocket}
INTERKIT_SERVER_URL
:
${INTERKIT_SERVER_URL:-http://localhost:3000}
labels
:
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help