-
Notifications
You must be signed in to change notification settings - Fork 43
69 lines (58 loc) · 2.29 KB
/
ci-pr.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: CI for Pull Requests
on:
pull_request:
branches:
- main # Run the workflow for PRs targeting the "main" branch
jobs:
test:
runs-on: ubuntu-latest
steps:
# Step 1: Check out the code from the PR branch
- name: Checkout code
uses: actions/checkout@v2
# Step 2: Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
# Step 3: Install MBT and dependencies
- name: Install MBT and dependencies
run: |
npm install -g mbt
cd code
npm install --production
# Step 4: Install CF Cli
- name: Install CF Cli
run: |
wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | gpg --dearmor -o /usr/share/keyrings/cli.cloudfoundry.org.gpg
echo "deb [trusted=yes] https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
sudo apt-get update
sudo apt-get install cf8-cli
# Step 6: Download and Install SAP BTP CLI
- name: Install BTP CLI
run: |
curl -LJO https://tools.hana.ondemand.com/additional/btp-cli-linux-arm64-latest.tar.gz --cookie "eula_3_2_agreed=tools.hana.ondemand.com/developer-license-3_2.txt"
tar -xzf btp-cli-linux-amd64-latest.tar.gz.
ls -a
mv btp /usr/local/bin
chmod +x /usr/local/bin/btp
# Step 5: Install Multiapps Plugin
- name: Install Multiapps Plugin
run: |
cf add-plugin-repo CF-Community https://plugins.cloudfoundry.org
cf install-plugin multiapps -f
# Step 6: Login to CF
- name: Log in to Cloud Foundry
run: |
cf login -u ${{ secrets.CF_USERNAME }} -p ${{ secrets.CF_PASSWORD }} -o ${{ secrets.CF_ORG }} -s ${{ secrets.CF_SPACE }} -a ${{ secrets.CF_API }}
# Step 7: Build the project
- name: Build MTA Archive
run: |
cd deploy/cf
sed -i 's|{{BROKER_USER}}|'"${{ secrets.BROKER_USER }}"'|g' ./mtaext/ci.mtaext
sed -i 's|{{BROKER_PASSWORD}}|'"${{ secrets.BROKER_PASSWORD }}"'|g' ./mtaext/ci.mtaext
mbt build -e ./mtaext/ci.mtaext
# Step 8: Verify MTA Archive built successfully
- name: Deploy to CF
run: |
cf deploy ./deploy/cf/mta_archives/susaas_0.0.1.mtar -f