Multi Tenancy Deployment Local #9
This file contains hidden or 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: Multi Tenancy Deployment Local | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| workflow_choice: | |
| description: 'Select the workflow to run' | |
| required: true | |
| type: choice | |
| options: | |
| - Deploy | |
| - Snapshot Deploy | |
| cf_space: | |
| description: 'Specify the Cloud Foundry space to deploy to' | |
| required: true | |
| default: 'developcap' | |
| deploy_branch: | |
| description: 'Specify the branch to deploy from (only for Deploy workflow)' | |
| required: false | |
| repository_id: | |
| description: 'Specify the Repository ID (leave blank if deploying to developcap)' | |
| required: false | |
| permissions: | |
| pull-requests: read | |
| packages: read # Added permission to read packages | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.inputs.workflow_choice == 'Deploy' }} | |
| steps: | |
| - name: Checkout this repository π | |
| uses: actions/checkout@v2 | |
| with: | |
| ref: ${{ github.event.inputs.deploy_branch }} | |
| - name: Set up JDK 21 β | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| # - name: Build and package π¦ | |
| # run: | | |
| # echo "π¨ Building and packaging..." | |
| # mvn clean install -P unit-tests -DskipIntegrationTests | |
| # echo "β Build completed successfully!" | |
| - name: Setup Node.js π’ | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18' # Ensure to use at least version 18 | |
| # - name: Install MBT βοΈ | |
| # run: | | |
| # echo "π§ Installing MBT..." | |
| # npm install -g mbt | |
| # echo "β MBT installation complete!" | |
| - name: Install cds βοΈ | |
| run: | | |
| echo "π§ Installing CDS..." | |
| npm install -g @sap/cds@8.9.4 | |
| echo "β CDS installation complete!" | |
| echo "Path after install:" | |
| echo $PATH | |
| ls /home/runner/.npm/_npx/ | |
| echo "Check cds-dk version.." | |
| cds -v | |
| # - name: Clone the cloud-cap-samples-java repo π | |
| # run: | | |
| # echo "π Cloning repository..." | |
| # git clone --depth 1 --branch local_mtTests https://github.com/vibhutikumar07/cloud-cap-samples-java.git | |
| # echo "β Repository cloned!" | |
| # - name: Change directory to cloud-cap-samples-java π | |
| # working-directory: cloud-cap-samples-java | |
| # run: | | |
| # pwd | |
| # echo "βοΈ Directory changed!" | |
| # - name: Run mbt build π¨ | |
| # working-directory: cloud-cap-samples-java | |
| # run: | | |
| # echo "π Running MBT build..." | |
| # echo "java version:" | |
| # java --version | |
| # mbt build | |
| # echo "β MBT build completed!" | |
| # - name: Deploy to Cloud Foundry βοΈ | |
| # working-directory: cloud-cap-samples-java | |
| # run: | | |
| # echo "π Deploying to -s ${{ steps.determine_space.outputs.space }}..." | |
| # echo "π§ Installing Cloud Foundry CLI and plugins..." | |
| # # Install cf CLI plugin | |
| # wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo tee /etc/apt/trusted.gpg.d/cloudfoundry.asc | |
| # echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list | |
| # sudo apt update | |
| # sudo apt install cf-cli | |
| # cf install-plugin multiapps -f | |
| # echo "β Cloud Foundry CLI setup complete!" | |
| # # Login to Cloud Foundry again to ensure session is active | |
| # echo "π Logging in to Cloud Foundry..." | |
| # cf login -a ${ secrets.CF_API } -u ${ secrets.CF_USER } -p ${ secrets.CF_PASSWORD } -o ${ secrets.CF_ORG } -s -s ${{ steps.determine_space.outputs.space }} | |
| # echo "β Logged in successfully!" | |
| # # Deploy the application | |
| # echo "π Current directory.." | |
| # pwd | |
| # ls -lrth | |
| # echo "βΆοΈ Running cf deploy..." | |
| # cf deploy mta_archives/bookshop-mt_1.0.0.mtar -f | |
| # echo "β Deployment complete!" |