2018-09-19 09:49:43 +00:00
#!/bin/bash
2019-11-28 11:57:49 +00:00
set -x
2018-09-19 09:49:43 +00:00
set +e
sudo rm -fr /data/*
sudo mkdir -p /data
2019-12-11 11:11:20 +00:00
DIR = " $( cd " $( dirname " $0 " ) " && pwd ) "
2018-09-19 09:49:43 +00:00
set -e
2019-11-28 11:57:49 +00:00
if [ -z " $1 " ] ; then echo no ip specified; exit 1; fi
2018-09-19 09:49:43 +00:00
# prepare cert ...
2019-11-28 11:57:49 +00:00
sudo ./tests/generateCerts.sh $1
2019-08-09 02:50:06 +00:00
sudo mkdir -p /etc/docker/certs.d/$1 && sudo cp ./tests/harbor_ca.crt /etc/docker/certs.d/$1 / && rm -rf ~/.docker/ && mkdir -p ~/.docker/tls/$1 :4443/ && sudo cp ./tests/harbor_ca.crt ~/.docker/tls/$1 :4443/
2018-09-19 09:49:43 +00:00
2019-04-02 12:08:26 +00:00
sudo ./tests/hostcfg.sh
2018-09-19 09:49:43 +00:00
if [ " $2 " = 'LDAP' ] ; then
cd tests && sudo ./ldapprepare.sh && cd ..
fi
2018-12-03 09:05:06 +00:00
# prepare a chart file for API_DB test...
2019-12-11 11:11:20 +00:00
sudo curl -o $DIR /../../tests/apitests/python/mariadb-4.3.1.tgz https://storage.googleapis.com/harbor-builds/bin/charts/mariadb-4.3.1.tgz
2018-12-03 09:05:06 +00:00
2020-08-17 06:51:18 +00:00
sudo wget https://bootstrap.pypa.io/get-pip.py && sudo python ./get-pip.py && sudo pip install --ignore-installed urllib3 chardet requests && sudo pip install robotframework = = 3.2.1 robotframework-httplibrary requests --upgrade
2018-09-19 09:49:43 +00:00
sudo make swagger_client
2020-09-01 10:48:56 +00:00
#TODO: Swagger python package used to installed into dist-packages, but it's changed into site-packages all in a sudden, we havn't found the root cause.
# so current workround is to copy swagger packages from site-packages to dist-packages.
2020-09-03 03:42:46 +00:00
package_dir = /usr/lib/python3.7/site-packages
2020-09-03 12:41:55 +00:00
if [ -d $package_dir ] && [ $( find $package_dir -type f -name "*client*.egg" | wc -l) -gt 0 ] ; then
sudo cp -rf ${ package_dir } /* /usr/local/lib/python3.7/dist-packages
2020-09-03 03:42:46 +00:00
fi
2020-09-01 10:48:56 +00:00
2020-03-10 06:55:55 +00:00
if [ $GITHUB_TOKEN ] ;
then
sed " s/# github_token: xxx/github_token: $GITHUB_TOKEN / " -i make/harbor.yml
fi
2020-09-01 10:48:56 +00:00
2020-08-18 06:11:52 +00:00
sudo make build_base_docker compile build prepare COMPILETAG = compile_golangimage GOBUILDTAGS = "include_oss include_gcs" NOTARYFLAG = true CLAIRFLAG = true TRIVYFLAG = true CHARTFLAG = true GEN_TLS = true
2020-07-22 03:09:01 +00:00
# set the debugging env
echo "GC_TIME_WINDOW_HOURS=0" | sudo tee -a ./make/common/config/core/env
sudo make start
2020-04-20 08:00:08 +00:00
# waiting 5 minutes to start
for ( ( i = 1; i<= 30; i++) ) ; do
echo $i waiting 10 seconds...
sleep 10
curl -k -L -f 127.0.0.1/api/v2.0/systeminfo && break
2020-06-15 16:20:18 +00:00
docker ps
2020-05-22 04:06:25 +00:00
done