harbor/.travis.yml

96 lines
3.2 KiB
YAML
Raw Normal View History

2016-06-07 06:19:48 +02:00
sudo: true
2016-02-29 04:24:52 +01:00
language: go
go:
- 1.9.2
2016-02-29 04:24:52 +01:00
go_import_path: github.com/goharbor/harbor
2016-02-29 04:24:52 +01:00
2016-06-07 06:19:48 +02:00
services:
- docker
dist: trusty
2016-02-29 04:24:52 +01:00
2016-06-07 06:19:48 +02:00
env:
POSTGRESQL_HOST: localhost
POSTGRESQL_PORT: 5432
POSTGRESQL_USR: postgres
POSTGRESQL_PWD: root123
POSTGRESQL_DATABASE: registry
ADMINSERVER_URL: http://127.0.0.1:8888
2016-06-07 06:19:48 +02:00
DOCKER_COMPOSE_VERSION: 1.7.1
HARBOR_ADMIN: admin
HARBOR_ADMIN_PASSWD: Harbor12345
UI_SECRET: tempString
2017-02-15 08:25:59 +01:00
KEY_PATH: /data/secretkey
REDIS_HOST: localhost
REG_VERSION: v2.6.2
UI_BUILDER_VERSION: 1.6.0
2016-06-07 06:19:48 +02:00
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
- google-chrome-beta
2016-06-07 06:19:48 +02:00
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sudo ./tests/hostcfg.sh
- sudo ./tests/generateCerts.sh
- sudo ./make/prepare
- sudo mkdir -p "/data/redis"
- sudo mkdir -p /etc/ui/ca/ && sudo mv ./tests/ca.crt /etc/ui/ca/
- sudo mkdir -p /harbor && sudo mv ./VERSION /harbor/UIVERSION
- sudo ./tests/testprepare.sh
2016-02-29 04:24:52 +01:00
install:
- sudo apt-get update && sudo apt-get install -y libldap2-dev
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/lib/pq
2016-02-29 04:24:52 +01:00
- go get github.com/golang/lint/golint
- go get github.com/GeertJohan/fgt
- go get github.com/dghubble/sling
- go get github.com/stretchr/testify
- go get golang.org/x/tools/cmd/cover
- go get github.com/mattn/goveralls
- go get -u github.com/client9/misspell/cmd/misspell
2016-06-07 06:19:48 +02:00
- 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
- IP=`ip addr s eth0 |grep "inet "|awk '{print $2}' |awk -F "/" '{print $1}'`
- sudo sed -i '$a DOCKER_OPTS=\"--insecure-registry '$IP':5000\"' /etc/default/docker
- sudo service docker restart
- sudo service postgresql stop
2016-02-29 04:24:52 +01:00
before_script:
- cd src/portal
- npm install -g -q --no-progress angular-cli
- npm install -g -q --no-progress karma
- npm install -q --no-progress
- npm run build_lib && npm run link_lib && cd ../..
- export POSTGRESQL_HOST=$IP
- export REGISTRY_URL=$IP:5000
- echo $REGISTRY_URL
- cd tests && sudo ./ldapprepare.sh && cd ..
- sudo ./tests/admiral.sh
- sudo make compile_adminserver
- sudo make -f make/photon/Makefile _build_adminserver _build_db _build_registry -e VERSIONTAG=dev -e CLAIRDBVERSION=dev -e REGISTRYVERSION=${REG_VERSION}
- sudo sed -i 's/__reg_version__/${REG_VERSION}-dev/g' ./make/docker-compose.test.yml
- sudo sed -i 's/__version__/dev/g' ./make/docker-compose.test.yml
- sudo mkdir -p ./make/common/config/registry/ && sudo mv ./tests/reg_config.yml ./make/common/config/registry/config.yml
2016-02-29 04:24:52 +01:00
2016-08-08 10:40:14 +02:00
script:
- cd src/portal && npm run lint && npm run lint:lib && npm run test && cd ../..
2017-04-09 14:16:52 +02:00
- sudo docker-compose -f ./make/docker-compose.test.yml up -d
- make go_check
- ./tests/pushimage.sh
2017-09-04 11:26:28 +02:00
- go test -race -i ./src/ui ./src/adminserver ./src/jobservice
- sudo -E env "PATH=$PATH" "POSTGRES_MIGRATION_SCRIPTS_PATH=/home/travis/gopath/src/github.com/goharbor/harbor/make/migrations/postgresql/" ./tests/coverage4gotest.sh
2016-08-04 06:09:40 +02:00
- goveralls -coverprofile=profile.cov -service=travis-ci