version control and snapcraft

pull/109/head
Hunter Long 2018-11-28 20:47:35 -08:00
parent 117d0e50c5
commit 24b2f4303c
5 changed files with 39 additions and 10 deletions

4
.gitignore vendored
View File

@ -1,4 +1,8 @@
.idea
snap
prime
stage
parts
core/rice-box.go
config.yml
statup.db

View File

@ -25,6 +25,7 @@ services:
env:
global:
- PATH=/snap/bin:$PATH
- DB_HOST=localhost
- DB_USER=travis
- DB_PASS=
@ -39,6 +40,8 @@ before_deploy:
after_deploy:
- if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" = "false" ]]; then make publish-homebrew; fi
- snapcraft login --with "$SNAP_TOKEN"
- if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" = "false" ]]; then make snapcraft; fi
deploy:
- provider: releases
@ -60,10 +63,10 @@ branches:
before_install:
- curl -L -s https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 -o $GOPATH/bin/dep
- chmod +x $GOPATH/bin/dep
- npm install -g sass
- npm install -g newman
install:
- npm install -g sass
- npm install -g newman
- make dev-deps
- make dep
- make install
@ -79,3 +82,5 @@ script:
after_success:
- if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" = "false" ]]; then make travis-build; fi
- if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" = "false" ]]; then make snapcraft; fi
- sudo snap install snapcraft --classic

View File

@ -229,10 +229,12 @@ clean:
rm -rf source/{logs,assets,plugins,statup.db,config.yml,.sass-cache,*.log}
rm -rf types/{logs,assets,plugins,statup.db,config.yml,.sass-cache,*.log}
rm -rf utils/{logs,assets,plugins,statup.db,config.yml,.sass-cache,*.log}
rm -rf {parts,prime,snap,stage}
rm -rf dev/test/cypress/videos
rm -f coverage.* sass
rm -f source/rice-box.go
rm -f *.db-journal
rm -rf *.snap
find . -name "*.out" -type f -delete
find . -name "*.cpu" -type f -delete
find . -name "*.mem" -type f -delete
@ -240,7 +242,7 @@ clean:
# tag version using git
tag:
git tag "v${VERSION}" --force
git tag v${VERSION} --force
# compress built binaries into tar.gz and zip formats
compress:
@ -282,10 +284,26 @@ travis-build:
curl -s -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "Travis-API-Version: 3" -H "Authorization: token $(TRAVIS_API)" -d $(TRAVIS_BUILD_CMD) https://api.travis-ci.com/repo/hunterlong%2Fstatup/requests
curl -H "Content-Type: application/json" --data '{"docker_tag": "latest"}' -X POST $(DOCKER)
snapcraft:
snapcraft clean statup -s pull && snapcraft --target-arch=amd64
snapcraft clean statup -s pull && snapcraft --target-arch=arm64
snapcraft clean statup -s pull && snapcraft --target-arch=i386
snapcraft: snapcraft-build snapcraft-release
snapcraft-build:
PWD=$(shell pwd)
cp build/$(BINARY_NAME)-linux-x64.tar.gz build/$(BINARY_NAME)-linux.tar.gz
snapcraft clean statup -s pull
docker run --rm -v ${PWD}:/build -w /build --env VERSION=${VERSION} snapcore/snapcraft bash -c "apt update && snapcraft --target-arch=amd64"
cp build/$(BINARY_NAME)-linux-x32.tar.gz build/$(BINARY_NAME)-linux.tar.gz
snapcraft clean statup -s pull
docker run --rm -v ${PWD}:/build -w /build --env VERSION=${VERSION} snapcore/snapcraft bash -c "apt update && snapcraft --target-arch=i386"
cp build/$(BINARY_NAME)-linux-arm64.tar.gz build/$(BINARY_NAME)-linux.tar.gz
snapcraft clean statup -s pull
docker run --rm -v ${PWD}:/build -w /build --env VERSION=${VERSION} snapcore/snapcraft bash -c "apt update && snapcraft --target-arch=arm64"
cp build/$(BINARY_NAME)-linux-arm7.tar.gz build/$(BINARY_NAME)-linux.tar.gz
snapcraft clean statup -s pull
docker run --rm -v ${PWD}:/build -w /build --env VERSION=${VERSION} snapcore/snapcraft bash -c "apt update && snapcraft --target-arch=armhf"
rm -f build/$(BINARY_NAME)-linux.tar.gz
snapcraft-release:
snapcraft push *.snap --release edge
# install xgo and pull the xgo docker image
xgo-install: clean

View File

@ -16,10 +16,12 @@ grade: stable
parts:
statup:
plugin: dump
source: https://github.com/hunterlong/statup/releases/download/latest/statup-linux-x64.tar.gz
source: ./build/statup-linux.tar.gz
apps:
statup:
command: statup
plugs:
- home
- home
- network-bind
- network

View File

@ -1 +1 @@
0.79.91
0.79.92