Skip to content

Commit 966ce92

Browse files
committed
Update build script
1 parent e81b4f8 commit 966ce92

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

build.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33
import subprocess
44
import time
5+
import stat
56
from datetime import datetime
67
import shutil
78
import glob
@@ -75,6 +76,9 @@ def create_package_fs():
7576

7677
binary = os.path.join(ROOT, 'amonagent')
7778

79+
st = os.stat(binary)
80+
os.chmod(binary, st.st_mode | stat.S_IEXEC)
81+
7882
shutil.copyfile(binary, os.path.join(build_directory, 'opt', 'amonagent', 'amonagent'))
7983
shutil.copyfile(binary, os.path.join(build_directory, 'usr', 'bin', 'amonagent'))
8084

@@ -216,7 +220,8 @@ def upload():
216220
]
217221

218222
command_string = " ".join(command)
219-
run(command_string, shell=True)
223+
print(command_string)
224+
# run(command_string, shell=True)
220225

221226
command = [
222227
"aws s3 sync",
@@ -227,7 +232,7 @@ def upload():
227232
]
228233

229234
command_string = " ".join(command)
230-
run(command_string, shell=True)
235+
# run(command_string, shell=True)
231236

232237
def cleanup():
233238
for file in glob.glob("*.rpm"):

packaging/postinst.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ chown -R -L amonagent:amonagent /var/run/amonagent
8181
chmod 775 /var/run/amonagent
8282

8383

84+
# Make sure the binary is executable
85+
chmod +x /usr/bin/amonagent
86+
chmod +x /opt/amonagent/amonagent
87+
88+
8489
# Distribution-specific logic
8590
if [[ -f /etc/redhat-release ]]; then
8691
# RHEL-variant logic

0 commit comments

Comments
 (0)