Skip to content

Commit

Permalink
Adding global-microservices-springdata-nosql to demo-livelab (#169)
Browse files Browse the repository at this point in the history
* LiveLab v0 - global-microservices-springdata-nosql to demo-livelab
* Update build and push images to the latest GitHub action
* optimizing the build of the zip files
  • Loading branch information
dario-vega authored May 13, 2024
1 parent 5d77e78 commit d64899f
Show file tree
Hide file tree
Showing 38 changed files with 1,493 additions and 7 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/build-and-push-demo-movie-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Build and publish Demo Movie container image to GitHub Container Registry

on:
push:
branches:
- master
paths:
- 'demo-livelab/global-microservices-springdata-nosql/code-nosql-spring-sdk/*'
- '.github/workflows/build-and-push-demo-movie-image.yml'
workflow_dispatch:

env:
IMAGE_NAME: demo-nosql-movie-example-app


jobs:
build-and-push:
name: Build and push Movie Demo container image
runs-on: ubuntu-latest

steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Repository owner needs to be lowercase
id: repo-owner
run: |
REPO_OWNER="${{ github.repository_owner }}"
echo "repo-owner=${REPO_OWNER,,}" >> "$GITHUB_OUTPUT"
-
name: Get current date
id: date
run: echo "date=$(date +'%Y-%m')" >> "$GITHUB_OUTPUT"
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Generate container image metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ steps.repo-owner.outputs.repo-owner }}/${{ env.IMAGE_NAME }}
flavor: |
latest=false
tags: |
type=raw,value=latest
type=raw,value=${{ env.TAG }}
env:
TAG: ${{ steps.date.outputs.date }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: ./demo-livelab/global-microservices-springdata-nosql/code-nosql-spring-sdk/
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
12 changes: 6 additions & 6 deletions .github/workflows/build-and-push-demo-vod-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
-
name: Repository owner needs to be lowercase
id: repo-owner
Expand All @@ -39,15 +39,15 @@ jobs:
run: echo "date=$(date +'%Y-%m')" >> "$GITHUB_OUTPUT"
-
name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Generate container image metadata
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ steps.repo-owner.outputs.repo-owner }}/${{ env.IMAGE_NAME }}
flavor: |
Expand All @@ -59,7 +59,7 @@ jobs:
TAG: ${{ steps.date.outputs.date }}
-
name: Build and push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: ./demo-livelab/video-on-demand-with-nosql-database/demo-vod/
platforms: linux/amd64,linux/arm64
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nosql-examples-build-zips.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
for EXAMPLE_FOLDER in $FOLDERS;
do
RESOURCE=$(cut -d "/" -f 1 <<< "$EXAMPLE_FOLDER")
zip -r ../zips/$RESOURCE.zip $EXAMPLE_FOLDER
zip -r ../zips/$RESOURCE.zip $EXAMPLE_FOLDER -x \*.jar -x \*.gif
done
cd ..
FOLDERS=$(ls -1 -d examples-nosql-*/*/ )
Expand Down
3 changes: 3 additions & 0 deletions demo-livelab/global-microservices-springdata-nosql/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# video-on-demand-with-nosql-database
Demo Video On Demand streaming application using GraphQL and NoSQL

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM ghcr.io/graalvm/jdk:ol8-java17
EXPOSE 8000
ARG JAR_FILE=target/spring-data-rest-nosql-0.0.1.jar
ADD ${JAR_FILE} spring-data-rest-nosql-0.0.1.jar
RUN ls -aldrt
ENTRYPOINT ["java","-jar","./spring-data-rest-nosql-0.0.1.jar"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Getting Started

### Reference Documentation
For further reference, please consider the following sections:

* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/3.2.0/maven-plugin/reference/html/)
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/3.2.0/maven-plugin/reference/html/#build-image)
* [Rest Repositories](https://docs.spring.io/spring-boot/docs/3.2.0/reference/htmlsingle/index.html#howto.data-access.exposing-spring-data-repositories-as-rest)

### Guides
The following guides illustrate how to use some features concretely:

* [Accessing JPA Data with REST](https://spring.io/guides/gs/accessing-data-rest/)
* [Accessing Neo4j Data with REST](https://spring.io/guides/gs/accessing-neo4j-data-rest/)
* [Accessing MongoDB Data with REST](https://spring.io/guides/gs/accessing-mongodb-data-rest/)

Loading

0 comments on commit d64899f

Please sign in to comment.