1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

70 Commits

Author SHA1 Message Date
cladmi
3c0ecebb2c
makefiles/docker.inc.mk: use more directories in RIOT
Use the directories from in RIOT if possible for RIOTCPU/RIOTBOARD/RIOTMAKE.
2019-02-28 14:46:43 +01:00
Gaëtan Harter
8687d53c82
makefiles/docker.inc.mk: use BUILD_DIR in RIOT if possible
Use BUILD_DIR from within the riot repository if it is inside.
2019-02-28 14:46:43 +01:00
Gaëtan Harter
a57f141cf6
makefiles/docker.inc.mk: use RIOTPROJECT in the RIOT if possible
Use RIOTPROJECT from within the riot repository if it is inside.

This means when it is the case to use:

 * Not mounting the directory to `riotproject`
 * Use `APPDIR` relative to inside RIOT

If it is not inside, do the same as before:

 * Mount the RIOTPROJECT to `riotproject`
 * Use `APPDIR` relative to RIOTPROJECT
2019-02-28 14:46:43 +01:00
cladmi
e59b77988d
makefiles/docker.inc.mk: add docker_volume_and_env
Add functions to get volume and env arguments for a given directory environment
variable.

It handles:

 * variables with multiple directories like EXTERNAL_MODULE_DIRS
 * relative path
 * if the 'directories' variable is empty, it will not be exported to docker
2019-02-28 14:46:43 +01:00
cladmi
8351b13cc3
makefiles/docker.inc.mk: add path_in_docker function
Return to which directory in the container this directory should be mapped.
2019-02-28 14:46:43 +01:00
cladmi
a462c4aeb9
makefiles/docker.inc.mk: change definition order
Update definition order for DOCKER_VOLUMES_AND_ENV.

* Localtime
* Mapping and env related to `RIOTBASE`
* Build directories
* Project
* CPU/BOARD/make
2019-02-28 14:46:43 +01:00
cladmi
e5871d9deb
makefiles/docker.inc.mk: use a variable for all volumes and environment 2019-02-28 14:46:27 +01:00
cladmi
378f9fd144
makefiles/docker.inc.mk: add DOCKER_APPDIR variable
Prepare for when it can have a different value.
2019-02-28 14:44:53 +01:00
cladmi
a0f25ed47b
makefiles/docker.inc.mk: add DOCKER_RIOTBASE variable
It represents the path of RIOTBASE inside the docker container.
2019-02-28 14:44:49 +01:00
cladmi
ed1798634b makefiles/docker.inc.mk: handle 'build' directory
The 'build' directory should be created before starting docker.
If not it will be created as root.

Also add mapping for the directory in docker.

Currently create the directory in the target until there is a directory
creation target.
2019-01-07 21:16:36 +01:00
Juan I Carrano
d505b01d71
Merge pull request #10568 from smlng/pr/make/docker
makefiles/docker: fix mounting localtime on OSX
2018-12-07 15:52:17 +01:00
Sebastian Meiling
cae865e71e make/docker: adapt mount of localtime
Mounting `/etc/localtime` directly does not work on macOS (anymore).
However, by resolving the symlink to its real path docker can handle
the mount.
2018-12-07 14:00:19 +01:00
smlng
ae5608ab7f make: use abspath for worktree mount in docker 2018-12-05 20:28:12 +01:00
Gaëtan Harter
61a3e5d685
makefiles/docker.inc.mk: handle building in git worktree
When building from a worktree, the common git directory was not mounted
in docker.

This lead to the version not being set and issues with git-cache in
ubuntu bionic that could not execute the 'git hash-object' command.
2018-10-30 19:21:12 +01:00
Gaëtan Harter
c60324744c
docker: Use system GIT_CACHE_DIR if available
If GIT_CACHE_DIR is a directory make it available to docker.
This will allow using the system git_cache also in the docker container.
2018-10-23 15:01:43 +02:00
Gaëtan Harter
eab9757d62
makefiles/docker.inc.mk: export RIOT_CI_BUILD to docker
The variable was not given to docker before and as it is setting
'RIOT_VERSION_OVERRIDE=buildtest' it helps testing in docker more
consistently.
2018-09-06 16:52:43 +02:00
Gaëtan Harter
e5c49aa486
makefiles/docker.inc.mk: allow overwriting 'docker' command
Not all users register their user in the docker group and should not run the
whole make process as root to use docker.

They can now overwrite DOCKER with `DOCKER="sudo docker"`.

Creating files as a user is correctly handled as `id -u` is still run as the
original user.
2018-07-26 14:30:39 +02:00
61f1b941ce make: replace curly braces with parenthesis 2018-03-22 20:43:15 +01:00
fd1b0bdea5 makefiles: docker: make docker call non-interactive
prevents "the input device is not a TTY"
2017-11-13 12:34:51 +01:00
Joakim Nohlgård
339a4da9dc Makefiles: move to new directory /makefiles 2017-04-04 15:11:54 +02:00