mirror of
https://git.vectorsigma.ru/public/k3s.git
synced 2026-07-28 20:09:08 +00:00
Build k3s overhaul (#12200)
* Add full ci support without Dapper * Seperate git and other version tags, improves caching on binary builds * Use new local targets for build-k3s.yaml workflow * Allow optional ghcr build caching * Build binary using GHA native commands * Use internal setup-go action for e2e.yaml * Add emulation builds to k3s-build.yaml (for arm32 and future riscv64) * Be consistent in k3s artifact names * Fix package/dockerfile warnings * Fix install script for PR installs Signed-off-by: Derek Nola <derek.nola@suse.com>
This commit is contained in:
25
scripts/git_version.sh
Executable file
25
scripts/git_version.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
GIT_TAG=$DRONE_TAG
|
||||
TREE_STATE=clean
|
||||
COMMIT=$DRONE_COMMIT
|
||||
|
||||
if [ -d .git ]; then
|
||||
if [ -z "$GIT_TAG" ]; then
|
||||
GIT_TAG=$(git tag -l --contains HEAD | head -n 1)
|
||||
fi
|
||||
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
|
||||
DIRTY="-dirty"
|
||||
TREE_STATE=dirty
|
||||
fi
|
||||
|
||||
COMMIT=$(git log -n3 --pretty=format:"%H %ae" | grep -v ' drone@localhost$' | cut -f1 -d\ | head -1)
|
||||
if [ -z "${COMMIT}" ]; then
|
||||
COMMIT=$(git rev-parse HEAD || true)
|
||||
fi
|
||||
fi
|
||||
|
||||
export GIT_TAG
|
||||
export TREE_STATE
|
||||
export COMMIT
|
||||
export DIRTY
|
||||
@@ -4,23 +4,9 @@ GO=${GO-go}
|
||||
ARCH=${ARCH:-$("${GO}" env GOARCH)}
|
||||
OS=${OS:-$("${GO}" env GOOS)}
|
||||
SUFFIX="-${ARCH}"
|
||||
GIT_TAG=$DRONE_TAG
|
||||
TREE_STATE=clean
|
||||
COMMIT=$DRONE_COMMIT
|
||||
|
||||
if [ -d .git ]; then
|
||||
if [ -z "$GIT_TAG" ]; then
|
||||
GIT_TAG=$(git tag -l --contains HEAD | head -n 1)
|
||||
fi
|
||||
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
|
||||
DIRTY="-dirty"
|
||||
TREE_STATE=dirty
|
||||
fi
|
||||
|
||||
COMMIT=$(git log -n3 --pretty=format:"%H %ae" | grep -v ' drone@localhost$' | cut -f1 -d\ | head -1)
|
||||
if [ -z "${COMMIT}" ]; then
|
||||
COMMIT=$(git rev-parse HEAD || true)
|
||||
fi
|
||||
if [ -z "$NO_DAPPER" ]; then
|
||||
. ./scripts/git_version.sh
|
||||
fi
|
||||
|
||||
get-module-version(){
|
||||
|
||||
Reference in New Issue
Block a user