uri #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test workflow | |
on: | |
push: | |
branches: [ test ] | |
env: | |
ANYPOINT_CLIENT_ID: ${{ secrets.CONNECTED_APP_CLIENT_ID }} | |
ANYPOINT_CLIENT_SECRET: ${{ secrets.CONNECTED_APP_CLIENT_SECRET }} | |
REST_API_ARTIFACT_ID: squirrel | |
API_MANAGER_API_ID: 19940258 | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout this repo | |
uses: actions/checkout@v4 | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-maven- | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: "zulu" | |
java-version: 17 | |
- name: Set up NodeJS 16 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 16 | |
- name: Install Anypoint CLI | |
run: | | |
npm install -g anypoint-cli-v4 | |
- name: Set ANYPOINT_ORG | |
run: | | |
echo "ANYPOINT_ORG=$(mvn help:evaluate -Dexpression=project.groupId -q -DforceStdout)" >> $GITHUB_ENV | |
- name: Set ANYPOINT_ENV | |
run: | | |
echo "ANYPOINT_ENV=$(mvn help:evaluate -Dexpression=env -q -DforceStdout)" | |
- name: Set REST_API_VERSION | |
run: | | |
echo "REST_API_VERSION=$(mvn dependency:list -DincludeArtifactIds=$REST_API_ARTIFACT_ID \ | |
--settings .maven/settings.xml \ | |
-DskipMunitTests \ | |
-Dclient.id="$ANYPOINT_CLIENT_ID" \ | |
-Dclient.secret="$ANYPOINT_CLIENT_SECRET" | grep ":$REST_API_ARTIFACT_ID:" | grep -Eo "[0-9]+[.][0-9]+[.][0-9]+")" >> $GITHUB_ENV | |
- name: API Manager - Change specification version | |
run: | | |
anypoint-cli-v4 api-mgr:api:change-specification $API_MANAGER_API_ID $REST_API_VERSION | |
- name: API Manager - Update implementation URI | |
run: | | |
appName=$(mvn help:evaluate -Dexpression=project.name -q -DforceStdout) | |
appId=$(anypoint-cli-v4 runtime-mgr:application:list --output json | jq '.[]|select(.name=="$appName").id') | |
appUri=$(anypoint-cli-v4 runtime-mgr:application:describe --output json $appId | jq '.target.deploymentSettings.http.inbound.publicUrl') | |
anypoint-cli-v4 api-mgr:api:edit --uri appUri $API_MANAGER_API_ID |