add docker swarm deployment configs and remove dependency on kaniko for ci builds
This commit is contained in:
@@ -20,5 +20,5 @@ RUN --mount=type=cache,mode=0755,target=/root/.cache/pip pip install \
|
||||
--extra-index-url $EXTRA_INDEX_URL -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN chmod +x scripts/*
|
||||
ENTRYPOINT [ ]
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
# syntax = docker/dockerfile:1.2
|
||||
FROM registry.gitlab.com/grassrootseconomics/cic-base-images:python-3.8.6-dev-5ab8bf45
|
||||
|
||||
WORKDIR /root
|
||||
|
||||
RUN mkdir -vp /usr/local/etc/cic
|
||||
|
||||
COPY package.json \
|
||||
package-lock.json \
|
||||
.
|
||||
|
||||
RUN npm install
|
||||
|
||||
COPY requirements.txt .
|
||||
|
||||
ARG EXTRA_INDEX_URL="https://pip.grassrootseconomics.net:8433"
|
||||
ARG GITLAB_PYTHON_REGISTRY="https://gitlab.com/api/v4/projects/27624814/packages/pypi/simple"
|
||||
RUN pip install \
|
||||
--extra-index-url $GITLAB_PYTHON_REGISTRY \
|
||||
--extra-index-url $EXTRA_INDEX_URL -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
ENTRYPOINT [ ]
|
||||
12
apps/data-seeding/scripts/run_job.sh
Normal file
12
apps/data-seeding/scripts/run_job.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
#! /bin/bash
|
||||
|
||||
if [[ $((RUN_MASK & 3)) -eq 3 ]]
|
||||
then
|
||||
>&2 echo -e "\033[;96mRUNNING\033[;39m RUN_MASK 3 - data seeding"
|
||||
./scripts/run_ussd_user_imports.sh
|
||||
if [ $? -ne "0" ]; then
|
||||
>&2 echo -e "\033[;31mFAILED\033[;39m RUN_MASK 3 - data seeding"
|
||||
exit 1;
|
||||
fi
|
||||
>&2 echo -e "\033[;32mSUCCEEDED\033[;39m RUN_MASK 3 - data seeding"
|
||||
fi
|
||||
@@ -1,8 +1,33 @@
|
||||
#! /bin/sh
|
||||
#! /bin/bash
|
||||
|
||||
set -u
|
||||
set -e
|
||||
|
||||
contract_migration_complete=0
|
||||
retry_count=0
|
||||
retry_sleep=30 #seconds
|
||||
retry_limit="$((${TIMEOUT_MINUTES:-10}*60/2))"
|
||||
while [[ $contract_migration_complete -ne 1 ]]
|
||||
do
|
||||
if [[ -f "$CIC_DATA_DIR/.env" ]] && grep -q CIC_DECLARATOR_ADDRESS $CIC_DATA_DIR/.env
|
||||
then
|
||||
echo "🤜💥🤛 data-seeding found the output of contract-migration!"
|
||||
source /tmp/cic/config/.env
|
||||
env
|
||||
contract_migration_complete=1
|
||||
elif [[ $retry_count -ge $retry_limit ]]
|
||||
then
|
||||
echo "😢 data-seeding timeout waiting for contract migration to finish." >&2
|
||||
exit 1
|
||||
else
|
||||
echo "⏳ data-seeding waiting for contract-migration output $retry_count:$retry_limit ..."
|
||||
((retry_count= $retry_count + $retry_sleep))
|
||||
sleep $retry_sleep
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
|
||||
while getopts ":n:o:g:" opt; do
|
||||
case $opt in
|
||||
n) NUMBER_OF_USERS="$OPTARG"
|
||||
|
||||
Reference in New Issue
Block a user