2016-06-07 06:19:48 +02:00
|
|
|
sudo: true
|
|
|
|
|
2016-02-29 04:24:52 +01:00
|
|
|
language: go
|
|
|
|
|
|
|
|
go:
|
2016-05-04 08:25:54 +02:00
|
|
|
- 1.6.2
|
2016-02-29 04:24:52 +01:00
|
|
|
|
|
|
|
go_import_path: github.com/vmware/harbor
|
|
|
|
|
2016-06-07 06:19:48 +02:00
|
|
|
services:
|
|
|
|
- docker
|
|
|
|
- mysql
|
|
|
|
|
|
|
|
dist: trusty
|
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- mysql-server-5.6
|
|
|
|
- mysql-client-core-5.6
|
|
|
|
- mysql-client-5.6
|
2016-02-29 04:24:52 +01:00
|
|
|
|
2016-06-07 06:19:48 +02:00
|
|
|
env:
|
|
|
|
DB_HOST: 127.0.0.1
|
|
|
|
DB_PORT: 3306
|
|
|
|
DB_USR: root
|
|
|
|
DB_PWD:
|
|
|
|
DOCKER_COMPOSE_VERSION: 1.7.1
|
|
|
|
HARBOR_ADMIN: admin
|
|
|
|
HARBOR_ADMIN_PASSWD: Harbor12345
|
|
|
|
|
|
|
|
before_install:
|
2016-06-15 06:14:45 +02:00
|
|
|
- sudo ./tests/hostcfg.sh
|
2016-06-07 06:19:48 +02:00
|
|
|
- cd Deploy
|
2016-06-15 06:14:45 +02:00
|
|
|
- sudo ./prepare
|
2016-06-07 06:19:48 +02:00
|
|
|
- cd ..
|
2016-02-29 04:24:52 +01:00
|
|
|
|
|
|
|
install:
|
2016-06-01 06:57:10 +02:00
|
|
|
- sudo apt-get update && sudo apt-get install -y libldap2-dev
|
2016-06-14 07:04:31 +02:00
|
|
|
# - sudo apt-get remove -y mysql-common mysql-server-5.5 mysql-server-core-5.5 mysql-client-5.5 mysql-client-core-5.5
|
|
|
|
# - sudo apt-get autoremove -y
|
|
|
|
# - sudo apt-get install -y libaio1
|
|
|
|
# - wget -O mysql-5.6.14.deb http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.14-debian6.0-x86_64.deb/from/http://cdn.mysql.com/
|
|
|
|
# - sudo dpkg -i mysql-5.6.14.deb
|
|
|
|
# - sudo cp /opt/mysql/server-5.6/support-files/mysql.server /etc/init.d/mysql.server
|
|
|
|
# - sudo ln -s /opt/mysql/server-5.6/bin/* /usr/bin/
|
|
|
|
# - sudo sed -i'' 's/table_cache/table_open_cache/' /etc/mysql/my.cnf
|
|
|
|
# - sudo sed -i'' 's/log_slow_queries/slow_query_log/' /etc/mysql/my.cnf
|
|
|
|
# - sudo sed -i'' 's/basedir[^=]\+=.*$/basedir = \/opt\/mysql\/server-5.6/' /etc/mysql/my.cnf
|
|
|
|
# - sudo /etc/init.d/mysql.server start
|
|
|
|
# - mysql --version
|
2016-02-29 04:24:52 +01:00
|
|
|
- go get -d github.com/docker/distribution
|
|
|
|
- go get -d github.com/docker/libtrust
|
|
|
|
- go get -d github.com/go-sql-driver/mysql
|
|
|
|
- go get github.com/golang/lint/golint
|
|
|
|
- go get github.com/GeertJohan/fgt
|
2016-06-07 06:19:48 +02:00
|
|
|
- sudo apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" docker-engine=1.11.1-0~trusty
|
|
|
|
- sudo rm /usr/local/bin/docker-compose
|
|
|
|
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
|
|
|
|
- chmod +x docker-compose
|
|
|
|
- sudo mv docker-compose /usr/local/bin
|
2016-06-15 05:02:33 +02:00
|
|
|
- sudo sed -i '$a DOCKER_OPTS=\"$DOCKER_OPTS --insecure-registry 127.0.0.1\"' /etc/default/docker
|
|
|
|
- sudo service docker restart
|
2016-06-07 06:19:48 +02:00
|
|
|
- go get github.com/dghubble/sling
|
|
|
|
- go get github.com/stretchr/testify
|
|
|
|
|
2016-02-29 04:24:52 +01:00
|
|
|
before_script:
|
|
|
|
# create tables and load data
|
|
|
|
- mysql < ./Deploy/db/registry.sql -uroot --verbose
|
|
|
|
|
|
|
|
script:
|
2016-06-07 06:19:48 +02:00
|
|
|
- go list ./... | grep -v 'tests' | grep -v /vendor/ | xargs -L1 fgt golint
|
|
|
|
- go list ./... | grep -v 'tests' | grep -v 'vendor' | xargs -L1 go vet
|
|
|
|
- go list ./... | grep -v 'tests' | grep -v 'vendor' | xargs -L1 go test -v
|
|
|
|
|
|
|
|
- docker-compose -f Deploy/docker-compose.yml up -d
|
|
|
|
|
|
|
|
- docker ps
|
|
|
|
- go run tests/startuptest.go http://localhost/
|
|
|
|
- go run tests/userlogintest.go -name ${HARBOR_ADMIN} -passwd ${HARBOR_ADMIN_PASSWD}
|
|
|
|
|
|
|
|
|
|
|
|
# test for API
|
2016-06-15 05:02:33 +02:00
|
|
|
- sudo ./tests/testprepare.sh
|
2016-06-07 06:19:48 +02:00
|
|
|
- go test -v ./tests/apitests
|