Skip to content

Commit bb33f37

Browse files
Merge branch 'develop' into iastest
2 parents 373ed01 + 50070f4 commit bb33f37

3 files changed

Lines changed: 160 additions & 0 deletions

File tree

.github/workflows/integration_test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,19 @@ on:
77
description: 'Specify the Cloud Foundry space to run integration tests on'
88
required: true
99

10+
branch_name:
11+
description: 'Specify the branch to use for integration tests'
12+
required: true
13+
1014
jobs:
1115
integration-test:
1216
runs-on: ubuntu-latest
1317

1418
steps:
1519
- name: Checkout repository
1620
uses: actions/checkout@v2
21+
with:
22+
ref: ${{ github.event.inputs.branch_name }}
1723

1824
- name: Set up Java 17
1925
uses: actions/setup-java@v3
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Multi Tenancy Deployment
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
cf_space:
7+
description: 'Specify the Cloud Foundry space to deploy to'
8+
required: true
9+
default: 'developcap'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout this repository
17+
uses: actions/checkout@v2
18+
19+
- name: Set up JDK 21
20+
uses: actions/setup-java@v3
21+
with:
22+
distribution: 'temurin'
23+
java-version: '21'
24+
25+
- name: Build and package
26+
run: |
27+
mvn clean install -P unit-tests -DskipIntegrationTests
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v3
31+
with:
32+
node-version: '18' # Change this to at least version 18
33+
34+
- name: Install MBT
35+
run: npm install -g mbt
36+
37+
- name: Clone the cloud-cap-samples-java repo
38+
run: git clone --depth 1 --branch mtTests https://github.com/vibhutikumar07/cloud-cap-samples-java.git
39+
40+
- name: Change directory to cloud-cap-samples-java
41+
working-directory: cloud-cap-samples-java
42+
run: pwd # Verifies that we're in the correct directory
43+
44+
- name: Run mbt build
45+
working-directory: cloud-cap-samples-java
46+
run: |
47+
echo "java version"
48+
java --version
49+
mbt build
50+
51+
- name: Deploy to Cloud Foundry
52+
working-directory: cloud-cap-samples-java
53+
run: |
54+
echo "Deploying to ${{ github.event.inputs.cf_space }}......"
55+
56+
# Install cf CLI plugin
57+
58+
wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo tee /etc/apt/trusted.gpg.d/cloudfoundry.asc
59+
echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
60+
sudo apt update
61+
sudo apt install cf-cli
62+
63+
cf install-plugin multiapps -f
64+
65+
# Login to Cloud Foundry again to ensure session is active
66+
cf login -a ${{ secrets.CF_API }} -u ${{ secrets.CF_USER }} -p ${{ secrets.CF_PASSWORD }} -o ${{ secrets.CF_ORG }} -s ${{ github.event.inputs.cf_space }}
67+
68+
# Deploy the application
69+
echo "Current directory.."
70+
pwd
71+
ls -lrth
72+
echo "Running cf deploy"
73+
cf deploy mta_archives/bookshop-mt_1.0.0.mtar -f
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Multi Tenancy Deploy
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
branches:
7+
- develop
8+
workflow_dispatch:
9+
10+
permissions:
11+
pull-requests: read
12+
packages: read # Added permission to read packages
13+
14+
jobs:
15+
deploy:
16+
if: github.event.pull_request.merged == true
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
21+
- name: Wait for 5 minutes # Added a 5-minute delay to ensure the snapshot is deployed successfully before initiating the deployment job.
22+
run: sleep 300
23+
24+
- name: Checkout this repository
25+
uses: actions/checkout@v2
26+
27+
- name: Set up JDK 21
28+
uses: actions/setup-java@v3
29+
with:
30+
distribution: 'temurin'
31+
java-version: '21'
32+
33+
- name: Build and package
34+
run: |
35+
mvn clean install -P unit-tests -DskipIntegrationTests
36+
37+
- name: Setup Node.js
38+
uses: actions/setup-node@v3
39+
with:
40+
node-version: '18' # Change this to at least version 18
41+
42+
- name: Install MBT
43+
run: npm install -g mbt
44+
45+
- name: Clone the cloud-cap-samples-java repo
46+
run: git clone --depth 1 --branch mtTests https://github.com/vibhutikumar07/cloud-cap-samples-java.git
47+
48+
- name: Change directory to cloud-cap-samples-java
49+
working-directory: cloud-cap-samples-java
50+
run: pwd # Verifies that we're in the correct directory
51+
52+
- name: Run mbt build
53+
working-directory: cloud-cap-samples-java
54+
run: |
55+
echo "java version"
56+
java --version
57+
mbt build
58+
59+
- name: Deploy to Cloud Foundry
60+
working-directory: cloud-cap-samples-java
61+
run: |
62+
echo "Deploying to ${{ secrets.CF_SPACE }}......"
63+
64+
# Install cf CLI plugin
65+
66+
wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo tee /etc/apt/trusted.gpg.d/cloudfoundry.asc
67+
echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
68+
sudo apt update
69+
sudo apt install cf-cli
70+
71+
cf install-plugin multiapps -f
72+
73+
# Login to Cloud Foundry again to ensure session is active
74+
cf login -a ${{ secrets.CF_API }} -u ${{ secrets.CF_USER }} -p ${{ secrets.CF_PASSWORD }} -o ${{ secrets.CF_ORG }} -s ${{ secrets.CF_SPACE }}
75+
76+
# Deploy the application
77+
echo "Current directory.."
78+
pwd
79+
ls -lrth
80+
echo "Running cf deploy"
81+
cf deploy mta_archives/bookshop-mt_1.0.0.mtar -f

0 commit comments

Comments
 (0)