Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit f1bb0f4

Browse files
committed
Automate ARM binary production
I've been abusing Scaleway's C1 servers for this purpose for a while now. Hopefully @edouardb and his team won't start decomissioning them as I don't know what else I can use :).
1 parent 11237d9 commit f1bb0f4

6 files changed

Lines changed: 110 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ lib/libv8/VERSION
1212
/ext/libv8/.location.yml
1313
/release/**/libv8
1414
/release/**/.vagrant
15+
/release/**/.scaleway
1516
/vendor/.gclient
1617
/vendor/.gclient_entries
1718
/vendor/v8/

Rakefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ namespace :build do
5555
'x86_64-linux',
5656
'x86-linux',
5757
'armhf-linux',
58+
'arm-linux',
59+
'aarch64-linux',
5860
'x86_64-freebsd-10',
5961
'x86_64-freebsd-11',
6062
'x86_64-linux-musl'
@@ -70,6 +72,9 @@ namespace :build do
7072
sh "vagrant ssh -c 'cd ~/libv8 && bundle install --path vendor/bundle'"
7173
sh "vagrant ssh -c 'cd ~/libv8 && env MAKEFLAGS+=-j4 bundle exec rake binary'"
7274
sh "vagrant ssh -c 'cp ~/libv8/pkg/*.gem /vagrant'"
75+
sh("vagrant status | grep scaleway") do |ok, res|
76+
sh "vagrant ssh --no-tty -c 'cd ~/libv8/pkg && tar -cf - *.gem' 2>/dev/null | tar -xv"
77+
end
7378
sh "vagrant destroy -f"
7479
end
7580
end
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
organisation: 'foofoofo-foof-foof-foof-foofoofoofoo'
3+
token: 'foofoofo-foof-foof-foof-foofoofoofoo'

release/aarch64-linux/Vagrantfile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
require 'yaml'
5+
6+
SETTINGS = YAML.load_file(File.join(File.dirname(__FILE__), '.scaleway'))
7+
8+
# All Vagrant configuration is done below. The "2" in Vagrant.configure
9+
# configures the configuration version (we support older styles for
10+
# backwards compatibility). Please don't change it unless you know what
11+
# you're doing.
12+
Vagrant.configure("2") do |config|
13+
14+
config.vm.provider :scaleway do |scaleway, override|
15+
scaleway.organization = SETTINGS['organization']
16+
scaleway.token = SETTINGS['token']
17+
scaleway.commercial_type = 'ARM64-2GB'
18+
scaleway.image = 'e1a0daf2-a61f-40bf-ba3c-f86ec4baa3bf'
19+
scaleway.region = 'par1'
20+
override.ssh.private_key_path = '~/.ssh/id_rsa'
21+
end
22+
23+
if ARGV[0] == 'ssh'
24+
config.ssh.username = 'vagrant'
25+
end
26+
27+
# Share an additional folder to the guest VM. The first argument is
28+
# the path on the host to the actual folder. The second argument is
29+
# the path on the guest to mount the folder. And the optional third
30+
# argument is a set of non-required options.
31+
config.vm.synced_folder "../../.git", "/libv8/.git"
32+
33+
# Enable provisioning with a shell script. Additional provisioners such as
34+
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
35+
# documentation for more information about their specific syntax and use.
36+
37+
config.vm.provision "shell", inline: <<-SHELL
38+
apt-get update
39+
apt-get install -y software-properties-common
40+
apt-get dist-upgrade -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"
41+
apt-get install -y build-essential git ruby ruby-dev
42+
gem install bundler
43+
useradd -m -s /bin/bash vagrant
44+
mkdir -p /home/vagrant/.ssh
45+
cp /root/.ssh/authorized_keys /home/vagrant/.ssh/
46+
chown -R vagrant:vagrant /home/vagrant/.ssh
47+
chmod go-rw /home/vagrant/.ssh
48+
SHELL
49+
end

release/arm-linux/.scaleway.sample

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
organisation: 'foofoofo-foof-foof-foof-foofoofoofoo'
3+
token: 'foofoofo-foof-foof-foof-foofoofoofoo'

release/arm-linux/Vagrantfile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
require 'yaml'
5+
6+
SETTINGS = YAML.load_file(File.join(File.dirname(__FILE__), '.scaleway'))
7+
8+
# All Vagrant configuration is done below. The "2" in Vagrant.configure
9+
# configures the configuration version (we support older styles for
10+
# backwards compatibility). Please don't change it unless you know what
11+
# you're doing.
12+
Vagrant.configure("2") do |config|
13+
14+
config.vm.provider :scaleway do |scaleway, override|
15+
scaleway.organization = SETTINGS['organization']
16+
scaleway.token = SETTINGS['token']
17+
scaleway.commercial_type = 'C1'
18+
scaleway.image = '27ccbd68-090d-4f95-a342-db2c1c8f3628'
19+
scaleway.region = 'par1'
20+
override.ssh.private_key_path = '~/.ssh/id_rsa'
21+
end
22+
23+
if ARGV[0] == 'ssh'
24+
config.ssh.username = 'vagrant'
25+
end
26+
27+
# Share an additional folder to the guest VM. The first argument is
28+
# the path on the host to the actual folder. The second argument is
29+
# the path on the guest to mount the folder. And the optional third
30+
# argument is a set of non-required options.
31+
config.vm.synced_folder "../../.git", "/libv8/.git"
32+
33+
# Enable provisioning with a shell script. Additional provisioners such as
34+
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
35+
# documentation for more information about their specific syntax and use.
36+
37+
config.vm.provision "shell", inline: <<-SHELL
38+
apt-get update
39+
apt-get install -y software-properties-common
40+
apt-get dist-upgrade -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"
41+
apt-get install -y build-essential git ruby ruby-dev
42+
gem install bundler
43+
useradd -m -s /bin/bash vagrant
44+
mkdir -p /home/vagrant/.ssh
45+
cp /root/.ssh/authorized_keys /home/vagrant/.ssh/
46+
chown -R vagrant:vagrant /home/vagrant/.ssh
47+
chmod go-rw /home/vagrant/.ssh
48+
SHELL
49+
end

0 commit comments

Comments
 (0)