deb-simple/.gitlab-ci.yml

89 lines
1.9 KiB
YAML
Raw Normal View History

2017-06-12 03:08:13 +00:00
image: git.meow.tf:4567/tyler/golang-glide:1.8
2017-06-12 01:04:45 +00:00
2017-09-11 04:03:31 +00:00
before_script:
2017-09-11 04:00:18 +00:00
- export VERSION=`grep "VERSION" src/meow.tf/deb-simple/server.go | head -n 1 | awk '{print $5}' | sed -e 's/^"//' -e 's/"$//' | tr -d '\n'`
2017-09-14 03:45:44 +00:00
- chmod +x packaging/build-package.sh packaging/package-upload.sh
2017-09-12 01:17:24 +00:00
- export GOPATH=`pwd`
2017-09-11 04:00:18 +00:00
2017-09-11 04:02:27 +00:00
stages:
2017-09-12 01:14:47 +00:00
- init
2017-09-11 04:02:27 +00:00
- build
- package
2017-09-12 01:14:47 +00:00
glide-install:
stage: init
2017-06-12 01:04:45 +00:00
script:
- cd $CI_PROJECT_DIR/src/meow.tf/deb-simple
- glide install
- cd $CI_PROJECT_DIR
2017-09-11 04:00:18 +00:00
- mkdir -p build/i386 build/amd64 build/armv7
2017-09-14 04:37:23 +00:00
- tar -zcf cache.tgz src/meow.tf/deb-simple/vendor
2017-09-12 01:22:21 +00:00
cache:
key: "pipeline-$CI_PIPELINE_ID"
2017-09-14 04:23:39 +00:00
policy: push
2017-09-12 01:30:52 +00:00
paths:
2017-09-14 04:37:23 +00:00
- cache.tgz
2017-09-12 01:14:47 +00:00
build-i386:
stage: build
script:
2017-09-14 04:37:23 +00:00
- echo "Extracting vendor files..."
- tar -xf cache.tgz
- echo "Building i386 binary..."
2017-09-12 01:14:47 +00:00
- mkdir -p build/i386
- GOOS=linux GOARCH=386 go build -o build/i386/deb-simple
artifacts:
paths:
2017-09-12 02:35:41 +00:00
- build/i386
2017-09-12 01:22:21 +00:00
cache:
key: "pipeline-$CI_PIPELINE_ID"
policy: pull
2017-09-12 01:30:52 +00:00
paths:
2017-09-14 04:37:23 +00:00
- cache.tgz
2017-09-12 01:14:47 +00:00
build-amd64:
stage: build
script:
2017-09-14 04:37:23 +00:00
- echo "Extracting vendor files..."
- tar -xf cache.tgz
- echo "Building amd64 binary..."
2017-09-12 01:14:47 +00:00
- mkdir -p build/amd64
2017-09-11 02:58:50 +00:00
- go build -o build/amd64/deb-simple
2017-09-11 04:00:18 +00:00
artifacts:
paths:
2017-09-12 02:35:41 +00:00
- build/amd64
2017-09-12 01:22:21 +00:00
cache:
key: "pipeline-$CI_PIPELINE_ID"
policy: pull
2017-09-12 01:30:52 +00:00
paths:
2017-09-14 04:37:23 +00:00
- cache.tgz
2017-09-11 04:00:18 +00:00
2017-09-12 01:14:47 +00:00
build-armv7:
stage: build
script:
2017-09-14 04:37:23 +00:00
- echo "Extracting vendor files..."
- tar -xf cache.tgz
- echo "Building armv7 binary..."
2017-09-12 01:14:47 +00:00
- mkdir -p build/armv7
- GOOS=linux GOARCH=arm GOARM=7 go build -o build/armv7/deb-simple
artifacts:
paths:
2017-09-12 02:35:41 +00:00
- build/armv7
2017-09-12 01:22:21 +00:00
cache:
key: "pipeline-$CI_PIPELINE_ID"
policy: pull
2017-09-12 01:30:52 +00:00
paths:
2017-09-14 04:37:23 +00:00
- cache.tgz
2017-09-12 01:14:47 +00:00
package:
2017-09-11 04:00:18 +00:00
stage: package
2017-09-11 04:05:19 +00:00
image: tystuyfzand/fpm
2017-09-11 04:00:18 +00:00
script:
- ARCH=i386 packaging/build-package.sh
- ARCH=amd64 packaging/build-package.sh
- ARCH=armv7 packaging/build-package.sh
- packaging/package-upload.sh
2017-06-12 03:06:31 +00:00
artifacts:
paths:
- build