Skip to content

Commit f7762da

Browse files
authored
Build binary ourselves (#3303)
1 parent 67bb2b7 commit f7762da

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

ct/gomft.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ function update_script() {
4040
wget -q "https://github.com/StarFleetCPTN/GoMFT/archive/refs/tags/v${RELEASE}.tar.gz" -O $temp_file
4141
tar -xzf $temp_file
4242
cp -rf GoMFT-${RELEASE}/* /opt/gomft
43+
cd /opt/gomft
44+
$STD go mod download
45+
$STD go build -o gomft
4346
$STD $HOME/go/bin/templ generate
44-
wget -q "https://github.com/StarFleetCPTN/GoMFT/releases/download/v${RELEASE}/gomft-v${RELEASE}-linux-amd64" -O /opt/gomft/gomft
4547
chmod +x /opt/gomft/gomft
4648
echo "${RELEASE}" >/opt/${APP}_version.txt
4749
msg_ok "Updated $APP to ${RELEASE}"

install/gomft-install.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,17 @@ set -o pipefail
3535
msg_ok "Setup Golang"
3636

3737
msg_info "Setup ${APPLICATION}"
38-
temp_file2=$(mktemp)
38+
temp_file=$(mktemp)
3939
RELEASE=$(curl -s https://api.github.com/repos/StarFleetCPTN/GoMFT/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
40-
wget -q "https://github.com/StarFleetCPTN/GoMFT/archive/refs/tags/v${RELEASE}.tar.gz" -O $temp_file2
41-
tar -xzf $temp_file2
40+
wget -q "https://github.com/StarFleetCPTN/GoMFT/archive/refs/tags/v${RELEASE}.tar.gz" -O $temp_file
41+
tar -xzf $temp_file
4242
mv GoMFT-${RELEASE}/ /opt/gomft
4343
cd /opt/gomft
44+
$STD go mod download
45+
$STD go build -o gomft
46+
chmod +x gomft
4447
$STD go install github.com/a-h/templ/cmd/templ@latest
45-
wget -q "https://github.com/StarFleetCPTN/GoMFT/releases/download/v${RELEASE}/gomft-v${RELEASE}-linux-amd64" -O gomft
4648
$STD $HOME/go/bin/templ generate
47-
chmod +x gomft
4849
JWT_SECRET_KEY=$(openssl rand -base64 24 | tr -d '/+=')
4950

5051
cat <<EOF >/opt/gomft/.env
@@ -93,7 +94,7 @@ motd_ssh
9394
customize
9495

9596
msg_info "Cleaning up"
96-
rm -f $temp_file $temp_file2
97+
rm -f $temp_file
9798
$STD apt-get -y autoremove
9899
$STD apt-get -y autoclean
99100
msg_ok "Cleaned"

0 commit comments

Comments
 (0)