Skip to content

Commit

Permalink
renamved launch/ -> launchers/; removed static avahi services; simpli…
Browse files Browse the repository at this point in the history
…fied /environment.sh;
  • Loading branch information
afdaniele committed Jun 11, 2020
1 parent 98474a4 commit 5e124f9
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
!packages
!dependencies-apt.txt
!dependencies-py3.txt
!launch
!launchers

# YOUR FILES LISTED BELOW THIS LINE (IMPORTANT: PREPEND !)
# ----------------------------------------------------------------------------
7 changes: 2 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,9 @@ RUN pip3 install -r ${REPO_PATH}/dependencies-py3.txt
# copy the source code
COPY ./packages/. "${REPO_PATH}/"

# copy avahi services
COPY ./assets/avahi-services/. /avahi-services/

# install launcher scripts
COPY ./launch/* "${LAUNCH_PATH}/"
COPY ./launch/default.sh "${LAUNCH_PATH}/"
COPY ./launchers/* "${LAUNCH_PATH}/"
COPY ./launchers/default.sh "${LAUNCH_PATH}/"
RUN /utils/install_launchers "${LAUNCH_PATH}"

# store module name
Expand Down
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,21 @@ List the dependencies in the files `dependencies-apt.txt` and
Place your code in the directory `/code` of
your new repository.

**NOTE:** Do not use absolute paths in your code, the code you place under `/code` will be copied to a different location later.
**NOTE:** Do not use absolute paths in your code, the code you place
under `/code` will be copied to a different location later. Use the
variable `CODE_DIR` instead.


### 5. Setup the launchfile

Change the file `launch.sh` in your repository to
launch your code. Use the provided variable `CODE_DIR`
to identify the place where your code will be placed.
### 5. Setup launchers

The directory `/launchers` can contain as many launchers (launching scripts)
as you want. A default launcher called `default.sh` must always be present.

If you create an executable script (i.e., a file with a valid shebang statement)
a launcher will be created for it. For example, the script file
`/launchers/my-launcher.sh` will be available inside the Docker image as the binary
`dt-launcher-my-launcher`.

When launching a new container, you can simply provide `dt-launcher-my-launcher` as
command.
1 change: 1 addition & 0 deletions assets/STORE_MODULE_ASSETS_HERE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INTENTIONALLY LEFT BLANK
1 change: 0 additions & 1 deletion assets/avahi-services/PLACE_YOUR_AVAHI_SERVICES_HERE

This file was deleted.

8 changes: 4 additions & 4 deletions launch/default.sh → launchers/default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source /environment.sh

# initialize launch file
dt_launchfile_init
dt-launchfile-init

# YOUR CODE BELOW THIS LINE
# ----------------------------------------------------------------------------
Expand All @@ -13,11 +13,11 @@ dt_launchfile_init
# NOTE: Use `dt_exec COMMAND` to run the main process (blocking process)

# launching app
dt_exec echo "This is an empty launch script. Update it to launch your application."
dt-exec echo "This is an empty launch script. Update it to launch your application."


# ----------------------------------------------------------------------------
# YOUR CODE ABOVE THIS LINE

# terminate launch file
dt_launchfile_terminate
# wait for app to end
dt-launchfile-join

0 comments on commit 5e124f9

Please sign in to comment.