From 186873d9d42960c9b29fa65945a1416fd2bc770e Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Corvo Date: Wed, 6 Nov 2024 10:19:49 -0800 Subject: [PATCH] Remove build debian in Mac OS and all its dependencies (#2543) --- ui/desktop/README.md | 9 -- ui/desktop/electron-app/config/cli.js | 6 - ui/desktop/electron-app/config/desktop.js | 7 +- .../electron-app/config/forge.config.js | 7 +- .../environments/ubuntu-focal64/Vagrantfile | 108 ------------------ ui/desktop/package.json | 1 - 6 files changed, 2 insertions(+), 136 deletions(-) delete mode 100644 ui/desktop/environments/ubuntu-focal64/Vagrantfile diff --git a/ui/desktop/README.md b/ui/desktop/README.md index 155aa0400..bfd6b8efb 100644 --- a/ui/desktop/README.md +++ b/ui/desktop/README.md @@ -51,7 +51,6 @@ List of available project commands. `yarn run ` | ------- | ----------- | | build | Builds the UI for production. | | build:development | Builds the UI in development mode. | -| build:desktop:debianOnMacOS | Builds debian based linux artifacts on MacOS. | | lint | Runs all lint commands. | | lint:fix | Runs all automatic linting fixes. | | lint:hbs | Lints `hbs` template files. | @@ -128,14 +127,6 @@ bypass the download of the CLI, which can be useful for pre-release testing. See [Developing Using Non-Release Versions of Boundary](#developing-using-non-release-versions-of-boundary) for more details. -To build debian based linux artifacts on MacOS, additional [MacOS tools](https://www.electronforge.io/config/makers/deb) need to be installed before running the following commands from this folder. - -```bash -yarn install -yarn build:production # Build assets -yarn build:desktop:debianOnMacOS # Build app -``` - #### Environment Variables (PROD) These environment variables may be used to customized the build. diff --git a/ui/desktop/electron-app/config/cli.js b/ui/desktop/electron-app/config/cli.js index 92e21db87..b111e8b7d 100644 --- a/ui/desktop/electron-app/config/cli.js +++ b/ui/desktop/electron-app/config/cli.js @@ -35,12 +35,6 @@ const downloadArtifact = (version) => { 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}`, ); diff --git a/ui/desktop/electron-app/config/desktop.js b/ui/desktop/electron-app/config/desktop.js index 87588619f..9ef7c905d 100644 --- a/ui/desktop/electron-app/config/desktop.js +++ b/ui/desktop/electron-app/config/desktop.js @@ -13,12 +13,7 @@ const createConfig = () => { executableName: 'Boundary', }; - if (process.env.BUILD_DEBIAN) { - config.name = 'boundary-desktop'; - config.productName = 'boundary-desktop'; - } - - if (isLinux() || process.env.BUILD_DEBIAN) config.executableName = 'boundary-desktop'; + if (isLinux()) config.executableName = 'boundary-desktop'; if (!config.releaseVersion) config.releaseVersion = '0.0.0'; return config; diff --git a/ui/desktop/electron-app/config/forge.config.js b/ui/desktop/electron-app/config/forge.config.js index fdec91f7d..14c5c8830 100644 --- a/ui/desktop/electron-app/config/forge.config.js +++ b/ui/desktop/electron-app/config/forge.config.js @@ -83,12 +83,7 @@ module.exports = { console.log(`[package] Release version: ${config.releaseVersion}`); // Check for MacOS signing identity. - // Ignore signing identity warning for debian builds made on MacOS - if ( - isMac() && - !process.env.BOUNDARY_DESKTOP_SIGNING_IDENTITY && - !process.env.BUILD_DEBIAN - ) + if (isMac() && !process.env.BOUNDARY_DESKTOP_SIGNING_IDENTITY) console.warn( '[package] WARNING: Could not find signing identity. Proceeding without signing.', ); diff --git a/ui/desktop/environments/ubuntu-focal64/Vagrantfile b/ui/desktop/environments/ubuntu-focal64/Vagrantfile deleted file mode 100644 index ece776f7e..000000000 --- a/ui/desktop/environments/ubuntu-focal64/Vagrantfile +++ /dev/null @@ -1,108 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -=begin -This vagrant script is used to setup Ubuntu in Virtualbox and deploy both the desktop client and cli -in preparation for testing linux support for desktop client. - -Install vagrant guest additions plugin: `vagrant plugin install vagrant-vbguest`. - -## Setup Desktop -For using locally built debian artifacts: -- Refer to 'Building for Production' section in /boundary-ui/ui/desktop/README to build debian - artifacts on MacOS - -## Setup Ubuntu -- Create a ubuntu desktop box using vagrant: `vagrant up --provision-with setup,cli,staged-desktop`. -- Desktop client artifact and cli will be available in `/home/vagrant/Desktop` after logging into ubuntu. - Username/password for login: vagrant/vagrant. Navigate to `/home/vagrant/Desktop` in a terminal app. -- To install desktop app use either `apt` or `dpkg` - - `sudo apt install ./boundary-desktop_1.3.0_linux_amd64.deb` - - `sudo dpkg -i ./boundary-desktop_1.3.0_linux_amd64.deb` - - To launch desktop client from terminal: `boundary-desktop` -- To launch cli: `./boundary dev` - -## Provision types -User --provision-with option to setup machine for either cli or development -Setup for testing staged desktop release: - vagrant up --provision-with setup,cli,staged-desktop -Setup for testing artifacts built locally: - vagrant up --provision-with setup,cli -Setup for developing desktop client: - vagrant up --provision-with setup,development -To destroy machine: - vagrant destroy -f -=end - -Vagrant.configure("2") do |config| - config.vm.box = "ubuntu/focal64" - - # 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 - vb.gui = true - # Customize the amount of memory on the VM: - vb.memory = "4096" - vb.customize ["modifyvm", :id, "--vram", "64"] - end - - config.vm.provision "setup", type: "shell", inline: <<-SHELL - sudo apt-get update -y - sudo apt-get upgrade -y - sudo apt-get install curl firefox - # Add vagrant to administrator group - sudo usermod -aG sudo vagrant - # Add vagrant to shared folder - sudo usermod -aG vboxsf vagrant - SHELL - - # Setup for testing desktop - config.vm.provision "cli", type: "shell", inline: <<-SHELL - # Install ubuntu desktop GUI - # For GNOME desktop: - # sudo apt install gnome-session gnome-terminal - sudo apt-get install -y --no-install-recommends lubuntu-desktop - # Setup boundary cli - sudo apt-get install docker.io -y - sudo groupadd docker - sudo usermod -aG docker vagrant - sudo apt-get install -y unzip - curl https://releases.hashicorp.com/boundary/0.5.0/boundary_0.5.0_linux_amd64.zip -o boundary-cli.zip - unzip -o boundary-cli.zip -d /home/vagrant/Desktop/ - # Setup localhost ssh - yes | ssh-keygen -t rsa -N "" -f /home/vagrant/.ssh/id_rsa -C vagrant@ubuntu-focal - cat /home/vagrant/.ssh/id_rsa.pub >> /home/vagrant/.ssh/authorized_keys - sudo chown -R vagrant:vagrant .ssh - # Restart - # sudo shutdown -r now - SHELL - - # Setup for developing desktop - config.vm.provision "development", type: "shell", inline: <<-SHELL - # Setup node source - curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - - sudo apt-get install -y nodejs - - sudo apt-get remove cmdtest - sudo apt-get install -y npm git chromium-browser - - git clone https://github.com/hashicorp/boundary-ui.git /home/vagrant/Desktop/boundary-ui - sudo npm install -g yarn - - # Install boundary-ui dependencies - cd /home/vagrant/Desktop/boundary-ui - yarn install - SHELL - - config.vm.provision "staged-desktop", type: "shell", inline: <<-SHELL - # Download staged desktop - sudo apt install wget -y - wget -P /home/vagrant/Desktop/ http://hc-releases-boundary-desktop-staging.s3-website-us-east-1.amazonaws.com/boundary-desktop/1.3.0/boundary-desktop_1.3.0_linux_amd64.deb - # Install - sudo apt install /home/vagrant/Desktop/boundary-desktop_1.3.0_linux_amd64.deb - SHELL - - config.vm.post_up_message = "Login using username/password: vagrant/vagrant.\nArtifacts: /home/vagrant/Desktop" -end diff --git a/ui/desktop/package.json b/ui/desktop/package.json index 440e1ceaf..0cbdd7f1c 100644 --- a/ui/desktop/package.json +++ b/ui/desktop/package.json @@ -16,7 +16,6 @@ "build:development": "ember build", "prebuild:desktop": "shx rm -rf electron-app/ember-dist electron-app/out && shx cp -r dist/ electron-app/ember-dist/", "build:desktop": "yarn build:desktop:install && yarn --cwd electron-app make", - "build:desktop:debianOnMacOS": "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": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"", "lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"",