Skip to content
Snippets Groups Projects
Commit 7dcf7710 authored by Nathan Rodet's avatar Nathan Rodet
Browse files

fix: added condition to bash script, to add the case of unique instance deployment

parent c42654a4
Branches main
No related tags found
No related merge requests found
Pipeline #108802 failed
......@@ -9,7 +9,7 @@ apps: # optional : applications served by atrium
icon: terminal
color: 4292030255
is_proxy: true
host: terminal-%atrium_count_index%
host: terminal%-atrium_count_index%
target: localhost:8081
secured: true
login: admin
......@@ -20,4 +20,4 @@ users:
- login: admin
password: %user_password_hash%
roles:
- ADMINS
\ No newline at end of file
- ADMINS
......@@ -5,6 +5,7 @@
#
export USER_PASSWORD_HASH=$(echo -n "$(scw-userdata user_password)" | argon2 "$(echo $RANDOM | md5sum | head -c 12)" -id -l 32 -e)
export ATRIUM_COUNT_INDEX=$(scw-userdata atrium_count_index)
mkdir -p /root/atrium/data && mkdir -p /root/atrium/letsencrypt_cache
curl https://forge.grandlyon.com/systemes-dinformation/alpha/pocs/cloud-machinist/cloud-machinist-templates/scaleway-instances-template/-/raw/main/instance-scripts/config-files/atrium.yaml -o root/atrium/atrium.yaml
......@@ -12,7 +13,14 @@ curl https://forge.grandlyon.com/systemes-dinformation/alpha/pocs/cloud-machinis
sed -i "s|%atrium_hostname%|$(scw-userdata atrium_hostname)|g" /root/atrium/atrium.yaml
sed -i "s|%project_domain%|$(scw-userdata project_domain)|g" /root/atrium/atrium.yaml
sed -i "s|%atrium_letsencrypt_email%|$(scw-userdata atrium_letsencrypt_email)|g" /root/atrium/atrium.yaml
sed -i "s|%atrium_count_index%|$(scw-userdata atrium_count_index)|g" /root/atrium/atrium.yaml
if [ "$ATRIUM_COUNT_INDEX" -eq 0 ]; then
sed -i "s|%-atrium_count_index%||g" /root/atrium/atrium.yaml
echo "test1"
else
# Apply this if the value is greater than 0
sed -i "s|%-atrium_count_index%|-$(scw-userdata atrium_count_index)|g" /root/atrium/atrium.yaml
echo "test2"
fi
sed -i "s|%user_password_hash%|$USER_PASSWORD_HASH|g" /root/atrium/atrium.yaml
sed -i "s|%user_password%|$(scw-userdata user_password)|g" /root/atrium/atrium.yaml
chown -Rf 1000:1000 /root/atrium
......@@ -29,3 +37,6 @@ docker run -d --name atrium \
-v /root/atrium/data:/app/data nicolaspernoud/atrium:latest
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment