2018-09-19 11:49:43 +02:00
|
|
|
#!/bin/bash
|
2019-11-28 12:57:49 +01:00
|
|
|
set -x
|
2018-09-19 11:49:43 +02:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
sudo apt-get update && sudo apt-get install -y libldap2-dev
|
2022-06-08 11:56:14 +02:00
|
|
|
sudo go env -w GO111MODULE=auto
|
|
|
|
go get github.com/docker/distribution
|
|
|
|
go get github.com/docker/libtrust
|
2018-10-12 08:11:35 +02:00
|
|
|
go get golang.org/x/lint/golint
|
2018-09-19 11:49:43 +02:00
|
|
|
go get github.com/GeertJohan/fgt
|
|
|
|
go get github.com/dghubble/sling
|
2022-11-24 11:07:42 +01:00
|
|
|
set +e
|
2018-09-19 11:49:43 +02:00
|
|
|
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
|
2022-11-24 11:07:42 +01:00
|
|
|
set -e
|
2022-05-09 05:19:02 +02:00
|
|
|
# binary will be $(go env GOPATH)/bin/golangci-lint
|
|
|
|
# go install/go get installation aren't guaranteed to work. We recommend using binary installation.
|
2024-03-04 06:55:17 +01:00
|
|
|
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.56.2
|
2019-12-11 12:11:20 +01:00
|
|
|
sudo service postgresql stop || echo no postgresql need to be stopped
|
2018-09-19 11:49:43 +02:00
|
|
|
sleep 2
|
|
|
|
|
2022-05-09 05:19:02 +02:00
|
|
|
sudo rm -rf /data/*
|
2018-09-19 11:49:43 +02:00
|
|
|
sudo -E env "PATH=$PATH" make go_check
|
|
|
|
sudo ./tests/hostcfg.sh
|
|
|
|
sudo ./tests/generateCerts.sh
|
2022-02-10 04:46:58 +01:00
|
|
|
sudo make build -e BUILDTARGET="_build_db _build_registry _build_prepare" -e PULL_BASE_FROM_DOCKERHUB=false -e BUILDBIN=true
|
2020-03-17 10:30:25 +01:00
|
|
|
docker run --rm -v /:/hostfs:z goharbor/prepare:dev gencert -p /etc/harbor/tls/internal
|
2018-11-15 04:09:57 +01:00
|
|
|
sudo MAKEPATH=$(pwd)/make ./make/prepare
|
2018-09-19 11:49:43 +02:00
|
|
|
sudo mkdir -p "/data/redis"
|
|
|
|
sudo mkdir -p /etc/core/ca/ && sudo mv ./tests/ca.crt /etc/core/ca/
|
|
|
|
sudo mkdir -p /harbor && sudo mv ./VERSION /harbor/UIVERSION
|
|
|
|
sudo ./tests/testprepare.sh
|
|
|
|
|
2019-11-28 09:53:05 +01:00
|
|
|
cd tests && sudo ./ldapprepare.sh && cd ..
|
2019-12-11 12:11:20 +01:00
|
|
|
env
|
|
|
|
docker images
|
2018-09-19 11:49:43 +02:00
|
|
|
sudo sed -i 's/__version__/dev/g' ./make/docker-compose.test.yml
|
2019-12-11 12:11:20 +01:00
|
|
|
cat ./make/docker-compose.test.yml
|
2019-10-14 12:25:11 +02:00
|
|
|
sudo mkdir -p ./make/common/config/registry/ && sudo mv ./tests/reg_config.yml ./make/common/config/registry/config.yml
|
2019-12-11 12:11:20 +01:00
|
|
|
sudo mkdir -p /storage && sudo chown 10000:10000 -R /storage
|