mirror of
https://github.com/balena-io/open-balena.git
synced 2025-06-24 10:18:15 +00:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
d3b021a1cb | |||
b9b9b65ce6 | |||
9fb3f76858 | |||
52fb653223 | |||
7332b6971e | |||
011f3a35f9 | |||
0842b7b4ae | |||
37ecfb8996 | |||
bd638ac409 |
50
.openbalenarc
Normal file
50
.openbalenarc
Normal file
@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
alias dc="/home/vagrant/openbalena/scripts/compose"
|
||||
|
||||
function enter () {
|
||||
if [[ $# -lt 1 ]]; then
|
||||
echo "Usage: enter <service name> [command]"
|
||||
echo " "
|
||||
echo " Runs a [command] in the service specified."
|
||||
echo " "
|
||||
echo " command:"
|
||||
echo " (default) /bin/bash"
|
||||
echo " "
|
||||
echo " example:"
|
||||
echo " enter api # this will run the command '/bin/bash' in the API service, providing a shell prompt"
|
||||
echo " enter api uptime # this will run the command 'uptime' in the API service, and return"
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
service="$1"
|
||||
shift
|
||||
COMMAND=/bin/bash
|
||||
if [[ $# -gt 0 ]]; then
|
||||
COMMAND="$@"
|
||||
fi
|
||||
dc exec ${service} /bin/bash -c "${COMMAND}"
|
||||
}
|
||||
|
||||
function logs () {
|
||||
if [[ $# -lt 1 ]]; then
|
||||
echo "Usage: logs <service name> [options]"
|
||||
echo " "
|
||||
echo " Shows the logs from journalctl in the service specified."
|
||||
echo " "
|
||||
echo " options:"
|
||||
echo " -f tail the log stream"
|
||||
echo " -n number of lines to take"
|
||||
echo " "
|
||||
echo " example:"
|
||||
echo " logs api -fn100 # this will tail the API log, starting with the last 100 lines"
|
||||
return 1
|
||||
fi
|
||||
|
||||
service="$1"
|
||||
shift
|
||||
enter ${service} journalctl "$@"
|
||||
}
|
||||
|
||||
cd /home/vagrant/openbalena
|
15
CHANGELOG.md
15
CHANGELOG.md
@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file
|
||||
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
# v0.2.0
|
||||
## (2019-01-25)
|
||||
|
||||
* Do not publish DB and Redis ports to the host [Akis Kesoglou]
|
||||
|
||||
# v0.1.4
|
||||
## (2019-01-10)
|
||||
|
||||
* vagrant: Add missing Node dependency [Rich Bayliss]
|
||||
|
||||
# v0.1.3
|
||||
## (2019-01-10)
|
||||
|
||||
* vagrant: Improve the Vagrant file to make development easier [Rich Bayliss]
|
||||
|
||||
# v0.1.2
|
||||
## (2018-12-20)
|
||||
|
||||
|
27
Vagrantfile
vendored
27
Vagrantfile
vendored
@ -7,25 +7,30 @@ Vagrant.require_version '>= 2.0.0'
|
||||
end
|
||||
|
||||
Vagrant.configure('2') do |config|
|
||||
config.vm.define 'openbalenavm'
|
||||
config.vm.box = 'bento/ubuntu-16.04'
|
||||
config.vm.box_url = 'https://vagrantcloud.com/bento/boxes/ubuntu-16.04/versions/201808.24.0/providers/virtualbox.box'
|
||||
config.vm.define 'openbalena'
|
||||
config.vm.hostname = 'openbalena-vagrant'
|
||||
config.vm.box = 'bento/ubuntu-18.04'
|
||||
|
||||
config.vm.network "public_network",
|
||||
use_dhcp_assigned_default_route: true
|
||||
|
||||
config.vm.synced_folder '.', '/vagrant', disabled: true
|
||||
config.vm.synced_folder '.', '/home/vagrant/open-balena'
|
||||
config.vm.network 'public_network', bridge: ENV.fetch('OPENBALENA_BRIDGE', '')
|
||||
config.vm.synced_folder '.', '/home/vagrant/openbalena'
|
||||
|
||||
config.ssh.forward_agent = true
|
||||
|
||||
config.vm.provision :docker
|
||||
config.vm.provision :docker_compose
|
||||
|
||||
# FIXME: remove node
|
||||
config.vm.provision :shell, inline: 'apt-get update && apt-get install -y nodejs && rm -rf /var/lib/apt/lists/*'
|
||||
$provision = <<-SCRIPT
|
||||
touch /home/vagrant/.bashrc
|
||||
grep -Fxq 'source /home/vagrant/openbalena/.openbalenarc' /home/vagrant/.bashrc || echo 'source /home/vagrant/openbalena/.openbalenarc' >> /home/vagrant/.bashrc
|
||||
|
||||
config.vm.provision :shell, privileged: false,
|
||||
inline: "cd /home/vagrant/open-balena && ./scripts/quickstart -p -d #{ENV.fetch('OPENBALENA_DOMAIN', 'openbalena.local')}"
|
||||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
|
||||
source "/home/vagrant/.nvm/nvm.sh" # This loads nvm
|
||||
nvm install 10.15.0 && nvm use 10.15.0
|
||||
SCRIPT
|
||||
|
||||
config.vm.provision :shell, privileged: false, inline: $provision
|
||||
|
||||
config.vm.provision :shell, privileged: false,
|
||||
inline: "echo 'cd ~/open-balena' >> ~/.bashrc"
|
||||
end
|
||||
|
@ -142,11 +142,12 @@ services:
|
||||
- redis
|
||||
ports:
|
||||
- "80:80"
|
||||
- "222:222"
|
||||
- "443:443"
|
||||
- "3128:3128"
|
||||
- "5432:5432"
|
||||
- "6379:6379"
|
||||
expose:
|
||||
- "222"
|
||||
- "5432"
|
||||
- "6379"
|
||||
networks:
|
||||
default:
|
||||
aliases:
|
||||
|
Reference in New Issue
Block a user