More refactor plus start for the emulator
Signed-off-by: Martyn Ranyard <m@rtyn.berlin>
This commit is contained in:
		
							parent
							
								
									c278cd2a58
								
							
						
					
					
						commit
						3e04b69b97
					
				
					 5 changed files with 32 additions and 5 deletions
				
			
		
							
								
								
									
										13
									
								
								Makefile
									
										
									
									
									
								
							
							
						
						
									
										13
									
								
								Makefile
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -5,10 +5,17 @@ LDFLAGS=-ldflags "-X main.buildDate=${BUILD}"
 | 
			
		|||
.PHONY: build deps static
 | 
			
		||||
 | 
			
		||||
build:
 | 
			
		||||
	go build ${LDFLAGS}
 | 
			
		||||
	go build ${LDFLAGS} -o ledcontroller-server cmd/ledcontroller-server/main.go
 | 
			
		||||
 | 
			
		||||
emulator:
 | 
			
		||||
	go build ${LDFLAGS} -o emulator cmd/emulator/main.go
 | 
			
		||||
 | 
			
		||||
deps:
 | 
			
		||||
	go get
 | 
			
		||||
	cd cmd/ledcontroller-server ; go get ; cd ../..
 | 
			
		||||
 | 
			
		||||
deps-emulator:
 | 
			
		||||
	cd cmd/emulator ; go get ; cd ../..
 | 
			
		||||
 | 
			
		||||
# Static only makes sense for the server
 | 
			
		||||
static:
 | 
			
		||||
	CGO_ENABLED=0 GOOS=linux go build ${LDFLAGS} -a -installsuffix cgo -o LEDController .
 | 
			
		||||
	CGO_ENABLED=0 GOOS=linux go build ${LDFLAGS} -a -installsuffix cgo -o ledcontroller-server cmd/ledcontroller-server/main.go
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,6 +7,6 @@ RUN cd /go/src/git.martyn.berlin/martyn/LEDController/; make deps ; make static
 | 
			
		|||
 | 
			
		||||
FROM scratch
 | 
			
		||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
 | 
			
		||||
COPY --from=builder /go/src/git.martyn.berlin/martyn/LEDController /app/
 | 
			
		||||
COPY --from=builder /go/src/git.martyn.berlin/martyn/ledcontroller-server /app/
 | 
			
		||||
WORKDIR /app
 | 
			
		||||
CMD ["/app/LEDController"]
 | 
			
		||||
							
								
								
									
										20
									
								
								cmd/emulator/main.go
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										20
									
								
								cmd/emulator/main.go
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,20 @@
 | 
			
		|||
package main
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"fyne.io/fyne/app"
 | 
			
		||||
	"fyne.io/fyne/widget"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func main() {
 | 
			
		||||
	app := app.New()
 | 
			
		||||
 | 
			
		||||
	w := app.NewWindow("Hello")
 | 
			
		||||
	w.SetContent(widget.NewVBox(
 | 
			
		||||
		widget.NewLabel("Hello Fyne!"),
 | 
			
		||||
		widget.NewButton("Quit", func() {
 | 
			
		||||
			app.Quit()
 | 
			
		||||
		}),
 | 
			
		||||
	))
 | 
			
		||||
 | 
			
		||||
	w.ShowAndRun()
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -35,7 +35,7 @@ spec:
 | 
			
		|||
        - name: PANEL_BRIGHTNESS
 | 
			
		||||
          value: "10"
 | 
			
		||||
        image: imartyn/ledcontroller:0.0-linux-amd64
 | 
			
		||||
        imagePullPolicy: IfNotPresent
 | 
			
		||||
        imagePullPolicy: Always
 | 
			
		||||
        name: ledcontroller
 | 
			
		||||
        ports:
 | 
			
		||||
        - name: web
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue