GithubHelp home page GithubHelp logo

heroic / bucketrepo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jenkins-x/bucketrepo

0.0 2.0 0.0 205 KB

An artifacts repository using cloud storage (a lightweight replacement for Nexus)

License: MIT License

Dockerfile 0.46% Makefile 13.93% Go 79.89% Smarty 5.72%

bucketrepo's Introduction

MIT License

Bucketrepo

This is a lightweight artifacts repository with low memory footprint which can be used as a minimal replacement for Nexus. It is able to cache artifacts from a remote repository on a local filesystem volume and also to store them on a cloud storage bucket via go-cloud.

It can be deployed either as a side-car container to a Kubernetes build pod or as a standalone service.

Getting Started

Configuration

The default configuration enables only the local file cache:

http:
    addr: ":8080"

storage:
    enabled: false
    bucket_url: "gs://bucketrepo"

cache:
    base_dir: "/tmp/bucketrepo"

repositories:
    - url: "https://repo1.maven.org/maven2"
    - url: "http://uk.maven.org/maven2/"

The header (for example Bearer token authentication) and timeout can be modified for every remote repository:

...

repositories:
    - url: "https://repo1.maven.org/maven2"
      timeout: "30s"
    - url: "http://uk.maven.org/maven2/"
    - url: "http://my.private.maven.repo"
      timeout: "10s"
      header:
          Authorization: "Bearer <Token>"

The cloud storage can be enabled by providing a bucket URL:

storage:
    enabled: true
    bucket_url: "gs://mybucket"
    # if necessary is possible to use Path prefix
    prefix: "myfolder" 

Also the TLS and basic authentication can be configured with:

http:
    addr: ":8080"
    https: true
    crt: "/certs/domain.crt"
    key: "/certs/domain.key"
    username: "myuser"
    password: "mypassword"

Note that the basic authentication is turned off when HTTPS is disabled.

Installing

Kubernetes

The repository service can be installed in a Kubernetes cluster using helm. First, you need to add the jenkins-x chart repository to your helm repositories:

helm repo add jenkins-x http://chartmuseum.jenkins-x.io
helm repo update

You can now install the chart with:

helm install jenkins-x/bucketrepo --name bucketrepo

Locally

The repository can be started in a docker container usinged the latest released image:

docker run -v $(pwd)/config:/config -p 8080:8080 gcr.io/jenkinsxio/bucketrepo:0.1.12 -config-path=/config

Or it can be built and run with:

make build
bin/bucketrepo -config-path=config -log-level=debug

Maven Configuration

bucketrepocan be configured as a mirror by adding the following in ~/.m2/settings.xml file:

<settings>
<mirrors>
    <mirror>
      <id>bucketrepo</id>
      <name>bucketrepo- mirror</name>
      <url>http://localhost:8080/bucketrepo/</url>
      <mirrorOf>*</mirrorOf>
    </mirror>
  </mirrors>
</settings>

And as a repository by adding the following in the pom.xml file:

<repositories>
    <repository>
        <id>bucketrepo</id>
        <url>http://localhost:8080/bucketrepo/</url>
    </repository>
</repositories>

<distributionManagement>
    <snapshotRepository>
        <id>snapshots</id>
        <url>http://localhost:8080/bucketrepo/deploy/maven-snapshots/</url>
    </snapshotRepository>
    <repository>
        <id>releases</id>
        <url>http://localhost:8080/bucketrepo/deploy/maven-releases/</url>
    </repository>
</distributionManagement>

Acknowledgments

This project is originally based on nexus-minimal. Thank you atsman for creating that project.

License

MIT

bucketrepo's People

Contributors

alehatsman avatar apiloqbc avatar ccojocar avatar cmur2 avatar fbalicchia avatar heroic avatar jenkins-x-bot avatar jstrachan avatar pmuir avatar sopak avatar zregvart avatar

Watchers

 avatar  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.