Skip to content

Commit

Permalink
Update build script
Browse files Browse the repository at this point in the history
  • Loading branch information
martinrusev committed Dec 5, 2017
1 parent e81b4f8 commit 966ce92
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 7 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import subprocess
import time
import stat
from datetime import datetime
import shutil
import glob
Expand Down Expand Up @@ -75,6 +76,9 @@ def create_package_fs():

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

st = os.stat(binary)
os.chmod(binary, st.st_mode | stat.S_IEXEC)

shutil.copyfile(binary, os.path.join(build_directory, 'opt', 'amonagent', 'amonagent'))
shutil.copyfile(binary, os.path.join(build_directory, 'usr', 'bin', 'amonagent'))

Expand Down Expand Up @@ -216,7 +220,8 @@ def upload():
]

command_string = " ".join(command)
run(command_string, shell=True)
print(command_string)
# run(command_string, shell=True)

command = [
"aws s3 sync",
Expand All @@ -227,7 +232,7 @@ def upload():
]

command_string = " ".join(command)
run(command_string, shell=True)
# run(command_string, shell=True)

def cleanup():
for file in glob.glob("*.rpm"):
Expand Down
5 changes: 5 additions & 0 deletions packaging/postinst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ chown -R -L amonagent:amonagent /var/run/amonagent
chmod 775 /var/run/amonagent


# Make sure the binary is executable
chmod +x /usr/bin/amonagent
chmod +x /opt/amonagent/amonagent


# Distribution-specific logic
if [[ -f /etc/redhat-release ]]; then
# RHEL-variant logic
Expand Down

0 comments on commit 966ce92

Please sign in to comment.