more travis stuff

pull/363/head
Connor Rigby 2017-11-12 17:42:15 -08:00
parent 044b271110
commit c9dea910f3
4 changed files with 23 additions and 15 deletions

1
.gitignore vendored
View File

@ -35,6 +35,7 @@ node_modules
# Various env vars.
.env
travis_env
# Fwup keys aren't stored here, but just in case.
*.priv

View File

@ -1,14 +1,13 @@
language: erlang
otp_release:
- 19.2
- 20.0
sudo: required
dist: trusty
addons:
apt:
sources:
- llvm-toolchain-precise
- ubuntu-toolchain-r-test
- llvm-toolchain-precise
- ubuntu-toolchain-r-test
packages:
- node
- squashfs-tools
@ -22,16 +21,15 @@ addons:
- unzip
- cmake
- python
env:
global:
- ELIXIR_VERSION=1.4.1 ERLANG_VERSION=19.2 MIX_TARGET=rpi3 NO_WEBPACK=true
- ELIXIR_VERSION=1.5.0 ERLANG_VERSION=20.0 FWUP_VERSION=0.17.0 MIX_TARGET=rpi3 NO_WEBPACK=true
before_install:
# - wget https://packages.erlang-solutions.com/erlang/esl-erlang/FLAVOUR_1_general/esl-erlang_$ERLANG_VERSION-1~ubuntu~trusty_amd64.deb;
# - sudo dpkg -i esl-erlang_$ERLANG_VERSION-1~ubuntu~trusty_amd64.deb
- openssl aes-256-cbc -K $encrypted_a344ae763d55_key -iv $encrypted_a344ae763d55_iv
-in travis_env.enc -out travis_env -d
- wget https://github.com/elixir-lang/elixir/releases/download/v$ELIXIR_VERSION/Precompiled.zip
- wget https://github.com/fhunleth/fwup/releases/download/v0.16.1/fwup_0.16.1_amd64.deb
- sudo dpkg -i fwup_0.16.1_amd64.deb
- wget https://github.com/fhunleth/fwup/releases/download/v$FWUP_VERSION/fwup_$FWUP_VERSION_amd64.deb
- sudo dpkg -i fwup_$FWUP_VERSION_amd64.deb
- unzip -d elixir Precompiled.zip
before_script:
- export PATH=`pwd`/elixir/bin:$PATH

View File

@ -50,13 +50,22 @@ config :farmbot, :behaviour,
system_tasks: Farmbot.Target.SystemTasks,
firmware_handler: Farmbot.Firmware.StubHandler
file = Path.join(System.user_home!(), ".ssh/id_rsa.pub")
authorized_keys = (System.get_env("TRAVIS_AUTHORIZED_KEYS") || "") |> String.split(",")
if File.exists?(file) do
config :nerves_firmware_ssh, authorized_keys: [File.read!(file)] ++ authorized_keys
local_file = Path.join(System.user_home!(), ".ssh/id_rsa.pub")
local_key = if File.exists?(local_file) do
[File.read!(local_file)]
else
[]
end
travis_file = "travis_env"
travis_keys = if File.exists?(travis_file) do
File.read!(travis_file) |> String.split(",")
else
[]
end
config :nerves_firmware_ssh, authorized_keys: local_key ++ travis_keys
config :nerves_init_gadget,
address_method: :static

BIN
travis_env.enc 100644

Binary file not shown.