2019-12-11 12:11:20 +01:00
|
|
|
name: CI
|
|
|
|
env:
|
|
|
|
POSTGRESQL_HOST: localhost
|
|
|
|
POSTGRESQL_PORT: 5432
|
|
|
|
POSTGRESQL_USR: postgres
|
|
|
|
POSTGRESQL_PWD: root123
|
|
|
|
POSTGRESQL_DATABASE: registry
|
|
|
|
DOCKER_COMPOSE_VERSION: 1.23.0
|
|
|
|
HARBOR_ADMIN: admin
|
|
|
|
HARBOR_ADMIN_PASSWD: Harbor12345
|
|
|
|
CORE_SECRET: tempString
|
|
|
|
KEY_PATH: "/data/secret/keys/secretkey"
|
|
|
|
REDIS_HOST: localhost
|
|
|
|
REG_VERSION: v2.7.1-patch-2819-2553
|
|
|
|
UI_BUILDER_VERSION: 1.6.0
|
|
|
|
|
2020-01-19 11:07:09 +01:00
|
|
|
on:
|
2019-12-11 12:11:20 +01:00
|
|
|
pull_request:
|
|
|
|
push:
|
2020-02-26 18:30:44 +01:00
|
|
|
paths-ignore:
|
|
|
|
- 'docs/**'
|
2019-12-11 12:11:20 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
UTTEST:
|
|
|
|
env:
|
|
|
|
UTTEST: true
|
2020-01-19 11:07:09 +01:00
|
|
|
runs-on:
|
2019-12-11 12:11:20 +01:00
|
|
|
#- self-hosted
|
|
|
|
- ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Set up Go 1.13
|
|
|
|
uses: actions/setup-go@v1
|
|
|
|
with:
|
2020-03-11 05:20:06 +01:00
|
|
|
go-version: 1.13.8
|
2019-12-11 12:11:20 +01:00
|
|
|
id: go
|
|
|
|
- name: setup Docker
|
|
|
|
uses: docker-practice/actions-setup-docker@0.0.1
|
|
|
|
with:
|
|
|
|
docker_version: 18.09
|
|
|
|
docker_channel: stable
|
2020-02-28 18:15:27 +01:00
|
|
|
- uses: actions/checkout@v2
|
2019-12-11 12:11:20 +01:00
|
|
|
with:
|
|
|
|
path: src/github.com/goharbor/harbor
|
|
|
|
- name: setup env
|
|
|
|
run: |
|
2020-02-28 18:15:27 +01:00
|
|
|
cd src/github.com/goharbor/harbor
|
2019-12-11 12:11:20 +01:00
|
|
|
pwd
|
|
|
|
go env
|
2020-02-28 18:15:27 +01:00
|
|
|
echo "::set-env name=GOPATH::$(go env GOPATH):$GITHUB_WORKSPACE"
|
2019-12-11 12:11:20 +01:00
|
|
|
echo "::add-path::$(go env GOPATH)/bin"
|
2020-02-28 18:15:27 +01:00
|
|
|
echo "::set-env name=TOKEN_PRIVATE_KEY_PATH::${GITHUB_WORKSPACE}/src/github.com/goharbor/harbor/tests/private_key.pem"
|
2019-12-11 12:11:20 +01:00
|
|
|
shell: bash
|
|
|
|
- name: before_install
|
|
|
|
run: |
|
|
|
|
set -x
|
2020-02-28 18:15:27 +01:00
|
|
|
cd src/github.com/goharbor/harbor
|
2019-12-11 12:11:20 +01:00
|
|
|
pwd
|
|
|
|
env
|
|
|
|
#sudo apt install -y xvfb
|
|
|
|
#xvfb-run ls
|
|
|
|
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=`hostname -I | awk '{print $1}'`
|
|
|
|
echo '{"insecure-registries" : ["'$IP':5000"]}' | sudo tee /etc/docker/daemon.json
|
|
|
|
echo "::set-env name=IP::$IP"
|
|
|
|
sudo cp ./tests/harbor_ca.crt /usr/local/share/ca-certificates/
|
|
|
|
sudo update-ca-certificates
|
|
|
|
sudo service docker restart
|
|
|
|
- name: install
|
|
|
|
run: |
|
2020-02-28 18:15:27 +01:00
|
|
|
cd src/github.com/goharbor/harbor
|
2019-12-11 12:11:20 +01:00
|
|
|
env
|
2020-03-07 05:16:42 +01:00
|
|
|
bash ./tests/showtime.sh ./tests/ci/ut_install.sh
|
2019-12-11 12:11:20 +01:00
|
|
|
- name: script
|
|
|
|
run: |
|
|
|
|
echo IP: $IP
|
2020-02-28 18:15:27 +01:00
|
|
|
cd src/github.com/goharbor/harbor
|
2020-03-07 05:16:42 +01:00
|
|
|
bash ./tests/showtime.sh ./tests/ci/ut_run.sh $IP
|
2020-01-19 11:07:09 +01:00
|
|
|
- name: Codecov For BackEnd
|
|
|
|
uses: codecov/codecov-action@v1
|
|
|
|
with:
|
2020-02-28 18:15:27 +01:00
|
|
|
file: ./src/github.com/goharbor/harbor/profile.cov
|
2020-04-11 05:39:58 +02:00
|
|
|
flags: unittests
|
2020-01-19 11:07:09 +01:00
|
|
|
|
2019-12-11 12:11:20 +01:00
|
|
|
APITEST_DB:
|
|
|
|
env:
|
|
|
|
APITEST_DB: true
|
|
|
|
runs-on:
|
|
|
|
#- self-hosted
|
|
|
|
- ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Set up Go 1.13
|
|
|
|
uses: actions/setup-go@v1
|
|
|
|
with:
|
2020-03-11 05:20:06 +01:00
|
|
|
go-version: 1.13.8
|
2019-12-11 12:11:20 +01:00
|
|
|
id: go
|
|
|
|
- name: setup Docker
|
|
|
|
uses: docker-practice/actions-setup-docker@0.0.1
|
|
|
|
with:
|
|
|
|
docker_version: 18.09
|
|
|
|
docker_channel: stable
|
2020-02-28 18:15:27 +01:00
|
|
|
- uses: actions/checkout@v2
|
2019-12-11 12:11:20 +01:00
|
|
|
with:
|
|
|
|
path: src/github.com/goharbor/harbor
|
|
|
|
- name: setup env
|
|
|
|
run: |
|
2020-02-28 18:15:27 +01:00
|
|
|
cd src/github.com/goharbor/harbor
|
2019-12-11 12:11:20 +01:00
|
|
|
pwd
|
|
|
|
go env
|
2020-03-07 04:15:19 +01:00
|
|
|
echo "::set-env name=CNAB_PATH::$(go env GOPATH)/src/github.com/docker"
|
2020-03-10 07:55:55 +01:00
|
|
|
echo "::set-env name=GITHUB_TOKEN::${{ secrets.GITHUB_TOKEN }}"
|
2020-02-28 18:15:27 +01:00
|
|
|
echo "::set-env name=GOPATH::$(go env GOPATH):$GITHUB_WORKSPACE"
|
2019-12-11 12:11:20 +01:00
|
|
|
echo "::add-path::$(go env GOPATH)/bin"
|
2020-02-28 18:15:27 +01:00
|
|
|
echo "::set-env name=TOKEN_PRIVATE_KEY_PATH::${GITHUB_WORKSPACE}/src/github.com/goharbor/harbor/tests/private_key.pem"
|
2019-12-11 12:11:20 +01:00
|
|
|
shell: bash
|
|
|
|
- name: before_install
|
|
|
|
run: |
|
|
|
|
set -x
|
2020-02-28 18:15:27 +01:00
|
|
|
cd src/github.com/goharbor/harbor
|
2019-12-11 12:11:20 +01:00
|
|
|
pwd
|
|
|
|
env
|
|
|
|
#sudo apt install -y xvfb
|
|
|
|
#xvfb-run ls
|
|
|
|
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=`hostname -I | awk '{print $1}'`
|
|
|
|
echo '{"insecure-registries" : ["'$IP':5000"]}' | sudo tee /etc/docker/daemon.json
|
|
|
|
echo "::set-env name=IP::$IP"
|
|
|
|
sudo cp ./tests/harbor_ca.crt /usr/local/share/ca-certificates/
|
|
|
|
sudo update-ca-certificates
|
|
|
|
sudo service docker restart
|
2020-03-07 04:15:19 +01:00
|
|
|
wget https://get.helm.sh/helm-v3.1.1-linux-386.tar.gz && tar zxvf helm-v3.1.1-linux-386.tar.gz
|
|
|
|
sudo mv linux-386/helm /usr/local/bin/helm3
|
2020-03-04 09:08:03 +01:00
|
|
|
helm3 plugin install https://github.com/chartmuseum/helm-push
|
2020-03-07 04:15:19 +01:00
|
|
|
mkdir -p $CNAB_PATH && cd $CNAB_PATH && git clone https://github.com/cnabio/cnab-to-oci.git
|
|
|
|
cd cnab-to-oci && git checkout v0.3.0-beta4
|
|
|
|
go list
|
|
|
|
make build
|
|
|
|
sudo mv bin/cnab-to-oci /usr/local/bin
|
2019-12-11 12:11:20 +01:00
|
|
|
- name: install
|
|
|
|
run: |
|
2020-02-28 18:15:27 +01:00
|
|
|
cd src/github.com/goharbor/harbor
|
2019-12-11 12:11:20 +01:00
|
|
|
env
|
2020-03-07 05:16:42 +01:00
|
|
|
bash ./tests/showtime.sh ./tests/ci/api_common_install.sh $IP DB
|
2019-12-11 12:11:20 +01:00
|
|
|
- name: script
|
|
|
|
run: |
|
2020-02-28 18:15:27 +01:00
|
|
|
cd src/github.com/goharbor/harbor
|
2019-12-11 12:11:20 +01:00
|
|
|
echo IP: $IP
|
2020-03-07 05:16:42 +01:00
|
|
|
bash ./tests/showtime.sh ./tests/ci/api_run.sh DB $IP
|
2020-01-19 11:07:09 +01:00
|
|
|
|
2019-12-11 12:11:20 +01:00
|
|
|
APITEST_LDAP:
|
|
|
|
env:
|
|
|
|
APITEST_LDAP: true
|
|
|
|
runs-on:
|
|
|
|
#- self-hosted
|
|
|
|
- ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Set up Go 1.13
|
|
|
|
uses: actions/setup-go@v1
|
|
|
|
with:
|
2020-03-11 05:20:06 +01:00
|
|
|
go-version: 1.13.8
|
2019-12-11 12:11:20 +01:00
|
|
|
id: go
|
|
|
|
- name: setup Docker
|
|
|
|
uses: docker-practice/actions-setup-docker@0.0.1
|
|
|
|
with:
|
|
|
|
docker_version: 18.09
|
|
|
|
docker_channel: stable
|
2020-02-28 18:15:27 +01:00
|
|
|
- uses: actions/checkout@v2
|
2019-12-11 12:11:20 +01:00
|
|
|
with:
|
|
|
|
path: src/github.com/goharbor/harbor
|
|
|
|
- name: setup env
|
|
|
|
run: |
|
2020-02-28 18:15:27 +01:00
|
|
|
cd src/github.com/goharbor/harbor
|
2019-12-11 12:11:20 +01:00
|
|
|
pwd
|
|
|
|
go env
|
2020-02-28 18:15:27 +01:00
|
|
|
echo "::set-env name=GOPATH::$(go env GOPATH):$GITHUB_WORKSPACE"
|
2019-12-11 12:11:20 +01:00
|
|
|
echo "::add-path::$(go env GOPATH)/bin"
|
2020-02-28 18:15:27 +01:00
|
|
|
echo "::set-env name=TOKEN_PRIVATE_KEY_PATH::${GITHUB_WORKSPACE}/src/github.com/goharbor/harbor/tests/private_key.pem"
|
2019-12-11 12:11:20 +01:00
|
|
|
shell: bash
|
|
|
|
- name: before_install
|
|
|
|
run: |
|
|
|
|
set -x
|
2020-02-28 18:15:27 +01:00
|
|
|
cd src/github.com/goharbor/harbor
|
2019-12-11 12:11:20 +01:00
|
|
|
pwd
|
|
|
|
env
|
|
|
|
#sudo apt install -y xvfb
|
|
|
|
#xvfb-run ls
|
|
|
|
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=`hostname -I | awk '{print $1}'`
|
|
|
|
echo '{"insecure-registries" : ["'$IP':5000"]}' | sudo tee /etc/docker/daemon.json
|
|
|
|
echo "::set-env name=IP::$IP"
|
|
|
|
sudo cp ./tests/harbor_ca.crt /usr/local/share/ca-certificates/
|
|
|
|
sudo update-ca-certificates
|
|
|
|
sudo service docker restart
|
|
|
|
- name: install
|
|
|
|
run: |
|
2020-02-28 18:15:27 +01:00
|
|
|
cd src/github.com/goharbor/harbor
|
2019-12-11 12:11:20 +01:00
|
|
|
env
|
2020-03-07 05:16:42 +01:00
|
|
|
bash ./tests/showtime.sh ./tests/ci/api_common_install.sh $IP LDAP
|
2019-12-11 12:11:20 +01:00
|
|
|
- name: script
|
|
|
|
run: |
|
|
|
|
echo IP: $IP
|
2020-02-28 18:15:27 +01:00
|
|
|
cd src/github.com/goharbor/harbor
|
2020-03-07 05:16:42 +01:00
|
|
|
bash ./tests/showtime.sh ./tests/ci/api_run.sh LDAP $IP
|
2019-12-11 12:11:20 +01:00
|
|
|
|
|
|
|
OFFLINE:
|
|
|
|
env:
|
|
|
|
OFFLINE: true
|
|
|
|
runs-on:
|
|
|
|
#- self-hosted
|
|
|
|
- ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Set up Go 1.13
|
|
|
|
uses: actions/setup-go@v1
|
|
|
|
with:
|
2020-03-11 05:20:06 +01:00
|
|
|
go-version: 1.13.8
|
2019-12-11 12:11:20 +01:00
|
|
|
id: go
|
|
|
|
- name: setup Docker
|
|
|
|
uses: docker-practice/actions-setup-docker@0.0.1
|
|
|
|
with:
|
|
|
|
docker_version: 18.09
|
|
|
|
docker_channel: stable
|
2020-02-28 18:15:27 +01:00
|
|
|
- uses: actions/checkout@v2
|
2019-12-11 12:11:20 +01:00
|
|
|
with:
|
|
|
|
path: src/github.com/goharbor/harbor
|
|
|
|
- name: setup env
|
|
|
|
run: |
|
2020-02-28 18:15:27 +01:00
|
|
|
cd src/github.com/goharbor/harbor
|
2019-12-11 12:11:20 +01:00
|
|
|
pwd
|
|
|
|
docker version
|
|
|
|
go env
|
2020-02-28 18:15:27 +01:00
|
|
|
echo "::set-env name=GOPATH::$(go env GOPATH):$GITHUB_WORKSPACE"
|
2019-12-11 12:11:20 +01:00
|
|
|
echo "::add-path::$(go env GOPATH)/bin"
|
2020-02-28 18:15:27 +01:00
|
|
|
echo "::set-env name=TOKEN_PRIVATE_KEY_PATH::${GITHUB_WORKSPACE}/src/github.com/goharbor/harbor/tests/private_key.pem"
|
2019-12-11 12:11:20 +01:00
|
|
|
shell: bash
|
|
|
|
- name: before_install
|
|
|
|
run: |
|
|
|
|
set -x
|
2020-02-28 18:15:27 +01:00
|
|
|
cd src/github.com/goharbor/harbor
|
2019-12-11 12:11:20 +01:00
|
|
|
pwd
|
|
|
|
env
|
|
|
|
#sudo apt install -y xvfb
|
|
|
|
#xvfb-run ls
|
|
|
|
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=`hostname -I | awk '{print $1}'`
|
|
|
|
echo '{"insecure-registries" : ["'$IP':5000"]}' | sudo tee /etc/docker/daemon.json
|
|
|
|
echo "::set-env name=IP::$IP"
|
|
|
|
sudo cp ./tests/harbor_ca.crt /usr/local/share/ca-certificates/
|
|
|
|
sudo update-ca-certificates
|
|
|
|
sudo service docker restart
|
|
|
|
- name: script
|
|
|
|
run: |
|
|
|
|
echo IP: $IP
|
2020-02-28 18:15:27 +01:00
|
|
|
cd src/github.com/goharbor/harbor
|
2020-03-07 05:16:42 +01:00
|
|
|
bash ./tests/showtime.sh ./tests/ci/distro_installer.sh
|
2019-12-11 12:11:20 +01:00
|
|
|
|
|
|
|
UI_UT:
|
|
|
|
env:
|
|
|
|
UI_UT: true
|
|
|
|
runs-on:
|
|
|
|
#- self-hosted
|
|
|
|
- ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: '10.16.2'
|
2020-02-28 18:15:27 +01:00
|
|
|
- uses: actions/checkout@v2
|
2019-12-11 12:11:20 +01:00
|
|
|
with:
|
|
|
|
path: src/github.com/goharbor/harbor
|
|
|
|
- name: script
|
|
|
|
run: |
|
|
|
|
echo IP: $IP
|
2020-02-28 18:15:27 +01:00
|
|
|
cd src/github.com/goharbor/harbor
|
2020-03-07 05:16:42 +01:00
|
|
|
bash ./tests/showtime.sh ./tests/ci/ui_ut_run.sh
|
2020-01-19 11:07:09 +01:00
|
|
|
- name: Codecov For UI
|
2020-04-11 05:39:58 +02:00
|
|
|
uses: codecov/codecov-action@v1
|
2020-01-19 11:07:09 +01:00
|
|
|
with:
|
2020-02-28 18:15:27 +01:00
|
|
|
file: ./src/github.com/goharbor/harbor/src/portal/coverage/lcov.info
|
2020-04-11 05:39:58 +02:00
|
|
|
flags: unittests
|