From 41437647b035562baca49442d736474c01e7f443 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Fri, 25 Oct 2024 12:21:19 +0530 Subject: [PATCH] Create stack for laconic shopify --- .../docker-compose-laconic-shopify.yml | 20 +++++++++++++++++++ .../laconic-shopify/product_pricings.json | 6 ++++++ .../config/laconic-shopify/start-shopify.sh | 19 ++++++++++++++++++ .../cerc-laconic-shopify/Dockerfile | 9 +++++++++ .../cerc-laconic-shopify/build.sh | 5 +++++ .../stacks/laconic-shopify/README.md | 1 + .../stacks/laconic-shopify/stack.yml | 9 +++++++++ 7 files changed, 69 insertions(+) create mode 100644 stack-orchestrator/compose/docker-compose-laconic-shopify.yml create mode 100644 stack-orchestrator/config/laconic-shopify/product_pricings.json create mode 100755 stack-orchestrator/config/laconic-shopify/start-shopify.sh create mode 100644 stack-orchestrator/container-build/cerc-laconic-shopify/Dockerfile create mode 100755 stack-orchestrator/container-build/cerc-laconic-shopify/build.sh create mode 100644 stack-orchestrator/stacks/laconic-shopify/README.md create mode 100644 stack-orchestrator/stacks/laconic-shopify/stack.yml diff --git a/stack-orchestrator/compose/docker-compose-laconic-shopify.yml b/stack-orchestrator/compose/docker-compose-laconic-shopify.yml new file mode 100644 index 0000000..a832c60 --- /dev/null +++ b/stack-orchestrator/compose/docker-compose-laconic-shopify.yml @@ -0,0 +1,20 @@ +services: + shopify: + restart: unless-stopped + image: cerc/laconic-shopify:local + command: ["bash", "-c", "./start-faucet.sh"] + environment: + CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG} + CERC_SHOPIFY_SHOP_NAME: ${CERC_SHOPIFY_SHOP_NAME} + CERC_SHOPIFY_ACCESS_TOKEN: ${CERC_SHOPIFY_ACCESS_TOKEN} + CERC_FETCH_ORDER_DELAY: ${CERC_FETCH_ORDER_DELAY} + CERC_FAUCET_URL: ${CERC_FAUCET_URL} + volumes: + - shopify-data:/app/data + - ../config/laconic-shopify/start-shopify.sh:/app/start-faucet.sh + - ../config/laconic-shopify/product_pricings.json:/app/config/product_pricings.json + extra_hosts: + - "host.docker.internal:host-gateway" + +volumes: + shopify-data: \ No newline at end of file diff --git a/stack-orchestrator/config/laconic-shopify/product_pricings.json b/stack-orchestrator/config/laconic-shopify/product_pricings.json new file mode 100644 index 0000000..75c4073 --- /dev/null +++ b/stack-orchestrator/config/laconic-shopify/product_pricings.json @@ -0,0 +1,6 @@ +{ + "10 webapp deployments": "100000", + "100 webapp deployments": "1000000", + "500 webapp deployments": "5000000", + "1000 webapp deployments": "10000000" +} \ No newline at end of file diff --git a/stack-orchestrator/config/laconic-shopify/start-shopify.sh b/stack-orchestrator/config/laconic-shopify/start-shopify.sh new file mode 100755 index 0000000..b25c3cb --- /dev/null +++ b/stack-orchestrator/config/laconic-shopify/start-shopify.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e +set -u +if [ -n "$CERC_SCRIPT_DEBUG" ]; then + set -x +fi + +echo "Shopify shop name: $CERC_SHOPIFY_SHOP_NAME" +echo "Shopify access token: $CERC_SHOPIFY_ACCESS_TOKEN" +echo "Fetch order delay: $CERC_FETCH_ORDER_DELAY" +echo "Faucet URL: $CERC_FAUCET_URL" + +export SHOPIFY_SHOP_NAME=$CERC_SHOPIFY_SHOP_NAME +export SHOPIFY_ACCESS_TOKEN=$CERC_SHOPIFY_ACCESS_TOKEN +export FETCH_ORDER_DELAY=$CERC_FETCH_ORDER_DELAY +export FAUCET_URL=$CERC_FAUCET_URL + +yarn start \ No newline at end of file diff --git a/stack-orchestrator/container-build/cerc-laconic-shopify/Dockerfile b/stack-orchestrator/container-build/cerc-laconic-shopify/Dockerfile new file mode 100644 index 0000000..97c6636 --- /dev/null +++ b/stack-orchestrator/container-build/cerc-laconic-shopify/Dockerfile @@ -0,0 +1,9 @@ +FROM node:20-bullseye + +WORKDIR /app + +COPY . . + +RUN yarn install + +CMD ["yarn", "start"] diff --git a/stack-orchestrator/container-build/cerc-laconic-shopify/build.sh b/stack-orchestrator/container-build/cerc-laconic-shopify/build.sh new file mode 100755 index 0000000..c383f4b --- /dev/null +++ b/stack-orchestrator/container-build/cerc-laconic-shopify/build.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Build cerc/laconic-faucet +source ${CERC_CONTAINER_BASE_DIR}/build-base.sh +docker build -t cerc/laconic-shopify:local ${build_command_args} ${CERC_REPO_BASE_DIR}/laconic-shopify diff --git a/stack-orchestrator/stacks/laconic-shopify/README.md b/stack-orchestrator/stacks/laconic-shopify/README.md new file mode 100644 index 0000000..7727887 --- /dev/null +++ b/stack-orchestrator/stacks/laconic-shopify/README.md @@ -0,0 +1 @@ +# laconic-shopify diff --git a/stack-orchestrator/stacks/laconic-shopify/stack.yml b/stack-orchestrator/stacks/laconic-shopify/stack.yml new file mode 100644 index 0000000..3b5fcbf --- /dev/null +++ b/stack-orchestrator/stacks/laconic-shopify/stack.yml @@ -0,0 +1,9 @@ +version: "1.0" +name: laconic-shopify +description: "Service that integrates a Shopify app with the Laconic wallet." +repos: + - git.vdb.to/cerc-io/laconic-shopify +containers: + - cerc/laconic-shopify +pods: + - laconic-shopify