1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-18 21:09:40 +02:00

feat(buildinfo): ability to see build info [EE-2552] (#7107)

* feat(buildinfo): ability to see build info [EE-2252]

* handle dark theme

* feat: add build info to status version

* feat: include ldflags in azure pipeline

* echo shell commands in azure build

* clean up main log

* allow tests to pass

* use data from backend

* allow clicking off modal to dismiss

* add placeholder versions

* refactor

* update button class

* fix modal displaying behind elements

Co-authored-by: Dmitry Salakhov <to@dimasalakhov.com>
This commit is contained in:
itsconquest 2022-07-15 11:09:38 +12:00 committed by GitHub
parent f5e774c89d
commit a0d349e0b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 323 additions and 88 deletions

View file

@ -2,6 +2,14 @@ set -x
mkdir -p dist
# populate tool versions
BUILDNUMBER="N/A"
CONTAINER_IMAGE_TAG="N/A"
NODE_VERSION="0"
YARN_VERSION="0"
WEBPACK_VERSION="0"
GO_VERSION="0"
cd api
# the go get adds 8 seconds
go get -t -d -v ./...
@ -9,6 +17,12 @@ go get -t -d -v ./...
# the build takes 2 seconds
GOOS=$1 GOARCH=$2 CGO_ENABLED=0 go build \
--installsuffix cgo \
--ldflags '-s' \
--ldflags "-s \
-X 'github.com/portainer/portainer/api/build.BuildNumber=${BUILDNUMBER}' \
-X 'github.com/portainer/portainer/api/build.ImageTag=${CONTAINER_IMAGE_TAG}' \
-X 'github.com/portainer/portainer/api/build.NodejsVersion=${NODE_VERSION}' \
-X 'github.com/portainer/portainer/api/build.YarnVersion=${YARN_VERSION}' \
-X 'github.com/portainer/portainer/api/build.WebpackVersion=${WEBPACK_VERSION}' \
-X 'github.com/portainer/portainer/api/build.GoVersion=${GO_VERSION}'" \
-o "../dist/portainer" \
./cmd/portainer/

View file

@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -x
PLATFORM=$1
ARCH=$2
@ -15,10 +16,16 @@ cp -R api ${GOPATH}/src/github.com/portainer/portainer/api
cd 'api/cmd/portainer'
go get -t -d -v ./...
GOOS=${PLATFORM} GOARCH=${ARCH} CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags '-s'
GOOS=${PLATFORM} GOARCH=${ARCH} CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags "-s \
-X 'github.com/portainer/portainer/api/build.BuildNumber=${BUILDNUMBER}' \
-X 'github.com/portainer/portainer/api/build.ImageTag=${CONTAINER_IMAGE_TAG}' \
-X 'github.com/portainer/portainer/api/build.NodejsVersion=${NODE_VERSION}' \
-X 'github.com/portainer/portainer/api/build.YarnVersion=${YARN_VERSION}' \
-X 'github.com/portainer/portainer/api/build.WebpackVersion=${WEBPACK_VERSION}' \
-X 'github.com/portainer/portainer/api/build.GoVersion=${GO_VERSION}'"
if [ "${PLATFORM}" == 'windows' ]; then
mv "$BUILD_SOURCESDIRECTORY/api/cmd/portainer/${binary}.exe" "$BUILD_SOURCESDIRECTORY/dist/portainer.exe"
else
else
mv "$BUILD_SOURCESDIRECTORY/api/cmd/portainer/$binary" "$BUILD_SOURCESDIRECTORY/dist/portainer"
fi