Skip to content

Merge pull request #253 from DescartesResearch/master #132

Merge pull request #253 from DescartesResearch/master

Merge pull request #253 from DescartesResearch/master #132

Workflow file for this run

name: Development
on:
push:
branches-ignore:
- master
- main
jobs:
test_default:
name: Test default TeaStore
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- run: |
mvn clean install
cd tools/ && ./build_docker.sh && cd ..
sed -i 's/descartesresearch\///g' examples/docker/docker-compose_default.yaml
docker-compose -f examples/docker/docker-compose_default.yaml up -d
echo "Waiting 2 minutes for TeaStore to start." ; sleep 120
./tools/test_webui.sh localhost http 8080
docker-compose -f examples/docker/docker-compose_default.yaml down
test_https:
name: Test HTTPS TeaStore
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- run: |
mvn clean install
cd tools/ && ./build_docker.sh && cd ..
sed -i 's/descartesresearch\///g' examples/docker/docker-compose_https.yaml
docker-compose -f examples/docker/docker-compose_https.yaml up -d
echo "Waiting 2 minutes for TeaStore to start." ; sleep 120
./tools/test_webui.sh localhost https 8443
docker-compose -f examples/docker/docker-compose_https.yaml down
test_kieker:
name: Test TeaStore with Kieker monitoring
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- run: |
mvn clean install
cd tools/ && ./build_docker.sh && cd ..
sed -i 's/descartesresearch\///g' examples/docker/docker-compose_kieker.yaml
sed -i 's/descartesresearch\///g' examples/docker/docker-compose_rabbitmq.yaml
docker-compose -f examples/docker/docker-compose_rabbitmq.yaml up -d
echo "Waiting 2 minutes for RabbitMQ to start." ; sleep 120
docker-compose -f examples/docker/docker-compose_kieker.yaml up -d
echo "Waiting 2 minutes for TeaStore to start." ; sleep 120
./tools/test_webui.sh localhost http 8080
./tools/test_kieker.sh localhost 8081
docker-compose -f examples/docker/docker-compose_kieker.yaml down
docker-compose -f examples/docker/docker-compose_rabbitmq.yaml down
cypress-run:
name: Cypress run
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- run: |
mvn clean install
cd tools/ && ./build_docker.sh && cd ..
sed -i 's/descartesresearch\///g' examples/docker/docker-compose_default.yaml
docker-compose -f examples/docker/docker-compose_default.yaml up -d
- name: Cypress run
uses: cypress-io/github-action@v2
with:
working-directory: e2e-tests
wait-on: http://localhost:8080
wait-on-timeout: 120
- name: Cleanup docker
run: docker-compose -f examples/docker/docker-compose_default.yaml down --volumes --remove-orphans
if: ${{ always() }}
build:
name: Build and publish Docker images of TeaStore
runs-on: ubuntu-latest
if: success() && github.ref == 'refs/heads/development'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- run: |
mvn clean install -DskipTests
GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
echo "GIT_BRANCH=${GIT_BRANCH}"
echo "GIT_BRANCH=${GIT_BRANCH}" >> ${GITHUB_ENV}
sed -i "s/teastore-base:latest/teastore-base:${GIT_BRANCH}/g" services/tools.descartes.teastore.auth/Dockerfile
sed -i "s/teastore-base:latest/teastore-base:${GIT_BRANCH}/g" services/tools.descartes.teastore.image/Dockerfile
sed -i "s/teastore-base:latest/teastore-base:${GIT_BRANCH}/g" services/tools.descartes.teastore.persistence/Dockerfile
sed -i "s/teastore-base:latest/teastore-base:${GIT_BRANCH}/g" services/tools.descartes.teastore.recommender/Dockerfile
sed -i "s/teastore-base:latest/teastore-base:${GIT_BRANCH}/g" services/tools.descartes.teastore.registry/Dockerfile
sed -i "s/teastore-base:latest/teastore-base:${GIT_BRANCH}/g" services/tools.descartes.teastore.webui/Dockerfile
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push teastore-base
uses: docker/build-push-action@v2
with:
context: ./utilities/tools.descartes.teastore.dockerbase
push: true
tags: descartesresearch/teastore-base:${{env.GIT_BRANCH}}
- name: Build and push teastore-recommender
uses: docker/build-push-action@v2
with:
context: ./services/tools.descartes.teastore.recommender
push: true
tags: descartesresearch/teastore-recommender:${{env.GIT_BRANCH}}
- name: Build and push teastore-webui
uses: docker/build-push-action@v2
with:
context: ./services/tools.descartes.teastore.webui
push: true
tags: descartesresearch/teastore-webui:${{env.GIT_BRANCH}}
- name: Build and push teastore-image
uses: docker/build-push-action@v2
with:
context: ./services/tools.descartes.teastore.image
push: true
tags: descartesresearch/teastore-image:${{env.GIT_BRANCH}}
- name: Build and push teastore-auth
uses: docker/build-push-action@v2
with:
context: ./services/tools.descartes.teastore.auth
push: true
tags: descartesresearch/teastore-auth:${{env.GIT_BRANCH}}
- name: Build and push teastore-persistence
uses: docker/build-push-action@v2
with:
context: ./services/tools.descartes.teastore.persistence
push: true
tags: descartesresearch/teastore-persistence:${{env.GIT_BRANCH}}
- name: Build and push teastore-registry
uses: docker/build-push-action@v2
with:
context: ./services/tools.descartes.teastore.registry
push: true
tags: descartesresearch/teastore-registry:${{env.GIT_BRANCH}}
- name: Build and push teastore-db
uses: docker/build-push-action@v2
with:
context: ./utilities/tools.descartes.teastore.database
push: true
tags: descartesresearch/teastore-db:${{env.GIT_BRANCH}}
- name: Build and push teastore-kieker-rabbitmq
uses: docker/build-push-action@v2
with:
context: ./utilities/tools.descartes.teastore.kieker.rabbitmq
push: true
tags: descartesresearch/teastore-kieker-rabbitmq:${{env.GIT_BRANCH}}