Valentin Lab
c447238e0d
fix: [compose] prevent session directory to disappear
2 years ago
Valentin Lab
3a001879fc
fix: [compose,compose-core] revert detection of used volume
This is not iso-functional and can't detect if a subvolume was mounted.
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
2 years ago
Valentin Lab
7a475500b2
fix: [compose] prevent stalling when ``docker inspect`` stalls on a container.
Improve ``is_volume_used`` implementation largely and doesn't require
``docker inspect`` call anymore.
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
2 years ago
Valentin Lab
80f471c241
fix: allow direct action to receive ``stdin``
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
3 years ago
Valentin Lab
7b2c1b73ac
new: [compose] provide ``$HOST_COMPOSE_YML_FILE`` location
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
4 years ago
Valentin Lab
34eb49ed51
chg: [compose] provide ``$HOST_COMPOSE_LAUNCHER_OPTS`` in environment
Indeed, without this, charms can't access the real content of the file.
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
4 years ago
Valentin Lab
a5af721887
fix: [compose] incorrect indentation in debug message !minor
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
7f82029aa6
new: [compose] use host's docker and ssh config on linux os
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
42afae776e
fix: some compose variables would incorrectly be shown as empty
These variable are valued after the displaying code.
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
3fd2443061
fix: dev: protect some local variables !minor
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
8c7cf28bf6
fix: ``compose`` command line arguments could be eaten
When rewriting arguments, any bash builtin's ``echo`` arguments
would be removed.
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
5081b59402
fix: support BSD also for standard macosx compatibility
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
4f88bcfec8
fix: compatibility with bash v5
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
be8da58c52
new: dev: show loaded config files !minor
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
64ffcf466b
new: add ``SHOW_ENV`` and ``SHOW_CONFIG_LOCATIONS``
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
621a93706b
chg: dev: clean color definition !minor
Removing obsolete/unused color variables
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
656069c59a
chg: remove requirement on ``sha256sum``
Also provide and use a ``hash_get`` function that will choose in the
available binary program. It supports ``sha512sum``, ``md5sum`` (GNU
version) and ``md5`` (BSD version).
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
59cb64ff92
fix: in WSL, make compose file accessible
We need to copy compose file in a docker host accessible
directory.
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
6c3ab38bb6
fix: dev: factorize some literals in a variable !minor
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
796e60af8c
fix: config files list is specific by os
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
cd7d069af9
fix: override for inner compose
We keep the bin override by sending it through the new session variables.
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
7c8b0d7ac4
chg: dev: store env vars in session file
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
1e4e1e047f
fix: remove docker and ssh auth config
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
31872d0562
fix: include WSL support
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
a907a61585
fix: dev: shellcheck good advices refactor !minor
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
bf3b3fa59f
chg: dev: avoid ``exit`` in favor of ``return``
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
44ac8bf62c
fix: prevent permission errors when compose is writing cache files
Separate ``compose`` and ``compose-core`` cache location as the first
needs possibly user permission while the latter will require root
permission.
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
a4c6e9e7cd
fix: dev: small improvements !minor
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
3ae01755f2
fix: management of ``compose.yml`` location
We need to parse the command line and modify it accordingly if option
``-f`` or ``--file`` is given.
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
813dd0c06b
new: enter fully setup compose image for debug
With ``ENTER=1``, one can enter the fully configured
container instead of launching compose.
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
5d0c90ff00
fix: remove error message about sessions that can't be deleted
Not a nice solution, but message are kept when using ``DEBUG``.
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
a968ccc3a9
chg: remove charm-store inner link support
Links were poorly supported and are a pain in the ass
due to docker volumes deferencing links in the container
side before making the bind mount, preventing overriding
links in the container file system.
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
33dcd642c5
new: dev: add and re-order function declaration
Add ``kal-shlib`` functions for next commits and
classify in 3 sections functions by source.
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
00b4206fc6
new: dev: debug messages on launcher
Using ``DEBUG=1`` on binary compose docker launcher prints
pretty-printed docker command launched as well as important
system variables.
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
e97351adb1
fix: non-root user could not launch compose
We want to propagate user's current ssh config, and have specially
crafted vars for each os/users.
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
4123198e70
new: timezone is fixed for containers
We prefer to create a file with the ``/etc/timezone`` information
in our own file directory to be shared read-only with containers.
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
87823ae45b
new: dev: make compose sourcable for eventual tests !minor
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
0c97d1f775
chg: dev: include color library and common element !minor
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
8dfe137964
new: add ssh to docker image to support git ``host-resources`` on ssh.
6 years ago
Valentin Lab
8c756c562e
new: pkg: avoid spurious warnings from ``docker-compose run`` calls.
This helps charm direct actions to keep a tidy standard output, and allows
them to be used in scripts.
``docker-compose`` was updated to the latest version available (aka
``1.24.0``) and was patched to include what might have been forgotten
when implementing the ``COMPOSE_IGNORE_ORPHANS`` environment variable.
On ``compose`` side, we need to make sure to pass environment variables
that are to be used by ``docker-compose``.
PR: https://github.com/docker/compose/pull/7020
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
5 years ago
Valentin Lab
04c6042b3a
new: macosx compatibility
5 years ago
Valentin Lab
c9f8f2b3e4
fix: keep ``COMPOSE_DOCKER_IMAGE`` in subcalls.
5 years ago
Valentin Lab
3ff8b02d40
fix: correctly set compose ``-i`` options only when needed
5 years ago
Valentin Lab
7b16c07c7f
fix: avoid leaking stopped containers
6 years ago
Valentin Lab
37d5c0a43d
new: ``compose`` is now to be used in a docker.
6 years ago
Valentin Lab
9f4cb01a36
chg: dev: minor comment addition, removal, and simplification. !minor
6 years ago
Valentin Lab
08f21ff10a
chg: dev: delete obsolete code !minor
6 years ago
Valentin Lab
9624f3b00f
fix: dev: should not need any direct connection from container to host
These variables should not be used.
6 years ago
Valentin Lab
654d6733ac
fix: dev: function should use ``return``, not ``exit``.
6 years ago
Valentin Lab
a03ae8ba51
new: bail out when failing to read compose file and be more explicit
6 years ago