-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
94 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# 1.1.0 (2024.04.05) | ||
|
||
* Add bash completion | ||
* Add installation script | ||
* Support for `docker compose` command | ||
* Terminate partially started containers if the entire workspace cannot be started | ||
|
||
# 1.0.0 (2024.04.04) | ||
|
||
* Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include "compose_executor.h" | ||
|
||
#include <format> | ||
|
||
using namespace std; | ||
|
||
ComposeExecutorImpl::ComposeExecutorImpl(ProcessExecutorPtr processExecutor) | ||
: processExecutor(processExecutor) | ||
{ | ||
if (processExecutor->exec("docker compose --help > /dev/null") == 0) | ||
composeCommand = "docker compose"; | ||
else | ||
composeCommand = "docker-compose"; | ||
} | ||
|
||
void ComposeExecutorImpl::up(const std::string& file, bool detach) | ||
{ | ||
std::string command = format("{} -f {} up", composeCommand, file); | ||
if (detach) | ||
command += " -d"; | ||
processExecutor->execOrThrow(command); | ||
} | ||
|
||
void ComposeExecutorImpl::down(const std::string& file, bool withVolumes) | ||
{ | ||
std::string command = format("{} -f {} down", composeCommand, file); | ||
if (withVolumes) | ||
command += " -v"; | ||
processExecutor->execOrThrow(command); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#pragma once | ||
|
||
#include "process_executor.h" | ||
|
||
class ComposeExecutor { | ||
public: | ||
virtual void up(const std::string& file, bool detach) = 0; | ||
virtual void down(const std::string& file, bool withVolumes) = 0; | ||
}; | ||
|
||
using ComposeExecutorPtr = std::shared_ptr<ComposeExecutor>; | ||
|
||
class ComposeExecutorImpl : public ComposeExecutor { | ||
public: | ||
ComposeExecutorImpl(ProcessExecutorPtr processExecutor); | ||
|
||
void up(const std::string& file, bool detach); | ||
void down(const std::string& file, bool withVolumes); | ||
|
||
private: | ||
ProcessExecutorPtr processExecutor; | ||
std::string composeCommand; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters