Skip to content

Commit

Permalink
WIP - Build on Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasgarciaisaia committed Mar 6, 2024
1 parent 24aabfc commit 8ebe9ba
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: Set environment up
run: |
docker compose pull
docker compose build
docker compose run --rm client npm install
- name: Run specs
env:
JVM_OPTS: -Xmx3200m
TEST_DATABASE_URL: jdbc:postgresql://db/planwise?user=planwise&password=planwise
run: |
docker compose run --rm -e JVM_OPTS -e TEST_DATABASE_URL app lein test
docker compose run --rm client npm run test
docker compose run --rm app lein check-format
build:
needs: test
runs-on: ubuntu-22.04
env:
DOCKER_REPOSITORY: 'instedd/planwise'
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
steps:
- uses: actions/checkout@v4
- name: Build image & push to Docker Hub
run: ./build.sh
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ ENV BIN_PATH /app/bin/
COPY --from=build /app/target/uberjar/planwise-standalone.jar /app/lib/
ENV JAR_PATH /app/lib/planwise-standalone.jar

# Add app version file
COPY --from=build /app/resources/planwise/version /app/VERSION

# Expose JNI libs to app
ENV LD_LIBRARY_PATH=/usr/lib/jni

Expand Down
13 changes: 13 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -eo pipefail

source <(curl -s https://raw.githubusercontent.com/manastech/ci-docker-builder/d3406587def914918666ef41c0637d6b739fdf7d/build.sh)

dockerSetup
echo $VERSION > VERSION
echo $VERSION > resources/planwise/version

dockerBuildAndPush
# FIXME: build & push mapcache
# FIXME: build & push mapserver
# FIXME: build & push tools

0 comments on commit 8ebe9ba

Please sign in to comment.