mirror of https://github.com/rocboss/paopao-ce
parent
fcfcba9fc6
commit
1b349927ce
@ -1,7 +1,7 @@
|
|||||||
.idea
|
.idea
|
||||||
.vscode
|
.vscode
|
||||||
!*.example
|
!*.example
|
||||||
dist/
|
|
||||||
config.yaml
|
config.yaml
|
||||||
*.log
|
*.log
|
||||||
paopao-ce*
|
paopao-ce*
|
||||||
|
release/
|
@ -1,35 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# shellcheck disable=SC2155
|
|
||||||
set -e
|
|
||||||
DIST_PREFIX=${1}
|
|
||||||
DEBUG_MODE=${2}
|
|
||||||
TARGET_DIR="dist"
|
|
||||||
PLATFORMS="darwin/amd64 darwin/arm64 linux/amd64 windows/amd64"
|
|
||||||
|
|
||||||
rm -rf ${TARGET_DIR}
|
|
||||||
mkdir ${TARGET_DIR}
|
|
||||||
|
|
||||||
for pl in ${PLATFORMS}; do
|
|
||||||
export CGO_ENABLED=0
|
|
||||||
export GOOS=$(echo "${pl}" | cut -d'/' -f1)
|
|
||||||
export GOARCH=$(echo "${pl}" | cut -d'/' -f2)
|
|
||||||
export TARGET=${TARGET_DIR}/${DIST_PREFIX}_${GOOS}_${GOARCH}
|
|
||||||
if [ "${GOOS}" == "windows" ]; then
|
|
||||||
export TARGET=${TARGET_DIR}/${DIST_PREFIX}_${GOOS}_${GOARCH}.exe
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "build => ${TARGET}"
|
|
||||||
if [ "${DEBUG_MODE}" == "debug" ]; then
|
|
||||||
go build -trimpath -gcflags "all=-N -l" -o "${TARGET}" -tags "${TAGS}" \
|
|
||||||
-ldflags "-X 'main.version=${BUILD_VERSION}' \
|
|
||||||
-X 'main.buildDate=${BUILD_DATE}' \
|
|
||||||
-X 'main.commitID=${SHA_SHORT}'\
|
|
||||||
-w -s"
|
|
||||||
else
|
|
||||||
go build -trimpath -o "${TARGET}" -tags "${TAGS}" \
|
|
||||||
-ldflags "-X 'main.version=${BUILD_VERSION}' \
|
|
||||||
-X 'main.buildDate=${BUILD_DATE}' \
|
|
||||||
-X 'main.commitID=${SHA_SHORT}'\
|
|
||||||
-w -s"
|
|
||||||
fi
|
|
||||||
done
|
|
@ -0,0 +1 @@
|
|||||||
|
All files in subdirectories are templates, do modifications based on your environment first.
|
@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>Label</key>
|
||||||
|
<string>info.paopao.web</string>
|
||||||
|
<!-- assumes running under 'paopao' account -->
|
||||||
|
<!-- modify below to reflect your settings -->
|
||||||
|
<key>UserName</key>
|
||||||
|
<string>paopao</string>
|
||||||
|
<key>GroupName</key>
|
||||||
|
<string>paopao</string>
|
||||||
|
<key>ProgramArguments</key>
|
||||||
|
<array>
|
||||||
|
<!-- assumes installed in /Users/paopao/app -->
|
||||||
|
<!-- modify below to reflect your settings -->
|
||||||
|
<string>/Users/paopao/app/paopao-ce</string>
|
||||||
|
</array>
|
||||||
|
<key>RunAtLoad</key>
|
||||||
|
<true/>
|
||||||
|
<key>KeepAlive</key>
|
||||||
|
<true/>
|
||||||
|
<!-- assumes Gogs is installed in /Users/git/gogs -->
|
||||||
|
<!-- modify below to reflect your settings -->
|
||||||
|
<key>WorkingDirectory</key>
|
||||||
|
<string>/Users/paopao/app/</string>
|
||||||
|
<key>StandardOutPath</key>
|
||||||
|
<string>/Users/paopao/app/log/stdout.log</string>
|
||||||
|
<key>StandardErrorPath</key>
|
||||||
|
<string>/Users/paopao/app/log/stderr.log</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
@ -0,0 +1,17 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=paopao-ce
|
||||||
|
After=syslog.target
|
||||||
|
After=network.target
|
||||||
|
After=mariadb.service mysqld.service redis.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=paopao
|
||||||
|
Group=paopao
|
||||||
|
WorkingDirectory=/home/paopao/app
|
||||||
|
ExecStart=/home/paopao/app/paopao-ce
|
||||||
|
Restart=always
|
||||||
|
Environment=USER=paopao HOME=/home/paopao
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Reference in new issue