Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ get_os_name () {
elif cat /etc/*-release | grep '^ID="almalinux"' > /dev/null 2>&1; then
os="centos"
centos_flavor="almalinux"
elif cat /etc/*-release | grep '^ID="rocky"' > /dev/null 2>&1; then
os="centos"
centos_flavor="rocky"
else
os=`cat /etc/*-release | grep '^ID=' | \
sed 's/^ID=["]*\([a-zA-Z]*\).*$/\1/' | \
Expand Down Expand Up @@ -79,11 +82,11 @@ get_os_name () {
tr '[:upper:]' '[:lower:]'`
;;
centos)
codename=`cat /etc/*-release | grep -i 'almalinux\|centos.*(' | \
codename=`cat /etc/*-release | grep -i 'almalinux\|rocky\|centos.*(' | \
sed 's/.*(\(.*\)).*/\1/' | head -1 | \
tr '[:upper:]' '[:lower:]'`
# For CentOS grab release
release=`cat /etc/*-release | grep -i 'almalinux\|centos.*[0-9]' | \
release=`cat /etc/*-release | grep -i 'almalinux\|rocky\|centos.*[0-9]' | \
sed 's/^[^0-9]*\([0-9][0-9]*\).*$/\1/' | head -1`
;;
rhel|ol)
Expand Down
8 changes: 8 additions & 0 deletions tools/builders/deb.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,19 @@ def build(bumprevision=False):
changelog_first_line = 'nginx-amplify-agent (%s-%s~%s) %s; urgency=low' % (version, bld, codename, codename)
change_first_line('%s/debian/changelog' % debuild_root, changelog_first_line)

if bumprevision:
# sed version_build
shell_call('sed -i.bak -e "s,self.version_build =.*,self.version_build = %d," amplify/agent/common/context.py' % bld)

# create source tarball
shell_call('cp packages/nginx-amplify-agent/setup.py ./')
shell_call('tar -cz --transform "s,^,nginx-amplify-agent-%s/," -f %s/nginx-amplify-agent_%s.orig.tar.gz LICENSE MANIFEST.in amplify/agent amplify/ext amplify/__init__.py etc/ packages/ nginx-amplify-agent.py setup.py' % (version, pkg_root, version))
shell_call('cd %s && tar zxf nginx-amplify-agent_%s.orig.tar.gz' % (pkg_root, version))

if bumprevision:
# restore original version_build
shell_call('mv amplify/agent/common/context.py.bak amplify/agent/common/context.py')

# create deb package
shell_call('cd %s && debuild -us -uc' % debuild_root, terminal=True)

Expand Down
8 changes: 8 additions & 0 deletions tools/builders/rpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,19 @@ def build(bumprevision=False):
os.makedirs(rpm_specs)
os.makedirs(rpm_sources)

if bumprevision:
# sed version_build
shell_call('sed -i.bak -e "s,self.version_build =.*,self.version_build = %d," amplify/agent/common/context.py' % bld)

# prepare sources
shell_call('cp packages/nginx-amplify-agent/setup.py ./')
shell_call('tar -cz --transform "s,^,nginx-amplify-agent-%s/," -f %s/nginx-amplify-agent-%s.tar.gz LICENSE MANIFEST.in amplify/agent amplify/ext amplify/__init__.py etc/ packages/ nginx-amplify-agent.py setup.py' % (version, rpm_sources, version))
shell_call('cp packages/nginx-amplify-agent/rpm/nginx-amplify-agent.service %s' % rpm_sources)

if bumprevision:
# restore original version_build
shell_call('mv amplify/agent/common/context.py.bak amplify/agent/common/context.py')

# prepare spec
shell_call('cp packages/nginx-amplify-agent/rpm/nginx-amplify-agent.spec %s/' % rpm_specs)
shell_call('sed -e "s,%%%%AMPLIFY_AGENT_VERSION%%%%,%s,g" -e "s,%%%%AMPLIFY_AGENT_RELEASE%%%%,%s,g" -e "s,%%%%REQUIREMENTS%%%%,%s,g" -i %s/nginx-amplify-agent.spec' % (version, bld, get_requirements_for_distro(), rpm_specs))
Expand Down