Skip to content
Permalink
Browse files

use dep to manage vendor (#249)

  • Loading branch information...
siddontang committed Apr 6, 2018
1 parent 0df3256 commit 3f973a69cc8d23e303280437c9cda9603e9b3647
Showing 484 changed files with 37,521 additions and 85 deletions.
@@ -1,29 +1,30 @@
language: go

go:
- 1.7
- 1.8
- 1.9
- "1.9"
- "1.10"

dist: trusty
sudo: required
addons:
apt:
sources:
- mysql-5.7-trusty
packages:
- mysql-server-5.6
- mysql-client-core-5.6
- mysql-client-5.6
- mysql-server
- mysql-client

before_install:
- sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
- sudo mysql_upgrade

before_script:
# stop mysql and use row-based format binlog
- "sudo /etc/init.d/mysql stop || true"
- "sudo service mysql stop || true"
- "echo '[mysqld]' | sudo tee /etc/mysql/conf.d/replication.cnf"
- "echo 'server-id=1' | sudo tee -a /etc/mysql/conf.d/replication.cnf"
- "echo 'log-bin=mysql' | sudo tee -a /etc/mysql/conf.d/replication.cnf"
- "echo 'log-bin=mysql' | sudo tee -a /etc/mysql/conf.d/replication.cnf"
- "echo 'binlog-format = row' | sudo tee -a /etc/mysql/conf.d/replication.cnf"

# Start mysql (avoid errors to have logs)
- "sudo /etc/init.d/mysql start || true"
- "sudo service mysql start || true"
- "sudo tail -1000 /var/log/syslog"

- mysql -e "CREATE DATABASE IF NOT EXISTS test;" -uroot

Some generated files are not rendered by default. Learn more.

@@ -0,0 +1,58 @@
# Gopkg.toml example
#
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true


[[constraint]]
name = "github.com/BurntSushi/toml"
version = "0.3.0"

[[constraint]]
name = "github.com/go-sql-driver/mysql"
version = "1.3.0"

[[constraint]]
branch = "master"
name = "github.com/juju/errors"

[[constraint]]
name = "github.com/satori/go.uuid"
version = "1.1.0"

[[constraint]]
name = "github.com/shopspring/decimal"
version = "1.0.0"

[[constraint]]
branch = "master"
name = "github.com/siddontang/go"

[[constraint]]
name = "github.com/sirupsen/logrus"
version = "1.0.3"

[prune]
go-tests = true
unused-packages = true
@@ -1,29 +1,14 @@
all: build

build:
rm -rf vendor && ln -s _vendor/vendor vendor
go build -o bin/go-mysqlbinlog cmd/go-mysqlbinlog/main.go
go build -o bin/go-mysqldump cmd/go-mysqldump/main.go
go build -o bin/go-canal cmd/go-canal/main.go
go build -o bin/go-binlogparser cmd/go-binlogparser/main.go
rm -rf vendor


test:
rm -rf vendor && ln -s _vendor/vendor vendor
go test --race -timeout 2m ./...
rm -rf vendor

clean:
go clean -i ./...
@rm -rf ./bin

update_vendor:
which glide >/dev/null || curl https://glide.sh/get | sh
which glide-vc || go get -v -u github.com/sgotti/glide-vc
rm -r vendor && mv _vendor/vendor vendor || true
rm -rf _vendor
glide update --strip-vendor
@echo "removing test files"
glide-vc --only-code --no-tests --use-lock-file
mkdir -p _vendor
mv vendor _vendor/vendor
@rm -rf ./bin
@@ -0,0 +1,6 @@
find vendor \( -type f -or -type l \) -not -name "*.go" -not -name "LICENSE" -not -name "*.s" -not -name "PATENTS" -not -name "*.h" -not -name "*.c" | xargs -I {} rm {}
# delete all test files
find vendor -type f -name "*_generated.go" | xargs -I {} rm {}
find vendor -type f -name "*_test.go" | xargs -I {} rm {}
find vendor -type d -name "_vendor" | xargs -I {} rm -rf {}
find vendor -type d -empty | xargs -I {} rm -rf {}

This file was deleted.

This file was deleted.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

File renamed without changes.

Some generated files are not rendered by default. Learn more.

0 comments on commit 3f973a6

Please sign in to comment.
You can’t perform that action at this time.