Closed (fixed)
Project:
DrupalCI: Test Runner
Component:
DrupalCI console script
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 May 2015 at 18:05 UTC
Updated:
8 Sep 2015 at 17:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
gchaix commentedComment #2
gchaix commentedAn initial "drupalci clean" command. Adds a "--list" command to list all created containers. Currently does not discriminate what type of container or image to clean, it just shuts down and removes all created containers (but not images).
Comment #3
mradcliffeEdit: the basic run down of the plugin makes sense, but I think this could use some clean up.
if/else code blocks should be on a new line per coding standards.
Is this just to display the containers before deleting them. I think that may generate a lot of console output.
I wonder if a summary of the containers that were removed might be easier to read. Is it possible to get the output instead?
Also, I think that there is a Container command that may be better to use here instead of PHP exec() - docker-php
Maybe Docker\Manager\ContainerManager ?
Comment #4
gchaix commentedI'll clean up the if/else blocks. Silly oversight. I should know better.
The second point regarding getting the list of containers - the code quoted there isn't what generates the output. It's grabbing the list of containers to decide what docker commands to execute. The actual console output is later. I'll suppress it, as it's really only useful for debugging, and resubmit.
Comment #5
gchaix commentedCleaned up per coding standards, suppress debug output.
Comment #6
gchaix commentedBah, forgot to change to "needs review".
Comment #7
mradcliffeShoot. I didn't catch this before, but (#inheritdoc) -> {@inheritdoc} typo. :-)
Would an @todo referencing the comments above or a follow-up issue to clean up the clean task to use docker-php be relevant?
Maybe we just create a follow-up task if approved / RTBC. I probably won't be able to test this until the weekend.
Looks like this patch added some trailing whitespace.
In vim, though I guess you're probably using a GUI editor:
:%s/\s\+$//g. I use that snippet all of the time.Comment #8
gchaix commentedFixed #inheritdoc and trailing whitespace. Added TODO for replacing PHP exec() with docker-php.
Comment #9
gchaix commentedIs this still relevant? I was going to look at replacing the PHP exec() stuff with container commands, but won't bother if we're not going to use it.
Comment #10
hestenetComment #11
isntall commentedYes i think this is very relevant.
It is missing some checks to make sure that only drupalci containers are being cleaned.
Comment #13
isntall commentedThis command took a turn into the explicit.
The command is now
drupalci docker-rm <web|db|containers>Comment #15
MixologicLGTM
Comment #16
isntall commentedThese changes have been committed to the production branch and the dispatcher.dci.o jobs have been updated.
Comment #17
isntall commentedThe
drupalci docker-rm containerscommand runs at the start of every new job, removing all containers associated with drupalci.This gives a clean state to run the tests from and also gets around the issue where some jobs are still running even though jenkins thinks they are not.
drupalci docker-rm only stops and removes drupalci containers, it does not remove the data created by the web containers. though when a new database container is started, the database overwrites what was in the db directory.