Skip to content

Commit

Permalink
back with makefile and flow
Browse files Browse the repository at this point in the history
  • Loading branch information
tutkat committed May 17, 2024
1 parent 405e1e4 commit 3d498c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 33 deletions.
24 changes: 3 additions & 21 deletions .github/workflows/sync_sdk_with_new_api_spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,20 @@ on:
inputs:
new_api_spec_version_number:
required: true
env_test_url:
default: https://uatapi.equinix.com
name: Sync SDK with New API Spec
jobs:
sync:
strategy:
matrix:
java-version: [11.0.21]
java-distribution: [temurin]

runs-on: [self-hosted , kubernetes , onprem , nonprod , ecx]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"

- name: Get vault token
uses: equinix-product/vault-action@v1
with:
vault: secretsnonprod
namespace: ecx
secrets: |
nonprod/data/vault key | VAULT_KEY;
- name: Checkout Java Code
uses: actions/checkout@v2

Expand Down Expand Up @@ -55,15 +45,7 @@ jobs:
run: |
VERSION_UPDATE="OPENAPI_URL=\"https://app.swaggerhub.com/apiproxy/registry/equinix-api/fabric/${{ github.event.inputs.new_api_spec_version_number }}\""
sed -i 's,${{ steps.spec_versions.outputs.api_spec_line }},'"$VERSION_UPDATE"',' Makefile
make generate
- name: Run tests and commit changes
run: |
cd equinix-openapi-fabric/
mvn clean package -DenvUrl=${{ github.event.inputs.env_test_url }} -DuserName=${{ env.USER_NAME }} -DuserPassword=${{ env.USER_PASSWORD }} \
-DclientId=${{ env.CLIENT_ID }} -DclientSecret=${{ env.CLIENT_SECRET }}
make generate
git commit -m 'sync: fetch ${{ steps.date.outputs.date }} spec and apply patches' spec/*.json
git add equinix-openapi-fabric
git commit -m 'sync: generate client with ${{ steps.date.outputs.date }} spec'
Expand Down
14 changes: 2 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ CURRENT_GID := $(shell id -g)
# git repo : equinix fabric-java sdk
GIT_ORG=equinix-labs
GIT_REPO=fabric-java
TEST_PATH="${OPENAPI_GENERATED_CLIENT}src/test/java/com/equinix/openapi/fabric"

# Equinix fabric OAS 3.0.0
SPEC_FETCHED_FILE:=spec/oas3.fabric.fetched.json
SPEC_PATCHED_FILE:=spec/oas3.fabric.patched.json
Expand Down Expand Up @@ -64,15 +64,5 @@ docker_generate:
--git-repo-id ${GIT_REPO} \
--git-user-id ${GIT_ORG}


build_client:
rm -rf "${TEST_PATH}/v4"
cp -r "v4" ${TEST_PATH}
#cd ${OPENAPI_GENERATED_CLIENT} && mvn clean package \
# -DenvUrl=https://uatapi.equinix.com \
# -DuserName=panthersnfv \
# -DuserPassword=Welcome@1 \
# -DclientId=RPZtTFUFGLTMP7aOpfIcWHq8gVsAZNs2Rne3A9vlDqjVx6bw \
# -DclientSecret=AQoEddbrVmC8bzoF6kmwLjJ7qIlUVTvF00xKRQsJWAb6Hzu4ZARUH94XzN8bXh73


cd ${OPENAPI_GENERATED_CLIENT}; mvn clean package

0 comments on commit 3d498c3

Please sign in to comment.