Skip to content

Revert "remove alma, temp" #127

Revert "remove alma, temp"

Revert "remove alma, temp" #127

Workflow file for this run

name: Build mod-directory
on:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Start containers
run: |
cd tools/testing
docker-compose down -v
docker-compose up -d
- name: Inject github build number
run: |
# Make github run id available to gradle script via env var BUILD_NUMBER so it ends up in our module descriptor version
echo "BUILD_NUMBER=${{github.run_id}}" >> $GITHUB_ENV
- name: Build with Gradle
uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
with:
arguments: build
build-root-directory: service
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
with:
files: "service/build/test-results/**/*.xml"
- name: Prepare env for docker build
run: |
echo "module_name=$(grep info.app.name ./service/build/resources/main/META-INF/grails.build.info | cut -f2 -d=)" >> $GITHUB_ENV
echo "module_version=$(grep info.app.version ./service/build/resources/main/META-INF/grails.build.info | cut -f2 -d=)" >> $GITHUB_ENV
echo "is_snapshot=$(grep info.app.version ./service/build/resources/main/META-INF/grails.build.info | grep -i SNAPSHOT | wc -l)" >> $GITHUB_ENV
- name: Pre build info
run: echo "ref:${{github.REF}} name:${{env.module_name}} ver:${{env.module_version}} is_snapshot:${{env.is_snapshot}}"
- name: Docker Build
run: docker build --pull=true --no-cache=true -t ${{ env.module_name }}:${{ env.module_version }} .
- if: env.is_snapshot == '1'
name: Publish to snapshot
run: |
echo "push to snapshot repo ${{env.module_name}} ${{env.module_version}}"
docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }} $dockerRepo
docker tag ${{ env.module_name }}:${{ env.module_version }} $dockerRepo/knowledgeintegration/${{ env.module_name }}:${{ env.module_version }}
docker tag ${{ env.module_name }}:${{ env.module_version }} $dockerRepo/knowledgeintegration/${{ env.module_name }}:snapshot-latest
docker push $dockerRepo/knowledgeintegration/${{ env.module_name }}:${{ env.module_version }}
docker push $dockerRepo/knowledgeintegration/${{ env.module_name }}:snapshot-latest
env:
dockerRepo: docker.libsdev.k-int.com
- if: env.is_snapshot == '0'
name: Publish to release
run: |
echo "push to snapshot repo ${{env.module_name}} ${{env.module_version}}"
docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }} $dockerRepo
docker tag ${{ env.module_name }}:${{ env.module_version }} $dockerRepo/knowledgeintegration/${{ env.module_name }}:${{ env.module_version }}
docker tag ${{ env.module_name }}:${{ env.module_version }} $dockerRepo/knowledgeintegration/${{ env.module_name }}:latest
docker push $dockerRepo/knowledgeintegration/${{ env.module_name }}:${{ env.module_version }}
docker push $dockerRepo/knowledgeintegration/${{ env.module_name }}:latest
env:
dockerRepo: docker.libsdev.k-int.com
- name: Publish Descriptor
run: |
echo Post to public registry
curl -i -XPOST https://registry.reshare-dev.indexdata.com/_/proxy/modules -d @service/build/resources/main/okapi/ModuleDescriptor.json
# Folio Docker image publishing
# Snapshots to
# Releases to https://hub.docker.com/u/folioorg