Skip to content

Commit

Permalink
Split installation shell command into four
Browse files Browse the repository at this point in the history
With the aim of easing debugging, write one `run()` statement for the preinstall command, one to create the conda environment, another to install packages to the environment and one for the postinstall command.
  • Loading branch information
kysrpex committed Feb 6, 2025
1 parent 9a0a58b commit bd24d0c
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions lib/galaxy/tool_util/deps/mulled/invfile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,29 +72,20 @@ else
end

local preinstall = VAR.PREINSTALL
if preinstall ~= '' then
preinstall = preinstall .. ' && '
end

local postinstall = VAR.POSTINSTALL
if postinstall ~= '' then
postinstall = '&&' .. postinstall
end

inv.task('build')
.using(conda_image)
.withHostConfig({binds = {"build:/data"}})
.run('rm', '-rf', '/data/dist')
.using(conda_image)
.withHostConfig({binds = bind_args})
.run('/bin/sh', '-c', preinstall
.. conda_bin .. ' create --quiet --yes -p /usr/local/env --copy && '
.. conda_bin .. ' install '
.. channel_args .. ' '
.. target_args
.. ' --strict-channel-priority -p /usr/local/env --copy --yes '
.. verbose
.. postinstall)
.run('/bin/sh', '-c', preinstall)
.run('/bin/sh', '-c', conda_bin .. ' create --quiet --yes -p /usr/local/env --copy')
.run('/bin/sh', '-c', conda_bin .. ' install ' .. channel_args .. ' ' .. target_args
.. ' --strict-channel-priority -p /usr/local/env --copy --yes ' .. verbose)
.run('/bin/sh', '-c', postinstall)
.wrap('build/dist/env')
.at('/usr/local')
.inImage(destination_base_image)
Expand Down

0 comments on commit bd24d0c

Please sign in to comment.