🎨 build version
This commit is contained in:
		
							parent
							
								
									652ecc248b
								
							
						
					
					
						commit
						fc1e15bf31
					
				@ -1,11 +1,10 @@
 | 
				
			|||||||
FROM golang:alpine AS binarybuilder
 | 
					FROM golang:alpine AS binarybuilder
 | 
				
			||||||
RUN apk --no-cache --no-progress add \
 | 
					RUN apk --no-cache --no-progress add \
 | 
				
			||||||
    gcc \
 | 
					    gcc git musl-dev
 | 
				
			||||||
    musl-dev
 | 
					 | 
				
			||||||
WORKDIR /dashboard
 | 
					WORKDIR /dashboard
 | 
				
			||||||
COPY . .
 | 
					COPY . .
 | 
				
			||||||
RUN cd cmd/dashboard \
 | 
					RUN cd cmd/dashboard \
 | 
				
			||||||
    && go build -o app -ldflags="-s -w"
 | 
					    && go build -o app -ldflags="-s -w -X github.com/p14yground/nezha/service/dao.Version=`git rev-parse HEAD`"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
FROM alpine:latest
 | 
					FROM alpine:latest
 | 
				
			||||||
RUN apk --no-cache --no-progress add \
 | 
					RUN apk --no-cache --no-progress add \
 | 
				
			||||||
 | 
				
			|||||||
@ -1,7 +1,7 @@
 | 
				
			|||||||
{{define "common/footer"}}
 | 
					{{define "common/footer"}}
 | 
				
			||||||
<div class="ui inverted vertical footer segment">
 | 
					<div class="ui inverted vertical footer segment">
 | 
				
			||||||
    <div class="ui center aligned text container">
 | 
					    <div class="ui center aligned text container">
 | 
				
			||||||
        本系统由 <a href="https://github.com/p14yground/nezha" target="_blank">哪吒面板</a>(v{{.Version}}) 强力驱动
 | 
					        本系统由 <a href="https://github.com/p14yground/nezha" target="_blank">哪吒面板</a> <small>build · {{.Version}}</small> 强力驱动
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
<script src="https://cdnjs.loli.net/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
 | 
					<script src="https://cdnjs.loli.net/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
 | 
				
			||||||
 | 
				
			|||||||
@ -28,6 +28,12 @@ var ServerLock sync.RWMutex
 | 
				
			|||||||
// Version ..
 | 
					// Version ..
 | 
				
			||||||
var Version = "debug"
 | 
					var Version = "debug"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func init() {
 | 
				
			||||||
 | 
						if len(Version) > 7 {
 | 
				
			||||||
 | 
							Version = Version[:7]
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// SendCommand ..
 | 
					// SendCommand ..
 | 
				
			||||||
func SendCommand(cmd *pb.Command) {
 | 
					func SendCommand(cmd *pb.Command) {
 | 
				
			||||||
	ServerLock.RLock()
 | 
						ServerLock.RLock()
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user