mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-03 09:09:47 +01:00
70 lines
1.8 KiB
YAML
70 lines
1.8 KiB
YAML
sudo: true
|
|
|
|
language: go
|
|
|
|
go:
|
|
- 1.6.2
|
|
|
|
go_import_path: github.com/vmware/harbor
|
|
|
|
services:
|
|
- docker
|
|
- mysql
|
|
|
|
dist: trusty
|
|
addons:
|
|
apt:
|
|
packages:
|
|
- mysql-server-5.6
|
|
- mysql-client-core-5.6
|
|
- mysql-client-5.6
|
|
|
|
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:
|
|
- ./tests/hostcfg.sh
|
|
- cd Deploy
|
|
- ./prepare
|
|
- cd ..
|
|
|
|
install:
|
|
- sudo apt-get update && sudo apt-get install -y libldap2-dev
|
|
- 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
|
|
- 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
|
|
- go get github.com/dghubble/sling
|
|
- go get github.com/stretchr/testify
|
|
|
|
before_script:
|
|
# create tables and load data
|
|
- mysql < ./Deploy/db/registry.sql -uroot --verbose
|
|
|
|
script:
|
|
- 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
|
|
- go test -v ./tests/apitests
|