Skip to content

Commit

Permalink
Merge pull request #2 from SasinduDilshara/init
Browse files Browse the repository at this point in the history
Initialize the project with gradlke and ReadMe files
  • Loading branch information
SasinduDilshara authored Aug 1, 2024
2 parents f969b42 + d7143bb commit e312f03
Show file tree
Hide file tree
Showing 31 changed files with 1,646 additions and 19 deletions.
7 changes: 7 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.

# See: https://help.github.com/articles/about-codeowners/

# These owners will be the default owners for everything in the repo.
* @SasinduDilshara
12 changes: 12 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Purpose

Fixes:

## Examples

## Checklist
- [ ] Linked to an issue
- [ ] Updated the changelog
- [ ] Added tests
- [ ] Updated the spec
- [ ] Checked native-image compatibility
18 changes: 18 additions & 0 deletions .github/workflows/build-timestamped-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build

on:
push:
branches:
- main
paths-ignore:
- '*.md'
- 'docs/**'
- 'load-tests/**'
workflow_dispatch:

jobs:
call_workflow:
name: Run Build Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/build-timestamp-master-template.yml@main
secrets: inherit
37 changes: 37 additions & 0 deletions .github/workflows/build-with-bal-test-graalvm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: GraalVM Check

on:
workflow_dispatch:
inputs:
lang_tag:
description: Branch/Release Tag of the Ballerina Lang
required: true
default: master
lang_version:
description: Ballerina Lang Version (If given ballerina lang build will be skipped)
required: false
default: ''
native_image_options:
description: Default native-image options
required: false
default: ''
schedule:
- cron: '30 18 * * *'
pull_request:
branches:
- main
types: [ opened, synchronize, reopened, labeled, unlabeled ]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
call_stdlib_workflow:
name: Run StdLib Workflow
if: ${{ github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'ballerina-platform') }}
uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-template.yml@main
with:
lang_tag: ${{ inputs.lang_tag }}
lang_version: ${{ inputs.lang_version }}
native_image_options: '-J-Xmx7G ${{ inputs.native_image_options }}'
21 changes: 21 additions & 0 deletions .github/workflows/central-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Publish to the Ballerina central

on:
workflow_dispatch:
inputs:
environment:
type: choice
description: Select Environment
required: true
options:
- DEV CENTRAL
- STAGE CENTRAL

jobs:
call_workflow:
name: Run Central Publish Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/central-publish-template.yml@main
secrets: inherit
with:
environment: ${{ github.event.inputs.environment }}
16 changes: 16 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Publish Release

on:
workflow_dispatch:
repository_dispatch:
types: [stdlib-release-pipeline]

jobs:
call_workflow:
name: Run Release Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/release-package-template.yml@main
secrets: inherit
with:
package-name: data.jsondata
package-org: ballerina
14 changes: 14 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Pull Request

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

on: pull_request

jobs:
call_workflow:
name: Run PR Build Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/pull-request-build-template.yml@main
secrets: inherit
19 changes: 19 additions & 0 deletions .github/workflows/stale-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Close stale pull requests'

on:
schedule:
- cron: '30 19 * * *'
workflow_dispatch:

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
stale-pr-message: 'This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the `stale` label is removed or commented.'
close-pr-message: 'Closed PR due to inactivity for more than 18 days.'
days-before-pr-stale: 15
days-before-pr-close: 3
days-before-issue-stale: -1
days-before-issue-close: -1
13 changes: 13 additions & 0 deletions .github/workflows/trivy-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Trivy

on:
workflow_dispatch:
schedule:
- cron: '30 20 * * *'

jobs:
call_workflow:
name: Run Trivy Scan Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/trivy-scan-template.yml@main
secrets: inherit
61 changes: 42 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,47 @@
# Compiled class file
*.class
native/.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
lib

# Log file
*.log
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

# BlueJ files
*.ctxt
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

# Mobile Tools for Java (J2ME)
.mtj.tmp/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
### VS Code ###
.vscode/

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*
### Mac OS ###
.DS_Store
.gradle
.idea
target
bin
90 changes: 90 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,92 @@
# module-ballerinax-wso2.apim.catalog
Integrate Ballerina services with the WSO2 APIM Service catalog feature.
# Ballerina WSO2 APIM Catalog Publisher

[![Build](https://github.com/ballerina-platform/module-ballerinax-wso2.apim.catalog/actions/workflows/build-timestamped-master.yml/badge.svg)](https://github.com/ballerina-platform/module-ballerinax-wso2.apim.catalog/actions/workflows/build-timestamped-master.yml)
[![codecov](https://codecov.io/gh/ballerina-platform/module-ballerinax-wso2.apim.catalog/branch/main/graph/badge.svg)](https://codecov.io/gh/ballerina-platform/module-ballerinax-wso2.apim.catalog)
[![Trivy](https://github.com/ballerina-platform/module-ballerinax-wso2.apim.catalog/actions/workflows/trivy-scan.yml/badge.svg)](https://github.com/ballerina-platform/module-ballerinax-wso2.apim.catalog/actions/workflows/trivy-scan.yml)
[![GraalVM Check](https://github.com/ballerina-platform/module-ballerinax-wso2.apim.catalog/actions/workflows/build-with-bal-test-graalvm.yml/badge.svg)](https://github.com/ballerina-platform/module-ballerinax-wso2.apim.catalog/actions/workflows/build-with-bal-test-graalvm.yml)
[![GitHub Last Commit](https://img.shields.io/github/last-commit/ballerina-platform/module-ballerinax-wso2.apim.catalog.svg)](https://github.com/ballerina-platform/module-ballerinax-wso2.apim.catalog/commits/master)
[![Github issues](https://img.shields.io/github/issues/ballerina-platform/ballerina-standard-library/module/wso2.apim.catalog.svg?label=Open%20Issues)](https://github.com/ballerina-platform/ballerina-standard-library/labels/module%2Fwso2.apim.catalog)

The Ballerina WSO2 APIM catalog publisher module includes ballerina service management tools for publishing service data to WSO2 API manager service catalogs.

## Features

- **Publish Ballerina services to the WSO2 APIM catalog**

## Usage

### Publish Ballerina services to the WSO2 APIM catalog

1. Add `import ballerinax/wso2.apim.catalog as _;` to the default module.
2. Add `remoteManagement=true` to `[build-options]` section of the Ballerina.toml file.
3. Create Config.toml file if it does not exist, and add the following configurations.
```toml
[ballerinax.wso2.apim.catalog]
serviceUrl="<Url of the service catalog endpoint>"
tokenUrl="<Url of the token endpoint>"
username="<username>"
password="<password>"
clientId="<clientId>"
clientSecret="<Client secret>"
```
Modify the configurations to match your WSO2 APIM manager.
4. Run the project with the following command.
```shell
$ bal run
```

## Issues and projects

Issues and Projects tabs are disabled for this repository as this is part of the Ballerina library. To report bugs, request new features, start new discussions, view project boards, etc. please visit Ballerina library [parent repository](https://github.com/ballerina-platform/ballerina-library).

This repository only contains the source code for the package.

## Building from the source

### Set up the prerequisites

1. Download and install Java SE Development Kit (JDK) version 17 (from one of the following locations).
* [Oracle](https://www.oracle.com/java/technologies/downloads/)
* [OpenJDK](https://adoptium.net/)

2. Export your GitHub personal access token with the read package permissions as follows.

export packageUser=<Username>
export packagePAT=<Personal access token>

### Building the source

Execute the commands below to build from source.

1. To build the library:

./gradlew clean build

2. Publish ZIP artifact to the local `.m2` repository:

./gradlew clean build publishToMavenLocal

3. Publish the generated artifacts to the local Ballerina central repository:

./gradlew clean build -PpublishToLocalCentral=true

4. Publish the generated artifacts to the Ballerina central repository:

./gradlew clean build -PpublishToCentral=true

## Contributing to Ballerina

As an open source project, Ballerina welcomes contributions from the community.

For more information, go to the [contribution guidelines](https://github.com/ballerina-platform/ballerina-lang/blob/master/CONTRIBUTING.md).

## Code of conduct

All contributors are encouraged to read the [Ballerina code of conduct](https://ballerina.io/code-of-conduct).

## Useful links

* Chat live with us via our [Discord server](https://discord.gg/ballerinalang).
* Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag.
22 changes: 22 additions & 0 deletions ballerina-tests/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
org = "ballerinax"
name = "apim_catalog_tests"
version = "0.1.0"

[[dependency]]
org = "ballerinax"
name = "wso2.apim.catalog"
version = "0.1.0"
repository="local"

[build-options]
remoteManagement=true

[platform.java17]
graalvmCompatible = true

[[platform.java17.dependency]]
groupId = "io.ballerina"
artifactId = "wso2.apim.catalog-native"
version = "0.1.0"
path = "../native/build/libs/wso2.apim.catalog-native-0.1.0-SNAPSHOT.jar"
Loading

0 comments on commit e312f03

Please sign in to comment.