Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix permissions #335

Merged
merged 5 commits into from
Oct 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions conda_smithy/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,25 @@ def init_git_repo(target):

def create_git_repo(target, msg):
init_git_repo(target)
subprocess.check_call(['git', 'add', '*'], cwd=target)
if sys.platform == "win32":
# prevent this:
# bash: line 1: ./ci_support/run_docker_build.sh: Permission denied
# ./ci_support/run_docker_build.sh returned exit code 126
subprocess.check_call(['git', 'update-index', '--chmod=+x', 'ci_support/run_docker_build.sh'], cwd=target)
subprocess.check_call(['git', 'add', '-A'], cwd=target)

# Ensure shell scripts have executable permissions.
executable_files = [
"ci_support/checkout_merge_commit.sh",
"ci_support/run_docker_build.sh",
]
for each_executable_file in executable_files:
if os.path.exists(os.path.join(target, each_executable_file)):
subprocess.check_call(
[
'git',
'update-index',
'--chmod=+x',
each_executable_file
],
cwd=target
)

subprocess.check_call(['git', 'commit', '-m', msg], cwd=target)


Expand Down
15 changes: 13 additions & 2 deletions conda_smithy/configure_feedstock.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,19 @@ def render_run_docker_build(jinja_env, forge_config, forge_dir):
target_fname = os.path.join(forge_dir, 'ci_support', 'run_docker_build.sh')
with open(target_fname, 'w') as fh:
fh.write(template.render(**forge_config))
st = os.stat(target_fname)
os.chmod(target_fname, st.st_mode | stat.S_IEXEC)

# Fix permissions.
target_fnames = [
os.path.join(forge_dir, 'ci_support', 'run_docker_build.sh'),
os.path.join(forge_dir, 'ci_support', 'checkout_merge_commit.sh'),
]
for each_target_fname in target_fnames:
if os.path.exists(each_target_fname):
st = os.stat(each_target_fname)
os.chmod(
each_target_fname,
st.st_mode | stat.S_IXOTH | stat.S_IXGRP | stat.S_IXUSR
)


def render_circle(jinja_env, forge_config, forge_dir):
Expand Down