from st2common.runners.base_action import Action from st2common.content import utils from st2common.constants.pack import MANIFEST_FILE_NAME from st2common.constants.pack import PACK_RESERVED_CHARACTERS from st2common.constants.pack import PACK_VERSION_SEPARATOR from st2common.constants.pack import PACK_VERSION_REGEX from st2common.services.packs import get_pack_from_index from st2common.util.pack import get_pack_metadata from st2common.util.pack import get_pack_ref_from_metadata from st2common.util.green import shell from st2common.util.versioning import complex_semver_match from st2common.util.versioning import get_stackstorm_version CONFIG_FILE = 'config.yaml' CURRENT_STACKSTROM_VERSION = get_stackstorm_version() class DownloadGitRepoAction(Action): def __init__(self, config=None, action_service=None): super(DownloadGitRepoAction, self).__init__(config=config, action_service=action_service) def run(self, packs, abs_repo_base, verifyssl=True, force=False): result = {} for pack in packs: pack_url, pack_version = self._get_repo_url(pack) temp_dir_name = hashlib.md5(pack_url).hexdigest() lock_file = LockFile('/tmp/%s' % (temp_dir_name))
from st2common.content import utils from st2common.constants.pack import MANIFEST_FILE_NAME from st2common.constants.pack import PACK_RESERVED_CHARACTERS from st2common.constants.pack import PACK_VERSION_SEPARATOR from st2common.constants.pack import PACK_VERSION_REGEX from st2common.services.packs import get_pack_from_index from st2common.util.pack import get_pack_metadata from st2common.util.pack import get_pack_ref_from_metadata from st2common.util.green import shell from st2common.util.versioning import complex_semver_match from st2common.util.versioning import get_stackstorm_version CONFIG_FILE = 'config.yaml' CURRENT_STACKSTROM_VERSION = get_stackstorm_version() class DownloadGitRepoAction(Action): def __init__(self, config=None, action_service=None): super(DownloadGitRepoAction, self).__init__(config=config, action_service=action_service) def run(self, packs, abs_repo_base, verifyssl=True, force=False): result = {} for pack in packs: pack_url, pack_version = self._get_repo_url(pack) temp_dir_name = hashlib.md5(pack_url).hexdigest() lock_file = LockFile('/tmp/%s' % (temp_dir_name)) lock_file_path = lock_file.lock_file