Skip to content

Free memory for gc #117

Free memory for gc

Free memory for gc #117

Workflow file for this run

name: Zip dist CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
environment: OSSBUILD
steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
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/mapepire/
mkdir -p staging/opt/mapepire/bin/
mkdir -p staging/opt/zip
- name: Update service commander definition
run : |
sed -i 's/name: .*/name: Mapepire Development Server/; s/check_alive: .*/check_alive: mapepired,8075/' service-commander-def.yaml
- 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/mapepire-server.jar
mv service-commander-def.yaml staging/opt/mapepire/lib/mapepire/mapepired.yaml
- name: Create distribution .zip
working-directory: staging/opt/mapepire
run: zip -r ../zip/mapepire-server-${{ env.project_version }}.zip bin lib
- name: Upload dist artifact
uses: actions/upload-artifact@v4
id: artifact-upload
with:
name: mapepire-server-${{ env.project_version }}
path: staging/opt/mapepire
if-no-files-found: error
- name: Install NPM Dependencies
if: ${{ github.base_ref == '' }}
run: npm i -g @ibm/ibmi-ci
- name: Deploy Server to IBM i
working-directory: staging/opt/zip
if: ${{ github.base_ref == '' }}
run: |
ici \
--rcwd "/home/${{ secrets.IBMI_USER }}" \
--cmd "mkdir -p /opt/download/dev" \
--rcwd "/opt/download/dev" \
--cmd "rm -f mapepire-server-*.zip" \
--push "." \
--cmd "mkdir -p /opt/mapepire/dev" \
--rcwd "/opt/mapepire/dev" \
--cmd "rm -fr bin lib" \
--cmd "jar xvf /opt/download/dev/mapepire-server-${{ env.project_version }}.zip" \
--cmd "chown -R qsys ." \
--cmd "rm -fr /QOpenSys/etc/sc/services/mapepired.yaml" \
--cmd "ln -sf /opt/mapepire/dev/lib/mapepire/mapepired.yaml /QOpenSys/etc/sc/services/mapepired.yaml" \
--cmd "sc -v check mapepired" \
--cmd "sc -v stop mapepired" \
--cmd "sc -v start mapepired" \
env:
IBMI_HOST: ${{ secrets.IBMI_HOST }}
IBMI_USER: ${{ secrets.IBMI_USER }}
IBMI_PASSWORD: ${{ secrets.IBMI_PASSWORD }}
IBMI_SSH_PORT: ${{ secrets.IBMI_SSH_PORT }}