Skip to content

Commit

Permalink
Merge pull request salesforce#41 from mulesoft-anypoint/master
Browse files Browse the repository at this point in the history
New Resources
  • Loading branch information
rubycube authored Feb 6, 2024
2 parents 7544230 + a31500e commit 822b26f
Show file tree
Hide file tree
Showing 19 changed files with 5,609 additions and 266 deletions.
35 changes: 19 additions & 16 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Cloudhub Client Generator Pipeline
name: Anypoint Clients Generator Pipeline

# Controls when the action will run.
# Controls when the action will run.
on:
# Triggers the workflow on push
push:
Expand All @@ -16,41 +16,44 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
node-version: [18.x]
env:
CLIENT_GO_REPO: git@github.com:mulesoft-consulting/cloudhub-client-go.git
CLIENT_GO_REPO: https://github.com/mulesoft-anypoint/anypoint-client-go.git
CLIENT_GO_BRANCH: dev
GIT_SSH_KEY: ${{ secrets.GIT_SSH_KEY }}
#should be the base64 of base64(x-access-token:<accessToken>). more info here https://milangatyas.com/Blog/Detail/11/github-git-repository-authentication-for-auto
GIT_AUTH_HEADER_B64: ${{ secrets.GIT_AUTH_HEADER_B64 }}
GIT_PIPELINE_USER_EMAIL: [email protected]
GIT_PIPELINE_USER_NAME: pipeline-anypoint-clients-generator
APP_NAME: anypoint-client-generator
COMMIT_MSG: Generates modules from pipeline.

steps:
- name: Set Up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ env.GIT_SSH_KEY }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Copy Cloudhub-client-generator project
- name: Copy anypoint-client-generator project
run: |
git config --global user.email "[email protected]"
git config --global user.name "pipeline-cloudhub-clients-generator"
git config --global http.version HTTP/1.1
git config --global user.email ${{env.GIT_PIPELINE_USER_EMAIL}}
git config --global user.name ${{env.GIT_PIPELINE_USER_NAME}}
export GENERATOR_FOLDER=`pwd`
export GO_CLIENT_FOLDER=`pwd`/dist/cloudhub-client-generator
export GO_CLIENT_FOLDER=`pwd`/dist/${{env.APP_NAME}}
export ANYPOINT_GENERATOR_GO_DEST="$GO_CLIENT_FOLDER"
npm install
git clone --branch ${{env.CLIENT_GO_BRANCH}} ${{env.CLIENT_GO_REPO}} $GO_CLIENT_FOLDER
npm install
git -c http.extraheader="AUTHORIZATION: basic ${{env.GIT_AUTH_HEADER_B64}}" clone --branch ${{env.CLIENT_GO_BRANCH}} ${{env.CLIENT_GO_REPO}} $GO_CLIENT_FOLDER
npx openapi-generator-cli generate
cd $GO_CLIENT_FOLDER
git add .
git commit -am "Generates modules from pipeline."
git push
git commit -am "${{env.COMMIT_MSG}}"
git -c http.extraheader="AUTHORIZATION: basic ${{env.GIT_AUTH_HEADER_B64}}" push
Expand Down
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MIT License

Copyright 2023 Anypoint Automation Collective

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export ANYPOINT_GENERATOR_GO_DEST=`pwd`/dist
Use the following to get the manual

```bash
npx openapi-generator-cli help
npx openapi-generator-cli help
```

Use the following command to generate using the configuration stored in `openapitools.json`
Expand Down Expand Up @@ -54,5 +54,5 @@ Here's some rules to keep in mind when you write your spec:

## Disclaimer

**This is an [UNLICENSED software, please review the considerations](UNLICENSE.md).**
**This is an [open source software, please review the considerations](LICENSE.md).**
This is an open source project, it does not form part of the official MuleSoft product stack, and is therefore not included in MuleSoft support SLAs. Issues should be directed to the community, who will try to assist on a best endeavours basis. This application is distributed **as is**.
23 changes: 0 additions & 23 deletions UNLICENSE.md

This file was deleted.

4 changes: 2 additions & 2 deletions openapitools.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "5.1.0",
"version": "6.6.0",
"generators": {
"golang": {
"generatorName": "go",
"output": "$ANYPOINT_GENERATOR_GO_DEST/#{name}",
"glob": "spec/*.{json,yaml,yml}",
"gitUserId": "mulesoft-consulting",
"gitUserId": "mulesoft-anypoint",
"gitRepoId": "anypoint-client-go",
"additionalProperties": {
"isGoSubmodule": true,
Expand Down
Loading

0 comments on commit 822b26f

Please sign in to comment.