Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add build from source script; gitignore and small README #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions traefik/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
traefik*
11 changes: 11 additions & 0 deletions traefik/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Build Script

This build script downloads the latest version of traefik form the
corresponding github releases page. To modify the installation version change
the `version` variable in the `build.sh`.

# Requirements

*Not installed by the build script.*

* golang: 1.20.6
44 changes: 44 additions & 0 deletions traefik/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

version=v2.10.3
name=traefik
appname=${name}-${version}
tarball=${appname}.src.tar.gz

echo "Cleaning artefacts ..."
rm -rf ${tarball} ${appname} ${name}

echo -n "Downloading ${tarball} ... "
wget -q https://github.com/traefik/traefik/releases/download/${version}/${tarball}
echo ""

echo -n "Unpacking traefik ... "
mkdir -p ./$appname
tar xzf $tarball -C ./$appname
echo ""

echo -n "Setting up GO env ... "
export GOPATH=~/go
export PATH=$PATH:$GOPATH/bin
echo ""

#echo -n "Building traefik ... "
#make clean-webui -C ${appname}
#echo ""

pushd ${appname}

echo "${appname}: Running GO get ..."
go get &&
go mod tidy &&
go generate &&
go build -buildmode=pie \
-ldflags "-linkmode 'external' -extldflags '-static-pie'" \
-tags netgo \
./cmd/traefik

popd +0

if test -f ${appname}/${name}; then
ln -s ${appname}/${name} ./${name}
fi