Skip to content

Artifact Manager

Abstract

To ease the installation of plugins (like parsers, punchlines, and ohers) on your punch, we provide a user interface to interact directly with them. We call these plugins "artifacts".

Creating an artifact

An artifact is defined by a YAML metadata file, which contains all the information regarding its content, like its name, description, logo, ...

Below is a sample metadata file:

version: 2.5.0
artifact: my-artifact
displayName: My Artifact
group: com.mycompany.artifacts
logo: https://mycompany.com/logo.png
createdAt: 2021-05-05 17:30
description: This is a sample artifact
keywords:
  - punchline
  - sample-keyword
type: punchline
links:
  - name: GitHub
    url: https://github.com/mycompany/myartifact
readme: |
  Artifact documentation in markdown format
changelog:
  - "feat: add support for foobar"
  - "fix: remove a broken item"
maintainers:
  - name: John Doe
    email: john.doe@mycompany.com
provider:
  name: My Company
  email: contact@mycompany.com
punchVersionCompatible:
  - 6.x

In order to create your artifact, you will need to fill this file with your own information. Once done, you can actually proceed to the api call that will register your artifact:

curl --location --request PUT "http://localhost:4242/v1/mytenant/resources/upload" --form "input=@\"./my-artifact/build.zip\"" --form "manifest=@\"./my-artifact/metadata.yml\""

Updating an artifact

Updating your artifacts is actually pretty straightforward, as you only need to change the version property of your metadata file, and push the artifact again. You can obviously change other properties if you need to.

Introduction to the artifact manager

As of now, the Artifact Manager interface is in early stage development, so it lacks some features. Currently, it is only possible to list and consult artifacts.

On your standalone, the artifact manager is available at the address: http://localhost:4242/hub/index.html.

Browsing artifacts

Browsing artifacts is straightforward, you will find in the list basic information that will help you find the artifact that suits your needs

Artifact List

When you click on an artifact in the list, you'll be redirected to the details of this artifacts, where you'll find way more information about it, and be able to get a specific version of it. You'll also be able to read the changelog for all its versions.

Artifact Details

Installing an artifact

Every artifact has its own installation requirements, so please refer to their READMEs to learn how to proceed to it.

Configure with Keycloak

If you want to use Keycloak to secure your Artefact Manager, changes your /punch-gateway-*/conf/punchplatform-gateway.yml configuration file and add security and authentication sections. Then restart.

Be careful, change configuration values like uri Keycloak according to your Keycloak configuration.

# conf for standalone
spring:
  servlet:
    multipart:
      max-file-size: -1
      max-request-size: -1
  security:
    oauth2:
      client:
        provider:
          keycloak:
            authorization-uri: http://localhost:8888/auth/realms/punch/protocol/openid-connect/auth
            token-uri: http://localhost:8888/auth/realms/punch/protocol/openid-connect/token
            user-info-uri: http://localhost:8888/auth/realms/punch/protocol/openid-connect/userinfo
            jwk-set-uri: http://localhost:8888/auth/realms/punch/protocol/openid-connect/certs
            user-name-attribute: preferred_username
        registration:
          keycloak:
            client-id: gateway
            client-secret: bde45056-1ecf-4e6c-a5ae-4a8e151c4e96
            client-name: "Custom Keycloak"
            provider: keycloak
            scope: openid
            redirect-uri: http://localhost:4242/login/oauth2/code/keycloak
            client-authentication-method: basic
            authorization-grant-type: authorization_code

authentication:
  enabled: true

Restart application, and it should work.