Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix: use LF as line breaks for Docker entrypoint.sh (#2843)" #2865

Merged
merged 1 commit into from
May 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1 +1,33 @@
#!/bin/bashORIGINALDIR=/content/app# Use predefined DATADIR if it is defined[[ x"${DATADIR}" == "x" ]] && DATADIR=/content/data# Make persistent dir from original dirfunction mklink () { mkdir -p $DATADIR/$1 ln -s $DATADIR/$1 $ORIGINALDIR}# Copy old files from import dirfunction import () { (test -d /import/$1 && cd /import/$1 && cp -Rpn . $DATADIR/$1/)}cd $ORIGINALDIR# modelsmklink models# Copy original files(cd $ORIGINALDIR/models.org && cp -Rpn . $ORIGINALDIR/models/)# Import old filesimport models# outputsmklink outputs# Import old filesimport outputs# Start applicationpython launch.py $*
#!/bin/bash

ORIGINALDIR=/content/app
# Use predefined DATADIR if it is defined
[[ x"${DATADIR}" == "x" ]] && DATADIR=/content/data

# Make persistent dir from original dir
function mklink () {
mkdir -p $DATADIR/$1
ln -s $DATADIR/$1 $ORIGINALDIR
}

# Copy old files from import dir
function import () {
(test -d /import/$1 && cd /import/$1 && cp -Rpn . $DATADIR/$1/)
}

cd $ORIGINALDIR

# models
mklink models
# Copy original files
(cd $ORIGINALDIR/models.org && cp -Rpn . $ORIGINALDIR/models/)
# Import old files
import models

# outputs
mklink outputs
# Import old files
import outputs

# Start application
python launch.py $*