diff --git a/TEMPLATE/Makefile b/TEMPLATE/Makefile index c271688..a2cfbd8 100644 --- a/TEMPLATE/Makefile +++ b/TEMPLATE/Makefile @@ -1,3 +1,4 @@ include ../common.mk -SERVICE_NAME=assemblyline-service-template +AL_SERVICE_NAME=Template +# SERVICE_NAME=assemblyline-service-template diff --git a/TEMPLATE/README.md b/TEMPLATE/README.md index 83cd8ac..839723a 100644 --- a/TEMPLATE/README.md +++ b/TEMPLATE/README.md @@ -1 +1 @@ -# assemblyline-service-template \ No newline at end of file +# al-name-template \ No newline at end of file diff --git a/TEMPLATE/service_manifest.yml b/TEMPLATE/service_manifest.yml index befa05e..cd57c44 100644 --- a/TEMPLATE/service_manifest.yml +++ b/TEMPLATE/service_manifest.yml @@ -1,4 +1,4 @@ -name: assemblyline-service-template +name: al-name-template version: 4.4.0.stable$VERSION description: FIXME enabled: true diff --git a/common.mk b/common.mk index ab1f68c..8a0b2e6 100644 --- a/common.mk +++ b/common.mk @@ -1,10 +1,13 @@ REGISTRY?= PUSH_REGISTRY?= BASE_IMAGE?=${REGISTRY}/cccs/assemblyline-v4-service-base:stable -SERVICE_NAME=assemblyline-service-template +AL_SERVICE_NAME=Template +SERVICE_NAME=assemblyline-service-$(shell echo ${AL_SERVICE_NAME} | tr '[:upper:]' '[:lower:]') BASE_TAG?=4.4.0.stable manifest: + sed -i "s/al-name-template/${AL_SERVICE_NAME}/g" service_manifest.yml + sed -i "s/al-name-template/${AL_SERVICE_NAME}/g" README.md sed -i "s/assemblyline-service-template/${SERVICE_NAME}/g" service_manifest.yml sed -i "s/assemblyline-service-template/${SERVICE_NAME}/g" README.md @@ -26,14 +29,33 @@ push: build tag release: bump_version push +COMMAND= +ARGS= +CONTAINER_NAME=${SERVICE_NAME} +CONTAINER_NETWORK=al_registration run: build - docker run --rm --env SERVICE_API_HOST=http://al_service_server:5003 --network=al_registration -e LOG_LEVEL=DEBUG --name ${SERVICE_NAME} kam193/${SERVICE_NAME}:latest + docker run --rm --env SERVICE_API_HOST=http://al_service_server:5003 --network=${CONTAINER_NETWORK} \ + -e LOG_LEVEL=DEBUG \ + -v "${PWD}/../config.yml:/etc/assemblyline/config.yml" \ + -e AL_SERVICE_NAME=${AL_SERVICE_NAME} \ + ${ARGS} \ + --name ${CONTAINER_NAME} kam193/${SERVICE_NAME}:latest ${COMMAND} run-with-host: build - docker run --rm --env SERVICE_API_HOST=http://al_service_server:5003 --network=al_registration --add-host=host.docker.internal:host-gateway -e LOG_LEVEL=DEBUG --name ${SERVICE_NAME} kam193/${SERVICE_NAME}:latest +run-with-host: ARGS=--add-host=host.docker.internal:host-gateway +run-with-host: run + +run-updater: build +run-updater: COMMAND=python -m service.updater +run-updater: CONTAINER_NAME=${SERVICE_NAME}_update +run-updater: CONTAINER_NETWORK=external +run-updater: run refresh: CACHE="--no-cache" refresh: build test: true + +print: + echo ${SERVICE_NAME} diff --git a/config.yml b/config.yml new file mode 100644 index 0000000..6fc43d7 --- /dev/null +++ b/config.yml @@ -0,0 +1,46 @@ +core: + alerter: + delay: 0 + metrics: + apm_server: + server_url: null # http://apm_server:8200/ + elasticsearch: + hosts: [http://elastic:devpass@elasticsearch:9200] + redis: + host: redis + redis: + nonpersistent: + host: redis + persistent: + host: redis + port: 6379 + +datastore: + hosts: [http://elastic:devpass@elasticsearch:9200] + +filestore: + cache: + [ + "s3://al_storage_key:Ch@ngeTh!sPa33w0rd@minio:9000?s3_bucket=al-cache&use_ssl=False", + ] + storage: + [ + "s3://al_storage_key:Ch@ngeTh!sPa33w0rd@minio:9000?s3_bucket=al-storage&use_ssl=False", + ] + # cache: + # - file:///home/kamil/Devel/lab-analysing-pkgs/assemblyline/var/cache/assemblyline + +logging: + export_interval: 30 + log_to_console: true + log_to_file: false + log_to_syslog: false + +services: + preferred_update_channel: dev + allow_insecure_registry: true + image_variables: + PRIVATE_REGISTRY: $PRIVATE_REGISTRY + +ui: + enforce_quota: false