diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2020-04-02 12:40:56 +0200 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2020-04-02 12:40:56 +0200 |
commit | c17ed429be9575a99d893a31cd7bf32dc428ede9 (patch) | |
tree | b6bcce05a2d34b6fe85961768c6597d27f0c3157 /ci/ciimage/build.py | |
parent | e6451c74729662c8bdefeb0f3fe4bd90e49f100f (diff) | |
download | meson-c17ed429be9575a99d893a31cd7bf32dc428ede9.zip meson-c17ed429be9575a99d893a31cd7bf32dc428ede9.tar.gz meson-c17ed429be9575a99d893a31cd7bf32dc428ede9.tar.bz2 |
ci: Retry if dub fetch failed
Diffstat (limited to 'ci/ciimage/build.py')
-rwxr-xr-x | ci/ciimage/build.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ci/ciimage/build.py b/ci/ciimage/build.py index bc4ec1c..5e25e36 100755 --- a/ci/ciimage/build.py +++ b/ci/ciimage/build.py @@ -33,6 +33,8 @@ class BuilderBase(): self.data_dir = data_dir self.temp_dir = temp_dir + self.common_sh = self.data_dir.parent / 'common.sh' + self.common_sh = self.common_sh.resolve(strict=True) self.validate_data_dir() self.image_def = ImageDef(self.data_dir) @@ -76,9 +78,10 @@ class Builder(BuilderBase): out_data = textwrap.dedent(f'''\ FROM {self.image_def.base_image} - ADD install.sh /usr/sbin/docker-do-install - ADD env_vars.sh /env_vars.sh - RUN docker-do-install + ADD install.sh /ci/install.sh + ADD common.sh /ci/common.sh + ADD env_vars.sh /ci/env_vars.sh + RUN /ci/install.sh ''') out_file.write_text(out_data) @@ -87,6 +90,7 @@ class Builder(BuilderBase): # copy files for i in self.data_dir.iterdir(): shutil.copy(str(i), str(self.temp_dir)) + shutil.copy(str(self.common_sh), str(self.temp_dir)) self.gen_bashrc() self.gen_dockerfile() @@ -149,7 +153,7 @@ class ImageTester(BuilderBase): test_cmd = [ self.docker, 'run', '--rm', '-t', 'meson_test_image', - '/usr/bin/bash', '-c', 'source /env_vars.sh; cd meson; ./run_tests.py' + '/usr/bin/bash', '-c', 'source /ci/env_vars.sh; cd meson; ./run_tests.py' ] if subprocess.run(test_cmd).returncode != 0: raise RuntimeError('Running tests failed') |