Git Product home page Git Product logo

build-info's Introduction

Build status

Overview

Build Info is Artifactory's open integration layer for the CI servers and build tools. The build information is sent to Artifactory in json format.

Building and testing the sources

  • The code is built using Gradle and includes integration tests.
  • It must run using JDK 8 and Gradle 5.6.2. If you are using different gradle version you can use the provided gradle wrapper.
  • In order to run tests the following environment variables must be set:
export BITESTS_ARTIFACTORY_URL='http://localhost:8081/artifactory'
export BITESTS_ARTIFACTORY_USERNAME=admin
export BITESTS_ARTIFACTORY_PASSWORD=password
export BITESTS_ARTIFACTORY_PIP_ENV=/Users/user/venv-test/bin
  • Before running the tests, please make sure you have a generic repository named tests in Artifactory.

Building

When running the following commands to build the code, the entire testing suite is also executed. See the Testing section for configuration instructions prior to running the tests.

To build the code using the gradle wrapper in Unix run:

> ./gradlew clean build

To build the code using the gradle wrapper in Windows run:

> gradlew clean build

To build the code using the environment gradle run:

> gradle clean build

To build the code without running the tests, add to the "clean build" command the "-x test" option, for example:

> ./gradlew clean build -x test

Testing

To run all tests:

> ./gradlew clean test

Extractor tests

> ./gradlew clean build-info-api:test build-info-client:test build-info-extractor:test build-info-vcs:test

Maven tests

> ./gradlew clean build-info-extractor-maven3:test

Gradle tests

> ./gradlew clean build-info-extractor-gradle:test

Npm tests

  • Add npm executable to the system search path (PATH environment variable).
> ./gradlew clean build-info-extractor-npm:test

Go tests

  • Add Go executable to the system search path (PATH environment variable).
> ./gradlew clean build-info-extractor-go:test

Pip tests

  • Add Python and pip executables to the system search path (PATH environment variable).
  • Pip tests must run inside a clean pip-environment. Create a virtual environment and provide its path using the 'BITESTS_ARTIFACTORY_PIP_ENV' variable. When running on a Windows machine, provide the path to the 'Scripts' directory. When running on a unix machine, provide the path to the 'bin' directory.
> python -m venv buildinfo-tests-env
> export BITESTS_ARTIFACTORY_PIP_ENV=/Users/user/buildinfo-tests-env/bin
> ./gradlew clean build-info-extractor-pip:test

NuGet tests

  • Add Nuget & Dotnet executable to the system search path (PATH environment variable).
> ./gradlew clean build-info-extractor-nuget:test

Docker tests

  • Docker tests run only on Linux/mac.
  • In addition to the general environment variables required for running the tests, you must set the following environment variables, required for the docker tests:
 export BITESTS_ARTIFACTORY_DOCKER_LOCAL_DOMAIN=localhost:8081/build-info-tests-docker-local
 export BITESTS_ARTIFACTORY_DOCKER_REMOTE_DOMAIN=localhost:8081/build-info-tests-docker-remote
 export BITESTS_ARTIFACTORY_DOCKER_VIRTUAL_DOMAIN=localhost:8081/build-info-tests-docker-virtual
 export BITESTS_ARTIFACTORY_DOCKER_LOCAL_REPO=build-info-tests-docker-local
 export BITESTS_ARTIFACTORY_DOCKER_REMOTE_REPO=build-info-tests-docker-remote
 export BITESTS_ARTIFACTORY_DOCKER_VIRTUAL_REPO=build-info-tests-docker-virtual
 export BITESTS_ARTIFACTORY_DOCKER_HOST=tcp://127.0.0.1:1234
  • For OSX agents, run a Socat container:
docker run -d -v /var/run/docker.sock:/var/run/docker.sock -p 127.0.0.1:1234:1234 bobrik/socat TCP-LISTEN:1234,fork UNIX-CONNECT:/var/run/docker.sock
> ./gradlew clean build-info-extractor-docker:test
  • Before running the tests, please make sure you have a local docker repository named build-info-tests-docker in Artifactory.

Testing on Artifactory OSS

When testing with an instance of Artifactory OSS, only supported tests are for the build-info-gradle-extractor.

On Artifactory pro, the tests infrastructure will create the test repositories by REST API. To run the tests on Artifactory OSS, you should create the Gradle repositories by yourself. To run Gradle tests on Artifactory OSS:

  • Start Artifactory on docker container:
> docker run --name artifactory -d -p 8081:8081 -p 8082:8082 docker.bintray.io/jfrog/artifactory-oss:latest
  • With your web browser, go to Artifactory UI: http://127.0.0.1:8081/artifactory
  • Create 3 Gradle repositories:
    • Local repository: build-info-tests-gradle-local
    • Remote repository to jcenter: build-info-tests-gradle-remote
    • Virtual repository containing both the remote and local: build-info-tests-gradle-virtual
  • Run tests ./gradlew build-info-extractor-gradle:test

More about build-info

Read more about build-info in the Build Integration documentation.

build-info's People

Contributors

alexeivainshtein avatar arothian avatar asaf-federman avatar barakhc avatar barbelity avatar dependabot[bot] avatar dimanevelev avatar elig avatar eranbl avatar evgeny-goldin avatar evgeny-goldin-akqa avatar eyalb4doc avatar eyalbe4 avatar freddy33 avatar ghale avatar jbaruch avatar jfrog-ecosystem avatar jfrogsolutionci avatar johntconklin avatar liorhson avatar liron-shalom avatar or-geva avatar robinino avatar ronmjf avatar rpalcolea avatar shikloshi avatar tamirhadad avatar tomerc-jfrog avatar yahavi avatar yoav avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.