kreuzwerker / envplate

Docker-friendly trivial templating for configuration files using environment keys
MIT License
331 stars 44 forks source link

Syntax error running ep on RPI #18

Closed memolipd closed 8 years ago

memolipd commented 8 years ago

Base image: Hypriot/rpi-node OS: Hypriot 0.6.1 - http://blog.hypriot.com/downloads/

Step 23 : RUN curl -sLo /usr/local/bin/ep https://github.com/kreuzwerker/envplate/releases/download/v0.0.8/ep-linux && chmod +x /usr/local/bin/ep ---> Running in 38da1704a20d ---> 6c2ede3e1c94 Removing intermediate container 38da1704a20d Step 24 : ADD config/interfaces /etc/network/interfaces ---> e8751d0eafcc Removing intermediate container 29b6fe0e8b58 Step 25 : RUN ep /etc/network/interfaces ---> Running in 44dce7cb7251 /usr/local/bin/ep: 1: /usr/local/bin/ep: Syntax error: end of file unexpected (expecting ")") The command '/bin/sh -c ep /etc/network/interfaces' returned a non-zero code: 2

any idea what could be causing this?

yawn commented 8 years ago

Can you attach the config file(s) that ep is parsing?

memolipd commented 8 years ago

sure:

driver=${RADIO_DRIVER}
country_code=${AP_COUNTRY}
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
ssid=${AP_SSID}
hw_mode=g
channel=${AP_CHAN}
beacon_int=100
auth_algs=1
wpa=0
macaddr_acl=0
wmm_enabled=1
ap_isolate=1
ieee80211n=1

I dont think its to do with the file, its poping up the same error on every file, even files without any envs in.

I think its more to do with the Pi using being arm rather than x64/x86 - anyway to fix this?

yawn commented 8 years ago

Hmm - it's possible! Currently the release is not cross-compiled (or tested for that matter) for anything else then x64. Have you tried cross-compiling from source to linux/arm and using that? If this fixes your problem, I'll probably add gox to the project and provide a release for all possible platforms.

memolipd commented 8 years ago

that's a bit beyond me!

I'll have to look into a work around

yawn commented 8 years ago

I locally cross compiled ep for ARM 7 linux: ep-rpi.gz. Can you try that out and report back?

yawn commented 8 years ago

Any news regarding the custom build @memolipd ?

yawn commented 8 years ago

Ping @memolipd

memolipd commented 8 years ago

Sorry, been busy with other work. I will definitely give it a try when I finish my current project. Next week some time at the latest

memolipd commented 8 years ago

Confirmed working:

Step 34 : RUN cat /etc/hostapd/hostapd.conf ---> Running in 705b2f800fbc interface=ap0 driver=${RADIO_DRIVER} country_code=${AP_COUNTRY} ctrl_interface=/var/run/hostapd ctrl_interface_group=0 ssid=${AP_SSID} hw_mode=g channel=${AP_CHAN} beacon_int=100 auth_algs=1 wpa=0 macaddr_acl=0 wmm_enabled=1 ap_isolate=1 ieee80211n=1 ---> f9c36526f545 Removing intermediate container 705b2f800fbc Step 35 : RUN ep /etc/hostapd/hostapd.conf ---> Running in d973379374cd ---> 117b787ca736 Removing intermediate container d973379374cd Step 36 : RUN cat /etc/hostapd/hostapd.conf ---> Running in 58f2561f05eb interface=ap0 driver=nl80211 country_code=GB ctrl_interface=/var/run/hostapd ctrl_interface_group=0 ssid=ohs_setup hw_mode=g channel=1 beacon_int=100 auth_algs=1 wpa=0 macaddr_acl=0 wmm_enabled=1 ap_isolate=1 ieee80211n=1

yawn commented 8 years ago

I've released a RC for 1.0.0. Feel free to test and close if this fixes your issues.

yawn commented 8 years ago

Ping @memolipd

memolipd commented 8 years ago

I wont be able to test the release, but as said above the binary works fine.

yawn commented 8 years ago

👍

memolipd commented 7 years ago

We're trying to run this on a Pi Zero but it fails due to the zero being a ARM and not ARM7.

Any chance someone can throw up a ARM binary? I've tried compiling the go code but its not easy!