From e1d92e6f50d593eb2bea640dce07ebd10c8c5942 Mon Sep 17 00:00:00 2001 From: Enes Erk Date: Tue, 11 Oct 2022 08:54:28 +0200 Subject: [PATCH] feat: Adds execution of elasticsearch index building Adds execution of elasticsearch index building --- .github/workflows/InitNeos.yml | 38 ++++++++++++++++++++++++++++++++++ ReadMe.md | 12 ++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/.github/workflows/InitNeos.yml b/.github/workflows/InitNeos.yml index 6fe6b01..9bccf6f 100644 --- a/.github/workflows/InitNeos.yml +++ b/.github/workflows/InitNeos.yml @@ -25,6 +25,14 @@ on: default: false required: false type: boolean + exec_elasticsearch_index: + default: false + required: false + type: boolean + exec_elasticsearch_queue: + default: false + required: false + type: boolean secrets: HOST: required: true @@ -112,3 +120,33 @@ jobs: then exit 1 fi + - name: Build Elasticsearch Index (Classic) + if: ${{ inputs.exec_elasticsearch_index }} + uses: appleboy/ssh-action@c732d38392bd59adadcb5e688fb1f7f1d29c6951 + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.AVENCY_SSH_KEY }} + timeout: 120s + script: | + phpContainerID=$(docker ps -aqf "name=${{ inputs.containername }}") + docker exec $phpContainerID su -c "/data/flow nodeindex:build --workspace live" -s /bin/sh www-data + if [ $? != 0 ] + then + exit 1 + fi + - name: Build Elasticsearch Index (Queue) + if: ${{ inputs.exec_elasticsearch_queue }} + uses: appleboy/ssh-action@c732d38392bd59adadcb5e688fb1f7f1d29c6951 + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.AVENCY_SSH_KEY }} + timeout: 120s + script: | + phpContainerID=$(docker ps -aqf "name=${{ inputs.containername }}") + docker exec $phpContainerID su -c "/data/flow nodeindexqueue:build --workspace live" -s /bin/sh www-data + if [ $? != 0 ] + then + exit 1 + fi diff --git a/ReadMe.md b/ReadMe.md index 93521d1..1466d52 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -22,6 +22,8 @@ jobs: exec_migrate_database: true exec_publish_resource: true exec_command_migration: false + exec_elasticsearch_index: false + exec_elasticsearch_queue: false secrets: host: ${{ secrets.HOST }} username: ${{ secrets.USERNAME }} @@ -54,4 +56,12 @@ Publishes the static resources. #### exec_command_migration -Executes pending command migrations. [Requires additional Package](https://github.com/swisscomeventandmedia/Swisscom.CommandMigration) \ No newline at end of file +Executes pending command migrations. [Requires additional Package](https://github.com/swisscomeventandmedia/Swisscom.CommandMigration) + +#### exec_elasticsearch_index + +Builds an ElasticSearch Index. Can not be used with `exec_elasticsearch_queue`. [Requires additional Package](https://github.com/Flowpack/Flowpack.ElasticSearch.ContentRepositoryAdaptor) + +#### exec_elasticsearch_queue + +Builds an Elasticsearch Queue Index. Can not be used with `exec_elasticsearch_index`. [Requires additional Package](https://github.com/Flowpack/Flowpack.ElasticSearch.ContentRepositoryQueueIndexer) \ No newline at end of file