- def compress_artifact(self, path):
- """
- Compress a directory for building an artifact
- :param path: path of the directory
- :return: file path
- """
- if path[-1] == '/':
- path = path[:-1]
- file = path + '.tar.gz'
- with tarfile.open(file, "w:gz") as tar:
- tar.add(path)
-
- return file
-