Skip to content

Commit

Permalink
more CI
Browse files Browse the repository at this point in the history
CI bugfixes

Update zip_dist_ci.yaml

Update zip_dist_ci.yaml
  • Loading branch information
ThePrez committed Aug 8, 2024
1 parent d626d99 commit 37330b1
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 8 deletions.
40 changes: 32 additions & 8 deletions .github/workflows/rpm_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ on:
pull_request:
branches: [ main ]

env:
remote_build_dir: /home/${{ secrets.IBMI_USER }}/build/${{ github.sha }}/

jobs:
build:

runs-on: ubuntu-latest
environment: ossbuild

steps:
- uses: actions/checkout@v2
Expand All @@ -24,11 +28,31 @@ jobs:
run: |
echo "project_version=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:3.1.0:exec --file pom.xml | tr -d \-)" >> $GITHUB_ENV
cat $GITHUB_ENV
- name: create jt400 psudo-directory
run: sudo mkdir -p /QIBM/ProdData/OS400/jt400/lib/
- name: change ownership of jt400 psudo-directory
run: sudo chown $USER /QIBM/ProdData/OS400/jt400/lib/
- name: fetch jt400.jar
run: sudo curl https://repo1.maven.org/maven2/net/sf/jt400/jt400/10.7/jt400-10.7.jar -o /QIBM/ProdData/OS400/jt400/lib/jt400.jar
- name: Build with Maven
run: time rpmbuild --define "_builddir `pwd`" --define 'mversion ${{ env.project_version }}' -ba mapepire-server.spec
- name: Install ICI tool
run: npm i -g @ibm/ibmi-ci

- name: Build on IBM i
run: |
ici \
--rcwd "${{ env.remote_build_dir }}" \
--push "." \
--cmd 'time rpmbuild --define "_builddir `pwd`" --define "mversion ${{ env.project_version }}" -ba mapepire-server.spec' \
--pull '/home/${{ secrets.IBMI_USER }}/rpmbuild/RPMS/noarch/mapepire-server-${{ env.project_version }}-0.ibmi7.4.noarch.rpm'
env:
IBMI_HOST: ${{ secrets.IBMI_HOST }}
IBMI_USER: ${{ secrets.IBMI_USER }}
IBMI_PASSWORD: ${{ secrets.IBMI_PASSWORD }}
IBMI_SSH_PORT: ${{ secrets.IBMI_SSH_PORT }}

- name: Clean up on IBM i
if: always()
run: |
ici \
--ignore --cmd "rm -fr ${{ env.remote_build_dir }}" \
--ignore --cmd 'rm -fr /home/${{ secrets.IBMI_USER }}/rpmbuild/*/mapepire*' \
--ignore --cmd 'rm -fr /home/${{ secrets.IBMI_USER }}/rpmbuild/RPMS/*/mapepire*'
env:
IBMI_HOST: ${{ secrets.IBMI_HOST }}
IBMI_USER: ${{ secrets.IBMI_USER }}
IBMI_PASSWORD: ${{ secrets.IBMI_PASSWORD }}
IBMI_SSH_PORT: ${{ secrets.IBMI_SSH_PORT }}
60 changes: 60 additions & 0 deletions .github/workflows/zip_dist_ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Zip dist CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
remote_build_dir: /home/${{ secrets.IBMI_USER }}/build/${{ github.sha }}/

jobs:
build:

runs-on: ubuntu-latest
environment: ossbuild

steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'temurin'
cache: maven

- name: Get Maven project version
run: |
echo "project_version=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:3.1.0:exec --file pom.xml)" >> $GITHUB_ENV
cat $GITHUB_ENV
- name: create jt400 psudo-directory
run: sudo mkdir -p /QIBM/ProdData/OS400/jt400/lib/
- name: change ownership of jt400 psudo-directory
run: sudo chown $USER /QIBM/ProdData/OS400/jt400/lib/
- name: fetch jt400.jar
run: sudo curl https://repo1.maven.org/maven2/net/sf/jt400/jt400/10.7/jt400-10.7.jar -o /QIBM/ProdData/OS400/jt400/lib/jt400.jar
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: create staging directory
run: |
mkdir -p staging/opt/mapepire/lib/
mkdir -p staging/opt/mapepire/bin/
- name: Populate staging directory
run: |
mv scripts/mapepire-start.sh staging/opt/mapepire/bin/mapepire
mv target/mapepire-server-${{ env.project_version }}-jar-with-dependencies.jar staging/opt/mapepire/lib/mapepire.jar
- name: Create distribution .zip
run: |
pushd staging/opt/
zip ../../mapepire-server-${{ env.project_version }}.zip mapepire
popd
- name: Upload dist artifact
uses: actions/upload-artifact@v3
with:
name: mapepire-server-${{ env.project_version }}.zip
path: mapepire-server-${{ env.project_version }}.zip

File renamed without changes.
2 changes: 2 additions & 0 deletions scripts/mapepire-start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/QOpenSys/pkgs/bin/bash
exec /QOpenSys/QIBM/ProdData/JavaVM/jdk80/64bit/bin/java -jar /opt/mapepire-server/lib/mapepire-server.jar

0 comments on commit 37330b1

Please sign in to comment.