chore: Create release folder for desktop builds

This commit is contained in:
Susmitha Girumala committed 2021-08-27 11:28:00 -04:00
1 parent 7d96d9125f
commit a1cfa84919
7 files changed
+48 -18

No files matched your search

-1
View File
@@ -19,7 +19,6 @@
"build:ui:desktop:win": "docker-compose -f docker-compose-embedding.yml run build-desktop-production && yarn build:ui:desktop:app",
"build:ui:desktop:production": "cd ui/desktop && yarn build:production",
"build:ui:desktop:app": "cd ui/desktop && yarn build:desktop",
"build:ui:desktop:app:linux": "cd ui/desktop && yarn build:desktop:linux",
"lint": "npm-run-all lint:*",
"lint:addons-api": "cd addons/api && yarn lint",
"lint:addons-auth": "cd addons/auth && yarn lint",
+1
View File
@@ -76,6 +76,7 @@ These environment variables may be used to customized the build.
| `APP_UPDATER_CURRENT_VERSION` | Version of client. |
| `APP_UPDATER_LATEST_VERSION_TAG` | Next version for comparison with current version. |
| `APP_UPDATER_LATEST_VERSION_LOCATION` | Location of app release to use for updating client. Can be a filepath or url. |
| `BUILD_DEBIAN` | Enable to build debian artifacts on MacOS. |
| `BYPASS_CLI_SETUP` | Disable download and extraction of cli. For development use only. |
### Building for Production
+14 -2
View File
@@ -9,7 +9,6 @@ const artifactDestination = path.resolve(__dirname, '..', 'cli');
const downloadArtifact = (version) => {
const archivePlatform = {};
// TODO: Support all available build machines
if (isMac()) {
archivePlatform.name = 'darwin';
archivePlatform.arch = 'amd64';
@@ -20,11 +19,24 @@ const downloadArtifact = (version) => {
archivePlatform.arch = 'amd64';
}
if (isLinux() || process.env.CLI_LINUX_DEBIAN_SUPPORT) {
if (isLinux()) {
let arch = os.arch();
// Map x64 to amd64 cli artifact
if (arch.match(/(x64)/i)) arch = 'amd64';
archivePlatform.name = os.platform();
archivePlatform.arch = arch;
}
// Set cli artifact to linux-amd64 when building debian artifacts on macOS
if (process.env.BUILD_DEBIAN) {
archivePlatform.name = 'linux';
archivePlatform.arch = 'amd64';
}
console.log(
`Download cli for platform: ${archivePlatform.name} arch: ${archivePlatform.arch}`
);
const archiveName = `boundary_${version}_${archivePlatform.name}_${archivePlatform.arch}.zip`;
const url = `https://releases.hashicorp.com/boundary/${version}/${archiveName}`;
return new Promise((resolve, reject) => {
+2 -1
View File
@@ -1,5 +1,6 @@
const fs = require('fs');
const path = require('path');
const { isLinux } = require('../src/helpers/platform.js');
// Create config
const createConfig = () => {
@@ -11,7 +12,7 @@ const createConfig = () => {
releaseCommit: process.env.RELEASE_COMMIT,
};
if (process.env.CLI_LINUX_DEBIAN_SUPPORT) {
if (isLinux() || process.env.BUILD_DEBIAN) {
config.name = 'boundary-desktop';
config.productName = 'boundary-desktop';
}
+10 -11
View File
@@ -12,7 +12,7 @@ console.log(`[forge-config] Release version: ${config.releaseVersion}`);
if (
isMac() &&
!process.env.BOUNDARY_DESKTOP_SIGNING_IDENTITY &&
!process.env.CLI_LINUX_DEBIAN_SUPPORT
!process.env.BUILD_DEBIAN
)
console.warn(
'[forge-config] WARNING: Could not find signing identity. Proceeding without signing.'
@@ -63,29 +63,28 @@ module.exports = {
postPackage: async (forgeConfig, options) => {
if (options.spinner) {
options.spinner.info(
`Completed packaging for platform: ${options.platform} arch: ${options.arch} at ${options.outputPaths[0]}`
`Packaged for ${options.platform}-${options.arch} at ${options.outputPaths[0]}`
);
}
},
postMake: (forgeConfig, options) => {
// Copy artifacts into release folder
options.forEach(({ artifacts, platform, arch }) => {
// Generate platform arch folder name
const folder = `boundary-desktop_${forgeConfig.packagerConfig.appVersion}_${platform}_${arch}`;
const destination = path.join('out', 'artifacts', folder);
// Generate release name
const version = forgeConfig.packagerConfig.appVersion;
const destination = path.join('out', 'release', version);
if (!fs.existsSync(destination))
fs.mkdirSync(destination, { recursive: true });
// Copy artifacts
artifacts.forEach(async (artifact) => {
const artifactDestination = path.join(
destination,
path.basename(artifact)
);
console.log(`Copy ${artifact} into ${artifactDestination}.`);
const name = `boundary-desktop_${version}_${platform}_${arch}${path.extname(artifact)}`;
const artifactDestination = path.join(destination, name);
console.log(`[release] Found artifact: ${artifact}`);
try {
await fs.promises.copyFile(artifact, artifactDestination);
console.log(`[release] Copied artifact: ${path.resolve(artifactDestination)}`);
} catch (e) {
console.log(`Could not copy ${artifact}`, e);
console.warn(`[release] Could not copy ${artifact}`, e);
}
});
});
@@ -4,7 +4,8 @@
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/focal64"
config.vm.synced_folder "../../../out/artifacts", "/vagrant-desktop-app", create: true, owner: "vagrant", group: "vagrant", automount: true
# Share desktop artifacts folder
config.vm.synced_folder "../../../out/release", "/vagrant-desktop-app", create: true, owner: "vagrant", group: "vagrant", automount: true
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
@@ -13,6 +14,7 @@ Vagrant.configure("2") do |config|
vb.memory = "4096"
end
# Setup for testing desktop
config.vm.provision "shell", inline: <<-SHELL
sudo apt update -y
sudo apt upgrade -y
@@ -38,5 +40,21 @@ Vagrant.configure("2") do |config|
sudo shutdown -r now
SHELL
config.vm.post_up_message = "Login using username/password: vagrant/vagrant. Boundary Desktop artifacts: /media/sf_vagrant-boundary-desktop-app. Boundary CLI: /home/vagrant/Desktop."
# Setup for developing desktop
config.vm.provision "shell", inline: <<-SHELL
sudo apt remove cmdtest
sudo apt install -y npm curl git
git clone https://github.com/hashicorp/boundary-ui.git /home/vagrant/Desktop/boundary-ui
sudo npm install yarn
# Setup node 12 source
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt install -y nodejs
# Install boundary-ui dependencies
cd /home/vagrant/Desktop/boundary-ui
yarn install
SHELL
config.vm.post_up_message = "Login using username/password: vagrant/vagrant.\nBoundary Desktop: /media/sf_vagrant-boundary-desktop-app.\nBoundary CLI: /home/vagrant/Desktop."
end
+1 -1
View File
@@ -16,7 +16,7 @@
"build:development": "ember build",
"prebuild:desktop": "cross-os prebuild:desktop",
"build:desktop": "yarn build:desktop:install && yarn --cwd electron-app make",
"build:desktop:linux": "yarn build:desktop:install && CLI_LINUX_DEBIAN_SUPPORT=true yarn --cwd electron-app make --platform linux --arch x64",
"build:desktop:debian": "yarn build:desktop:install && BUILD_DEBIAN=true yarn --cwd electron-app make --platform linux --arch x64",
"build:desktop:install": "yarn install --cwd electron-app",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel 'lint:!(fix)'",
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",