Skip to content

Commit 7043cde

Browse files
committed
fixed copy-local, fixed creating workdir
1 parent 87a3a9d commit 7043cde

File tree

6 files changed

+13
-5
lines changed

6 files changed

+13
-5
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.12)
22
project(dockerpack
3-
VERSION 0.1.1
3+
VERSION 0.1.2
44
DESCRIPTION "DockerPack is a small simple docker-based local stateful CI to test and deploy projects that should be built on multiple environments."
55
LANGUAGES CXX
66
)

RELEASE_NOTES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release notes
22

3+
## 0.1.2
4+
* Fixed creating working directory
5+
* Fixed --copy-local
6+
37
## 0.1.1
48
* Automatically create workdir if not exists
59
* Added `--copy-local` argument. This function skips `checkout` command and copy all from current directory to working directory

dockerpack.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
debug: true
12
commands_verbose: true
23
checkout: git clone --recursive https://github.com/edwardstock/dockerpack.git .
34

45
commands:
56
make_project:
67
steps:
78
- bash cfg/package_make.sh -t package
8-
- bash _build/package_upload.sh -t bintray
9+
- bash _build/package_upload.sh -t bintray --dry-run
910

1011
multijob:
1112
images:

src/config.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void dockerpack::config::parse(bool copy_local) {
6363
}
6464
}
6565
if (copy_local) {
66-
copy_paths.push_back(m_cwd + " " + workdir);
66+
copy_paths.push_back(m_cwd + "/. " + workdir);
6767
}
6868

6969
if (config["include"]) {

src/docker.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ void dockerpack::docker::ensure_workdir(const dockerpack::job_ptr_t& job, const
4545
}
4646
std::stringstream cmd_builder;
4747
cmd_builder << "docker exec ";
48-
cmd_builder << job->job_name() << " ";
4948

5049
if (!job->envs.empty()) {
5150
for (const auto& kv : job->envs) {
5251
cmd_builder << "-e " << kv.first << "=" << kv.second << " ";
5352
}
5453
}
5554

55+
cmd_builder << job->job_name() << " ";
5656
cmd_builder << "bash -c \"";
5757
cmd_builder << "mkdir -p " << workdir;
5858
cmd_builder << "\"";
@@ -64,6 +64,9 @@ void dockerpack::docker::ensure_workdir(const dockerpack::job_ptr_t& job, const
6464
dockerpack::execmd cmd(cmd_builder.str());
6565
int status = 0;
6666
const std::string result = cmd.run(&status);
67+
if (status) {
68+
throw std::runtime_error("unable to create " + workdir);
69+
}
6770
}
6871

6972
bool dockerpack::docker::check_docker_exists() {

version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.1
1+
0.1.2

0 commit comments

Comments
 (0)