chore: Update Dockerfile to use .env file for environment variables
Build and Push Docker Images / build-and-push (push) Successful in 7m52s
Build and Push Docker Images / build-and-push (push) Successful in 7m52s
This commit is contained in:
@@ -23,8 +23,6 @@ if [ -z $GIT_EMAIL ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Ensure the SSH key has the correct permissions
|
# Ensure the SSH key has the correct permissions
|
||||||
chmod 600 /root/.ssh/id_rsa
|
chmod 600 /root/.ssh/id_rsa
|
||||||
|
|
||||||
@@ -38,14 +36,14 @@ if [ ! -d "/workspace/.git" ]; then
|
|||||||
HostName $DOMAIN
|
HostName $DOMAIN
|
||||||
IdentityFile /root/.ssh/id_rsa
|
IdentityFile /root/.ssh/id_rsa
|
||||||
StrictHostKeyChecking no
|
StrictHostKeyChecking no
|
||||||
" >> /root/.ssh/config
|
" >>/root/.ssh/config
|
||||||
# Clone the repository if it doesn't exist
|
# Clone the repository if it doesn't exist
|
||||||
git clone $REPO_URL /workspace
|
git clone $REPO_URL /workspace
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add the public SSH key to authorized_keys
|
# Add the public SSH key to authorized_keys
|
||||||
if [ -f /root/.ssh/hostkey.pub ]; then
|
if [ -f /root/.ssh/hostkey.pub ]; then
|
||||||
cat /root/.ssh/hostkey.pub >> /root/.ssh/authorized_keys
|
cat /root/.ssh/hostkey.pub >>/root/.ssh/authorized_keys
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Change to the repository directory
|
# Change to the repository directory
|
||||||
@@ -59,8 +57,7 @@ if [ -f /environment/.dev.env ]; then
|
|||||||
mkdir -p /workspace/environments
|
mkdir -p /workspace/environments
|
||||||
cp /environment/.dev.env /workspace/environments/.dev.env
|
cp /environment/.dev.env /workspace/environments/.dev.env
|
||||||
else
|
else
|
||||||
echo "Error: Environment file not found at /environment/.dev.env"
|
echo "Environment file not found at /environment/.dev.env"
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
# Set the git user and email
|
# Set the git user and email
|
||||||
git config --global user.name $GIT_USER
|
git config --global user.name $GIT_USER
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
2.0
|
||||||
Reference in New Issue
Block a user