From 2ceb1da3b034882555dfb7e2761e75893a271b7d Mon Sep 17 00:00:00 2001 From: Jesse Gorzinski <17914061+ThePrez@users.noreply.github.com> Date: Wed, 7 Aug 2024 21:25:02 -0500 Subject: [PATCH] CI bugfixes Update mapepire-server.spec --- .github/workflows/rpm_ci.yaml | 40 ++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/.github/workflows/rpm_ci.yaml b/.github/workflows/rpm_ci.yaml index 189cf45..337b013 100644 --- a/.github/workflows/rpm_ci.yaml +++ b/.github/workflows/rpm_ci.yaml @@ -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 @@ -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 "." + 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 \ + --rcwd "${{ env.remote_build_dir }}" \ + --ignore --cmd "rm -fr ${{ env.remote_build_dir }}" + --ignore --cmd "rm -fr $HOME/rpmbuild/*/mapepire*" + env: + IBMI_HOST: ${{ secrets.IBMI_HOST }} + IBMI_USER: ${{ secrets.IBMI_USER }} + IBMI_PASSWORD: ${{ secrets.IBMI_PASSWORD }} + IBMI_SSH_PORT: ${{ secrets.IBMI_SSH_PORT }}