Verified Commit 4844e848 authored by Aral Balkan's avatar Aral Balkan
Browse files

Add Linux on ARM64 support to deployment flow and install template

parent b1cb4f52
......@@ -468,15 +468,17 @@ async function build () {
// We use tar and gzip here instead of zip as unzip is not a standard
// part of Linux distributions whereas tar and gzip are. We do not use
// gzip directly as that does not maintain the executable flag on the binary.
const zipFileName = `${binaryVersion}.tar.gz`
const mainSourceDirectory = path.join(__dirname, '..')
const linuxX64WorkingDirectory = path.join(mainSourceDirectory, linuxX64Directory)
const linuxArmWorkingDirectory = path.join(mainSourceDirectory, linuxArmDirectory)
const macOsWorkingDirectory = path.join(mainSourceDirectory, macOsDirectory )
const windowsWorkingDirectory = path.join(mainSourceDirectory, windowsDirectory )
const zipFileName = `${binaryVersion}.tar.gz`
const mainSourceDirectory = path.join(__dirname, '..')
const linuxX64WorkingDirectory = path.join(mainSourceDirectory, linuxX64Directory)
const linuxArmWorkingDirectory = path.join(mainSourceDirectory, linuxArmDirectory)
const linuxArm64WorkingDirectory = path.join(mainSourceDirectory, linuxArmDirectory)
const macOsWorkingDirectory = path.join(mainSourceDirectory, macOsDirectory )
const windowsWorkingDirectory = path.join(mainSourceDirectory, windowsDirectory )
childProcess.execSync(`tar -cvzf ${zipFileName} ${binaryName}`, {env: process.env, cwd: linuxX64WorkingDirectory})
childProcess.execSync(`tar -cvzf ${zipFileName} ${binaryName}`, {env: process.env, cwd: linuxArmWorkingDirectory})
childProcess.execSync(`tar -cvzf ${zipFileName} ${binaryName}`, {env: process.env, cwd: linuxArm64WorkingDirectory})
childProcess.execSync(`tar -cvzf ${zipFileName} ${binaryName}`, {env: process.env, cwd: macOsWorkingDirectory })
childProcess.execSync(`tar -cvzf ${zipFileName} ${windowsBinaryName}`, {env: process.env, cwd: windowsWorkingDirectory})
......@@ -527,26 +529,30 @@ async function build () {
if (fs.existsSync(websitePath)) {
console.log(' • Copying release binaries to the Site.js web site…')
const linuxX64VersionZipFilePath = path.join(linuxX64WorkingDirectory, zipFileName)
const linuxArmVersionZipFilePath = path.join(linuxArmWorkingDirectory, zipFileName)
const macOsVersionZipFilePath = path.join(macOsWorkingDirectory, zipFileName)
const windowsVersionZipFilePath = path.join(windowsWorkingDirectory, zipFileName)
const linuxX64VersionZipFilePath = path.join(linuxX64WorkingDirectory, zipFileName)
const linuxArmVersionZipFilePath = path.join(linuxArmWorkingDirectory, zipFileName)
const linuxArm64VersionZipFilePath = path.join(linuxArm64WorkingDirectory, zipFileName)
const macOsVersionZipFilePath = path.join(macOsWorkingDirectory, zipFileName)
const windowsVersionZipFilePath = path.join(windowsWorkingDirectory, zipFileName)
const websitePathForLinuxX64Version = path.join(websitePathForBinaries, 'linux' )
const websitePathForLinuxArmVersion = path.join(websitePathForBinaries, 'linux-arm')
const websitePathForMacVersion = path.join(websitePathForBinaries, 'macos' )
const websitePathForWindowsVersion = path.join(websitePathForBinaries, 'windows' )
const websitePathForLinuxX64Version = path.join(websitePathForBinaries, 'linux' )
const websitePathForLinuxArmVersion = path.join(websitePathForBinaries, 'linux-arm')
const websitePathForLinuxArm64Version = path.join(websitePathForBinaries, 'linux-arm')
const websitePathForMacVersion = path.join(websitePathForBinaries, 'macos' )
const websitePathForWindowsVersion = path.join(websitePathForBinaries, 'windows' )
fs.ensureDirSync(websitePathForBinaries, {recursive: true})
fs.ensureDirSync(websitePathForLinuxX64Version)
fs.ensureDirSync(websitePathForLinuxArmVersion)
fs.ensureDirSync(websitePathForMacVersion )
fs.ensureDirSync(websitePathForWindowsVersion )
fs.copyFileSync(linuxX64VersionZipFilePath, path.join(websitePathForLinuxX64Version, zipFileName))
fs.copyFileSync(linuxArmVersionZipFilePath, path.join(websitePathForLinuxArmVersion, zipFileName))
fs.copyFileSync(macOsVersionZipFilePath, path.join(websitePathForMacVersion, zipFileName))
fs.copyFileSync(windowsVersionZipFilePath, path.join(websitePathForWindowsVersion, zipFileName))
fs.ensureDirSync(websitePathForLinuxX64Version )
fs.ensureDirSync(websitePathForLinuxArmVersion )
fs.ensureDirSync(websitePathForLinuxArm64Version)
fs.ensureDirSync(websitePathForMacVersion )
fs.ensureDirSync(websitePathForWindowsVersion )
fs.copyFileSync(linuxX64VersionZipFilePath, path.join(websitePathForLinuxX64Version, zipFileName))
fs.copyFileSync(linuxArmVersionZipFilePath, path.join(websitePathForLinuxArmVersion, zipFileName))
fs.copyFileSync(linuxArm64VersionZipFilePath, path.join(websitePathForLinuxArmVersion, zipFileName))
fs.copyFileSync(macOsVersionZipFilePath, path.join(websitePathForMacVersion, zipFileName))
fs.copyFileSync(windowsVersionZipFilePath, path.join(websitePathForWindowsVersion, zipFileName))
// Write out a dynamic route on the SiteJS.org web site to return the binary version. This endpoint is used by
// the auto-update feature to decide whether the binary should be updated.
......
......@@ -105,6 +105,9 @@ if [[ "$OSTYPE" == "linux-gnu" || "$OSTYPE" == "linux-gnueabihf" ]]; then
elif [[ "$cpuArchitecture" == "armv7l" || "$cpuArchitecture" == "armv6l" ]]; then
# Linux on ARM. Tested on Raspberry Pi Zero W (armv6l), 3B+ and 4B (both reporting armv7l).
wget -q "https://sitejs.org/binaries/${releaseChannel}/linux-arm/${binaryVersion}.tar.gz"
elif [[ "$cpuArchitecture" == "aarch64" ]]; then
# Linux on ARM64. Tested with Pinebook Pro.
wget -q "https://sitejs.org/binaries/${releaseChannel}/linux-arm64/${binaryVersion}.tar.gz"
else
# Error: unsupported architecture.
echo
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment