2016-06-07 06:19:48 +02:00
|
|
|
sudo: true
|
|
|
|
|
2016-02-29 04:24:52 +01:00
|
|
|
language: go
|
|
|
|
|
|
|
|
go:
|
2018-03-20 04:01:32 +01:00
|
|
|
- 1.9.2
|
2016-02-29 04:24:52 +01:00
|
|
|
|
2018-08-23 09:02:20 +02: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:
|
2018-04-27 11:27:12 +02:00
|
|
|
POSTGRESQL_HOST: localhost
|
|
|
|
POSTGRESQL_PORT: 5432
|
|
|
|
POSTGRESQL_USR: postgres
|
|
|
|
POSTGRESQL_PWD: root123
|
|
|
|
POSTGRESQL_DATABASE: registry
|
2017-11-08 14:22:00 +01:00
|
|
|
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
|
2018-08-24 07:30:07 +02:00
|
|
|
HARBOR_ADMIN_PASSWD: Harbor12345
|
|
|
|
UI_SECRET: tempString
|
2017-02-15 08:25:59 +01:00
|
|
|
KEY_PATH: /data/secretkey
|
2018-03-28 08:54:41 +02:00
|
|
|
REDIS_HOST: localhost
|
2018-08-24 07:30:07 +02:00
|
|
|
REG_VERSION: v2.6.2
|
|
|
|
UI_BUILDER_VERSION: 1.6.0
|
2016-06-07 06:19:48 +02:00
|
|
|
|
2018-09-07 14:25:01 +02:00
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
sources:
|
|
|
|
- google-chrome
|
|
|
|
packages:
|
|
|
|
- google-chrome-stable
|
|
|
|
- google-chrome-beta
|
|
|
|
|
2016-06-07 06:19:48 +02:00
|
|
|
before_install:
|
2018-09-07 14:25:01 +02:00
|
|
|
- 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:
|
2018-08-24 07:30:07 +02:00
|
|
|
- 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
|
2018-04-27 11:27:12 +02:00
|
|
|
- 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
|
2018-08-24 07:30:07 +02:00
|
|
|
- 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
|
2016-08-31 06:12:22 +02:00
|
|
|
- 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
|
2016-06-15 05:02:33 +02:00
|
|
|
- sudo service docker restart
|
2018-08-24 07:30:07 +02:00
|
|
|
- sudo service postgresql stop
|
|
|
|
|
2016-02-29 04:24:52 +01:00
|
|
|
before_script:
|
2018-09-07 14:25:01 +02:00
|
|
|
- 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 ../..
|
2018-08-24 07:30:07 +02:00
|
|
|
- export POSTGRESQL_HOST=$IP
|
|
|
|
- export REGISTRY_URL=$IP:5000
|
|
|
|
- echo $REGISTRY_URL
|
|
|
|
- cd tests && sudo ./ldapprepare.sh && cd ..
|
|
|
|
- sudo ./tests/admiral.sh
|
2018-08-29 12:54:00 +02:00
|
|
|
- sudo make compile_adminserver
|
2018-09-03 11:40:26 +02:00
|
|
|
- sudo make -f make/photon/Makefile _build_adminserver _build_db _build_registry -e VERSIONTAG=dev -e CLAIRDBVERSION=dev -e REGISTRYVERSION=${REG_VERSION}
|
2018-08-24 07:30:07 +02:00
|
|
|
- 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:
|
2018-09-07 14:55:24 +02:00
|
|
|
- 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
|
2018-08-24 07:30:07 +02:00
|
|
|
- make go_check
|
2017-02-24 11:30:57 +01:00
|
|
|
- ./tests/pushimage.sh
|
2017-09-04 11:26:28 +02:00
|
|
|
- go test -race -i ./src/ui ./src/adminserver ./src/jobservice
|
2018-08-23 09:02:20 +02:00
|
|
|
- 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
|