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
|
|
|
|
|
|
|
go_import_path: github.com/vmware/harbor
|
|
|
|
|
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
|
|
|
|
HARBOR_ADMIN_PASSWD: Harbor12345
|
2016-07-29 11:37:37 +02:00
|
|
|
UI_SECRET: tempString
|
2016-08-03 11:25:24 +02:00
|
|
|
MAX_JOB_WORKERS: 3
|
2016-09-19 04:30:22 +02:00
|
|
|
AUTH_MODE: db_auth
|
2017-02-08 10:17:33 +01:00
|
|
|
SELF_REGISTRATION: on
|
2017-02-15 08:25:59 +01:00
|
|
|
KEY_PATH: /data/secretkey
|
2018-03-28 08:54:41 +02:00
|
|
|
REDIS_HOST: localhost
|
2016-06-07 06:19:48 +02:00
|
|
|
|
|
|
|
before_install:
|
2016-06-15 06:14:45 +02:00
|
|
|
- sudo ./tests/hostcfg.sh
|
2017-03-20 11:51:20 +01:00
|
|
|
- sudo ./tests/generateCerts.sh
|
2016-10-19 08:32:00 +02:00
|
|
|
- sudo ./make/prepare
|
2018-03-28 08:54:41 +02:00
|
|
|
- sudo mkdir -p "/data/redis"
|
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-09-13 11:41:32 +02:00
|
|
|
- sudo apt-get install -y sqlite3
|
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
|
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
|
2016-08-15 05:30:06 +02:00
|
|
|
|
2016-08-08 10:40:14 +02:00
|
|
|
# - sudo rm /usr/local/bin/docker-compose
|
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
|
2016-06-07 06:19:48 +02:00
|
|
|
- go get github.com/dghubble/sling
|
|
|
|
- go get github.com/stretchr/testify
|
2016-08-04 06:09:40 +02:00
|
|
|
- go get golang.org/x/tools/cmd/cover
|
|
|
|
- go get github.com/mattn/goveralls
|
2016-06-07 06:19:48 +02:00
|
|
|
|
2016-02-29 04:24:52 +01:00
|
|
|
before_script:
|
|
|
|
# create tables and load data
|
2016-10-19 08:32:00 +02:00
|
|
|
# - mysql < ./make/db/registry.sql -uroot --verbose
|
2018-06-01 08:58:43 +02:00
|
|
|
# - sudo chmod 777 /tmp/registry.db
|
2016-02-29 04:24:52 +01:00
|
|
|
|
2016-08-08 10:40:14 +02:00
|
|
|
script:
|
2017-03-30 05:04:09 +02:00
|
|
|
- sudo mkdir -p /etc/ui/ca/
|
|
|
|
- sudo mv ./tests/ca.crt /etc/ui/ca/
|
2017-03-21 12:56:59 +01:00
|
|
|
- sudo mkdir -p /harbor
|
2018-03-21 06:03:49 +01:00
|
|
|
- sudo mv ./VERSION /harbor/UIVERSION
|
2018-04-27 11:27:12 +02:00
|
|
|
- sudo service postgresql stop
|
2018-05-08 09:34:37 +02:00
|
|
|
- sudo make run_clarity_ut CLARITYIMAGE=vmware/harbor-clarity-ui-builder:1.4.1
|
2018-05-04 13:31:45 +02:00
|
|
|
- cat ./src/ui_ng/npm-ut-test-results
|
2016-08-08 10:40:14 +02:00
|
|
|
- sudo ./tests/testprepare.sh
|
2018-06-01 08:58:43 +02:00
|
|
|
- sudo make -f make/photon/Makefile _build_db _build_registry -e VERSIONTAG=dev -e CLAIRDBVERSION=dev -e REGISTRYVERSION=v2.6.2
|
2017-12-09 19:53:12 +01:00
|
|
|
- sudo sed -i 's/__reg_version__/v2.6.2-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
|
2017-04-09 14:16:52 +02:00
|
|
|
- sudo docker-compose -f ./make/docker-compose.test.yml up -d
|
2017-12-05 07:13:01 +01:00
|
|
|
- go list ./... | grep -v -E 'vendor|tests|test' | xargs -L1 fgt golint
|
|
|
|
- go list ./... | grep -v -E 'vendor|tests|test' | xargs -L1 go vet
|
2018-04-27 11:27:12 +02:00
|
|
|
- export POSTGRESQL_HOST=$IP
|
2016-08-31 06:12:22 +02:00
|
|
|
- export REGISTRY_URL=$IP:5000
|
2016-08-08 10:40:14 +02:00
|
|
|
- echo $REGISTRY_URL
|
2017-02-24 11:30:57 +01:00
|
|
|
- ./tests/pushimage.sh
|
|
|
|
- cd tests
|
|
|
|
- sudo ./ldapprepare.sh
|
2017-06-06 11:51:40 +02:00
|
|
|
- sudo ./admiral.sh
|
2017-02-24 11:30:57 +01:00
|
|
|
- cd ..
|
2017-09-04 11:26:28 +02:00
|
|
|
- go test -race -i ./src/ui ./src/adminserver ./src/jobservice
|
2017-04-09 14:16:52 +02:00
|
|
|
- sudo -E env "PATH=$PATH" ./tests/coverage4gotest.sh
|
2016-08-04 06:09:40 +02:00
|
|
|
- goveralls -coverprofile=profile.cov -service=travis-ci
|
2016-10-19 08:32:00 +02:00
|
|
|
- docker-compose -f make/docker-compose.test.yml down
|
2017-11-15 07:49:14 +01:00
|
|
|
- sudo rm -rf /data/config/*
|
|
|
|
- sudo rm -rf /data/database/*
|
2017-03-20 11:51:20 +01:00
|
|
|
- ls /data/cert
|
2018-05-08 09:34:37 +02:00
|
|
|
- sudo make install GOBUILDIMAGE=golang:1.9.2 COMPILETAG=compile_golangimage CLARITYIMAGE=vmware/harbor-clarity-ui-builder:1.4.1 NOTARYFLAG=true CLAIRFLAG=true
|
2017-09-05 07:10:39 +02:00
|
|
|
- sleep 10
|
2017-08-31 16:55:39 +02:00
|
|
|
- docker ps
|
|
|
|
- ./tests/validatecontainers.sh
|
2017-03-22 12:30:20 +01:00
|
|
|
- ./tests/notarytest.sh
|
2017-04-13 05:01:32 +02:00
|
|
|
- ./tests/swaggerchecker.sh
|
2017-03-24 03:12:04 +01:00
|
|
|
- ./tests/startuptest.sh
|
2017-03-24 11:50:11 +01:00
|
|
|
- ./tests/userlogintest.sh ${HARBOR_ADMIN} ${HARBOR_ADMIN_PASSWD}
|
2018-03-28 08:54:41 +02:00
|
|
|
- export REDIS_HOST=$IP
|
2016-06-07 06:19:48 +02:00
|
|
|
|
2016-08-08 10:40:14 +02:00
|
|
|
# - sudo ./tests/testprepare.sh
|
|
|
|
# - go test -v ./tests/apitests
|