Skip to content
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
10 changes: 5 additions & 5 deletions .github/workflows/update-deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def parse_args():
"--root", default=".", help="specify build scripts root directory"
)
parser.add_argument(
"--jdk21",
"--jdk",
action="store_true",
help="update SDK 21 on build hosts (needed by Jenkins)",
)
Expand Down Expand Up @@ -270,10 +270,10 @@ def update_deps(root, bump, skip):
exit(1)


def update_jdk21(root):
def update_jdk(root):
base_url = "https://download.oracle.com/java/21/archive/"

filename = os.path.join(root, "ci/linux-install-jdk21.sh")
filename = os.path.join(root, "ci/linux-install-jdk.sh")
with open(filename, "r") as f:
content = f.read()

Expand Down Expand Up @@ -471,8 +471,8 @@ def main():
)

update_deps(args.root, args.bump, args.skip)
if args.jdk21:
update_jdk21(args.root)
if args.jdk:
update_jdk(args.root)
if args.rust:
update_rust(args.root)
if args.protobuf:
Expand Down
2 changes: 1 addition & 1 deletion ci/cfengine-build-host-setup.cf
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ bundle agent cfengine_build_host_setup
"sh $(this.promise_dirname)/linux-install-groovy.sh" contain => in_shell;

missing_java|insufficient_java_version::
"sh $(this.promise_dirname)/linux-install-jdk21.sh"
"sh $(this.promise_dirname)/linux-install-jdk.sh"
contain => in_shell,
classes => results("bundle", "java");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

if command -v composer >/dev/null; then
exit
fi
VERSION="${COMPOSER_VERSION:-2.9.5}"
INSTALL_DIR="${COMPOSER_INSTALL_DIR:-/usr/local/bin}"
PHP_PATH="${PHP_BIN:-php}"
Expand Down
6 changes: 6 additions & 0 deletions ci/linux-install-jdk21.sh → ci/linux-install-jdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ EOF
cd -
}

if command -v java; then
echo "java already installed, will skip install."
exit
fi

# TODO check version
if [ "$(whoami)" = "root" ]; then
install_jdk
else
Expand Down
29 changes: 29 additions & 0 deletions ci/linux-install-node.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash

node_version=20.10.0

npm install compare-versions

node -e "const cv = require('compare-versions'); process.exit(cv.compareVersions('$node_version', process.version));"
result=$?
echo "result: $result"
if [ "$result" != "1" ]; then
echo "node version is >= $node_version, no install will be performed."
exit
fi

cd /opt
sudo curl -k -O https://unofficial-builds.nodejs.org/download/release/v$node_version/node-v$node_version-linux-x64-glibc-217.tar.xz
echo "dcfc5dfcdea4d0883bb35a4f2e09bc4745b6e689d88f4ad09d9ccc252024049b node-v$node_version-linux-x64-glibc-217.tar.xz" | sudo tee node-v$node_version-linux-x64-glibc-217.tar.xz.sha256
sudo sha256sum --check node-v$node_version-linux-x64-glibc-217.tar.xz.sha256
sudo tar xf node-v$node_version-linux-x64-glibc-217.tar.xz
sudo tee /etc/profile.d/nodejs.sh << EOF
export NODE_HOME=/opt/node-v$node_version-linux-x64-glibc-217
export PATH=\$PATH:\$NODE_HOME/bin
EOF
sudo update-alternatives --install /usr/bin/node node /opt/node-v$node_version-linux-x64-glibc-217/bin/node 1
sudo update-alternatives --install /usr/bin/npm npm /opt/node-v$node_version-linux-x64-glibc-217/bin/npm 1
sudo update-alternatives --install /usr/bin/npx npx /opt/node-v$node_version-linux-x64-glibc-217/bin/npx 1
sudo update-alternatives --install /usr/bin/corepack corepack /opt/node-v$node_version-linux-x64-glibc-217/bin/corepack 1
cd /root

30 changes: 30 additions & 0 deletions ci/linux-install-php.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -e

php_version=8.3.20

if command -v php; then
if php -r "version_compare(PHP_VERSION, \""$php_version"\") >= 0 || exit(1);"; then
echo "host has php version >= $php_version. will skip install."
exit
fi
fi

# install PHP 8.3 from source
sudo apt-get -y install gcc g++ make pkg-config libxml2-dev libsqlite3-dev \
libcurl4-openssl-dev libpng-dev libonig-dev libldap2-dev libzip-dev \
zlib1g-dev libssl-dev

cd /tmp
wget https://www.php.net/distributions/php-$php_version.tar.gz
tar xzf php-$php_version.tar.gz
cd php-$php_version

# --enable-bcmath is needed by tecnickcom/tc-lib-barcode and tecnickcom/tc-lib-pdf
./configure --prefix=/usr/local --with-curl --enable-bcmath --enable-gd --enable-mbstring --with-ldap --with-openssl --with-zlib

make -j"$(nproc)"
sudo make install

php -v
# END of PHP installation
20 changes: 20 additions & 0 deletions ci/setup-bootstrap-host.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -e
thisdir="$(dirname "$0")"

# current standard of debian-9 for bootstrap requires using archive.debian.org
rm -f /etc/apt/sources.list.d/*; echo 'deb http://archive.debian.org/debian/ stretch main contrib non-free' >/etc/apt/sources.list

apt-get -qy update
apt-get -qy upgrade
apt-get -y install git autogen autoconf automake m4 make bison flex binutils libtool gcc g++ libc-dev \
liblmdb-dev libpam0g-dev python libssl-dev libpcre3-dev psmisc curl jq unzip \
pigz parallel libpcre2-dev php-zip

bash "$thisdir"/linux-install-php.sh

bash "$thisdir"/linux-install-node.sh

bash "$thisdir"/linux-install-composer.sh

bash "$thisdir"/linux-install-jdk.sh
6 changes: 6 additions & 0 deletions ci/setup-cfengine-build-host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ if grep -q 6.10 /etc/issue 2>/dev/null; then
urlget https://cfengine-package-repos.s3.amazonaws.com/enterprise/Enterprise-3.24.3/misc/cfengine-masterfiles-3.24.3-1.pkg.tar.gz
fi

# Here we start replacing the use of CFEngine policy with scripts. See ENT-14330
if [ -f /etc/cfengine-bootstrap-pr-host.flag ]; then
"$thisdir"/setup-bootstrap-host.sh
exit
fi

if grep -q ubuntu /etc/os-release; then
if grep -qi version=\"16 /etc/os-release; then
urlget https://cfengine-package-repos.s3.amazonaws.com/enterprise/Enterprise-3.21.8/agent/agent_ubuntu16_x86_64/cfengine-nova_3.21.8-1.ubuntu16_amd64.deb
Expand Down
Loading