mirror of https://github.com/statping/statping
docker build, static golang builds
parent
e8ae4ab5f3
commit
7a317ba998
|
@ -237,6 +237,9 @@ jobs:
|
||||||
go-version: '1.14.2'
|
go-version: '1.14.2'
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Install Libraries
|
||||||
|
run: sudo apt install libstdc++ gcc g++ libc-dev
|
||||||
|
|
||||||
- name: Setting ENV's
|
- name: Setting ENV's
|
||||||
run: |
|
run: |
|
||||||
echo "::add-path::$(go env GOPATH)/bin"
|
echo "::add-path::$(go env GOPATH)/bin"
|
||||||
|
|
23
Makefile
23
Makefile
|
@ -10,7 +10,6 @@ PUBLISH_BODY='{ "request": { "branch": "master", "message": "Homebrew update ver
|
||||||
TRAVIS_BUILD_CMD='{ "request": { "branch": "master", "message": "Compile master for Statping v${VERSION}", "config": { "merge_mode": "replace", "language": "go", "go": 1.14, "install": true, "sudo": "required", "services": ["docker"], "env": { "secure": "${TRVIS_SECRET}" }, "before_deploy": ["git config --local user.name \"hunterlong\"", "git config --local user.email \"info@socialeck.com\"", "git tag v$(VERSION) --force"], "deploy": [{ "provider": "releases", "api_key": "$$GITHUB_TOKEN", "file_glob": true, "file": "build/*", "skip_cleanup": true, "on": { "branch": "master" } }], "before_script": ["rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install stable", "nvm install 10.17.0", "nvm use 10.17.0 --default", "npm install -g sass yarn cross-env", "pip install --user awscli"], "script": ["make release"], "after_success": [], "after_deploy": ["make post-release"] } } }'
|
TRAVIS_BUILD_CMD='{ "request": { "branch": "master", "message": "Compile master for Statping v${VERSION}", "config": { "merge_mode": "replace", "language": "go", "go": 1.14, "install": true, "sudo": "required", "services": ["docker"], "env": { "secure": "${TRVIS_SECRET}" }, "before_deploy": ["git config --local user.name \"hunterlong\"", "git config --local user.email \"info@socialeck.com\"", "git tag v$(VERSION) --force"], "deploy": [{ "provider": "releases", "api_key": "$$GITHUB_TOKEN", "file_glob": true, "file": "build/*", "skip_cleanup": true, "on": { "branch": "master" } }], "before_script": ["rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install stable", "nvm install 10.17.0", "nvm use 10.17.0 --default", "npm install -g sass yarn cross-env", "pip install --user awscli"], "script": ["make release"], "after_success": [], "after_deploy": ["make post-release"] } } }'
|
||||||
TEST_DIR=$(GOPATH)/src/github.com/statping/statping
|
TEST_DIR=$(GOPATH)/src/github.com/statping/statping
|
||||||
PATH:=/usr/local/bin:$(GOPATH)/bin:$(PATH)
|
PATH:=/usr/local/bin:$(GOPATH)/bin:$(PATH)
|
||||||
OS = freebsd linux openbsd
|
|
||||||
ARCHS = 386 arm amd64 arm64
|
ARCHS = 386 arm amd64 arm64
|
||||||
|
|
||||||
all: clean yarn-install compile docker-base docker-vue build-all
|
all: clean yarn-install compile docker-base docker-vue build-all
|
||||||
|
@ -151,19 +150,25 @@ install-local: build
|
||||||
generate:
|
generate:
|
||||||
cd source && go generate
|
cd source && go generate
|
||||||
|
|
||||||
|
docker-manifest:
|
||||||
|
for arch in $(ARCHS);\
|
||||||
|
do \
|
||||||
|
echo "Docker build v${VERSION} for linux-$$arch"; \
|
||||||
|
docker build -t statping/statping:${VERSION}-$$arch --build-arg VERSION=${VERSION} --build-arg ARCH=$$arch .; \
|
||||||
|
docker push statping/statping:${VERSION}-$$arch
|
||||||
|
done
|
||||||
|
docker manifest create statping/statping:${VERSION}
|
||||||
|
|
||||||
build-linux:
|
build-linux:
|
||||||
mkdir build || true
|
mkdir build || true
|
||||||
export PWD=`pwd`
|
export PWD=`pwd`
|
||||||
@for arch in $(ARCHS);\
|
@for arch in $(ARCHS);\
|
||||||
do \
|
do \
|
||||||
for os in $(OS);\
|
echo "Building v${VERSION} for linux-$$arch"; \
|
||||||
do \
|
mkdir -p releases/statping-linux-$$arch/; \
|
||||||
echo "Building v${VERSION} for $$os-$$arch"; \
|
GO111MODULE="on" GOOS=linux GOARCH=$$arch go build -a -ldflags "-X main.VERSION=${VERSION} -linkmode external -extldflags -static" -o releases/statping-linux-$$arch/statping ${PWD}/cmd || true; \
|
||||||
mkdir -p releases/statping-$$os-$$arch/; \
|
chmod +x releases/statping-linux-$$arch/statping || true; \
|
||||||
GO111MODULE="on" GOOS=$$os GOARCH=$$arch go build -a -ldflags "-X main.VERSION=${VERSION} -linkmode external -extldflags -static" -o releases/statping-$$os-$$arch/statping ${PWD}/cmd || true; \
|
tar -czf releases/statping-linux-$$arch.tar.gz -C releases/statping-linux-$$arch statping || true; \
|
||||||
chmod +x releases/statping-$$os-$$arch/statping || true; \
|
|
||||||
tar -czf releases/statping-$$os-$$arch.tar.gz -C releases/statping-$$os-$$arch statping || true; \
|
|
||||||
done \
|
|
||||||
done
|
done
|
||||||
find ./releases/ -name "*.tar.gz" -type f -size +1M -exec mv "{}" build/ \;
|
find ./releases/ -name "*.tar.gz" -type f -size +1M -exec mv "{}" build/ \;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue