feat: removing apiConfig.json adding it to CICD variables

- fix(ci_functions.sh/cicd): Using SH safe vars style
This commit is contained in:
Josepablo C
2025-09-08 21:39:40 -06:00
parent 84c2371f3c
commit bc7c4031cc
5 changed files with 36 additions and 79 deletions

View File

@@ -10,16 +10,21 @@ CONTAINER_VERSION="latest"
function build_docker(){
#Global ENV VAR: REGISTRY_NAME
#Global ENV VAR: CONTAINER_NAME
if [[ $# -lt 1 ]]; then
echo $0 "[conatiner name]"
#Global ENV VAR: CICD_APICONFIG
if [[ $# -lt 2 ]]; then
echo $0 "[conatiner name] [apiconfig in base64]"
return -1
fi
CONTAINER_NAME=$1
cat src/config/apiConfig.json > src/config/apiConfig_local.json
APICONFIG_BASE64=$2
echo ${APICONFIG_BASE64} > config.tmp
base64 -d config.tmp > src/config/apiConfig_local.json
rm config.tmp
set -x
docker rmi -f "$REGISTRY_NAME/$CONTAINER_NAME"
docker buildx build --no-cache -t $REGISTRY_NAME/$CONTAINER_NAME ./
docker rmi -f "${REGISTRY_NAME}/${CONTAINER_NAME}"
docker buildx build --no-cache -t ${REGISTRY_NAME}/${CONTAINER_NAME} ./
set +x
}
@@ -27,9 +32,9 @@ function upload_image(){
#Global ENV VAR: REGISTRY_NAME
#Global ENV VAR: CICD_REGISTRY_TOKEN
#Global ENV VAR: CONTAINER_NAME
docker login $REGISTRY_SERVER -u "$REGISTRY_USER" -p "$CICD_REGISTRY_TOKEN"
docker login ${REGISTRY_SERVER} -u "${REGISTRY_USER}" -p "${CICD_REGISTRY_TOKEN}"
set -x
docker push "$REGISTRY_NAME/$CONTAINER_NAME":$CONTAINER_VERSION
docker push "${REGISTRY_NAME}/${CONTAINER_NAME}":${CONTAINER_VERSION}
set +x
}

0
v1/src/config/.gitkeep Normal file
View File

View File

@@ -1,54 +0,0 @@
{
"authentication": {
"pwdSecret":"Nx2g_IWo2Zt_LS$+",
"jwtSecret":"9o3BBz0EsrwXliwEJ/SFuywZoN8=",
"jwtTimeout":24,
"jwtRenewalTimeout":720,
"tokenSecret":"9Z'jMt|(h_f(&/S+zv.K",
"jwtOptions": {
"header": {
"typ": "access"
},
"audience": "https://www.etaviaporte.com",
"issuer": "etaviaporte",
"algorithm": "HS256",
"expiresIn": "1d"
}
},
"version" : {
"version" : "1.5.11",
"name": "ETA Beta",
"date":"22/07/2025"
},
"S3" : {
"bucket": "etaviaporte",
"load_attachments_key":"loadattachments",
"news_key":"news",
"driver":{
"minio":{
"endPoint": "api.minio.cloud.etaviaporte.com",
"port": 443,
"useSSL": true,
"accessKey": "Ygw68RydX2mvktAwjFEj",
"secretKey": "FERMPPXAu68YWgu4enWUeZPINRcjIrhw8BaQM6ur"
}
}
},
"sendgrid" : {
"HOST": "smtp.sendgrid.net",
"PORT": "465",
"username": "apikey",
"API_KEY": "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",
"FROM": "noreply@etaviaporte.com"
},
"email_standalone" : {
"host": "smtp.hostinger.com",
"port": "465",
"secure": true,
"auth": {
"user": "noreply@etaviaporte.com",
"pass": "-)WJt[oP~P$`76Q4"
}
},
"mongodb": "mongodb+srv://enruta_admin:NeptFx4RUZG8OsfA@enruta.vwofshy.mongodb.net/enrutaviaporte?retryWrites=true&w=majority"
}