Skip to content

Latest commit

 

History

History
85 lines (63 loc) · 2.2 KB

CONTRIBUTING.md

File metadata and controls

85 lines (63 loc) · 2.2 KB

Contributing

Table of Contents

Set up Local Development Environment

  1. 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.
  2. Install Docker, Docker Compose, and Make.
  3. Get the source code.
    git clone https://github.com/aquasecurity/harbor-scanner-aqua.git
    cd harbor-scanner-aqua
    

Setup Development Environment with Vagrant

  1. Get the source code.
    git clone https://github.com/aquasecurity/harbor-scanner-aqua.git
    cd harbor-scanner-aqua
    
  2. 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 AQUA_REGISTRY_USERNAME=<provide your username>
    export AQUA_REGISTRY_PASSWORD=<provide your password>
    export AQUA_VERSION="6.5"
    export HARBOR_VERSION="v2.4.0"
    
    vagrant up
    

The Harbor UI is accessible at http://localhost:8181 (admin/Harbor12345). The Aqua Management Console is accessible at http://localhost:9181 (administrator/@Aqua12345). Note that you'll be prompted for a valid licence key upon successful login to the Aqua 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

Build Binaries

Run make to build the binary in ./scanner-adapter.

make

To build into a Docker container aquasec/harbor-scanner-aqua:dev.

make docker-build

Run Tests

Run Unit Tests

make test

Run Integration Tests

make test-integration