- Set up Local Development Environment
- Setup Development Environment with Vagrant
- Build Binaries
- Run Tests
- The project requires Go 1.15 or later. We also assume that you're familiar with Go's GOPATH workspace convention, and have the appropriate environment variables set.
- Install Docker, Docker Compose, and Make.
- Get the source code.
git clone https://github.com/khulnasoft/harbor-scanner-khulnasoft.git cd harbor-scanner-khulnasoft
- Get the source code.
git clone https://github.com/khulnasoft/harbor-scanner-khulnasoft.git cd harbor-scanner-khulnasoft
- Create and configure a guest development machine, which is based on Ubuntu 20.4.3 LTS and has Go, Docker, Docker Compose,
Make, and Harbor v2.4.0 preinstalled. Harbor is installed in the
/opt/harbor
directory.export KHULNASOFT_REGISTRY_USERNAME=<provide your username> export KHULNASOFT_REGISTRY_PASSWORD=<provide your password> export KHULNASOFT_VERSION="6.5" export HARBOR_VERSION="v2.4.0" vagrant up
The Harbor UI is accessible at http://localhost:8181 (admin/Harbor12345). The Khulnasoft Management Console is accessible at http://localhost:9181 (administrator/@Khulnasoft12345). Note that you'll be prompted for a valid licence key upon successful login to the Khulnasoft Management Console.
To SSH into a running Vagrant machine.
vagrant ssh
The /vagrant
directory in the development machine is shared between project (host) and guest.
vagrant@ubuntu-focal:~$ cd /vagrant
Run make
to build the binary in ./scanner-adapter
.
make
To build into a Docker container khulnasoft/harbor-scanner-khulnasoft:dev
.
make docker-build
make test
make test-integration