fix: configure Docker insecure registry on deploy
Some checks failed
CI/CD Pipeline / Build & Push Images (push) Has been cancelled
CI/CD Pipeline / Deploy (dev) (push) Has been cancelled
CI/CD Pipeline / Deploy (prod) (push) Has been cancelled
CI/CD Pipeline / Run Tests (push) Has been cancelled
CI/CD Pipeline / Code Quality Checks (push) Has been cancelled
Some checks failed
CI/CD Pipeline / Build & Push Images (push) Has been cancelled
CI/CD Pipeline / Deploy (dev) (push) Has been cancelled
CI/CD Pipeline / Deploy (prod) (push) Has been cancelled
CI/CD Pipeline / Run Tests (push) Has been cancelled
CI/CD Pipeline / Code Quality Checks (push) Has been cancelled
Co-Authored-By: Warp <agent@warp.dev>
This commit is contained in:
@@ -197,6 +197,11 @@ jobs:
|
||||
|
||||
ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=no "${DEPLOY_USER}@${DEPLOY_HOST}" "
|
||||
set -e
|
||||
# Configure insecure registry if not already configured
|
||||
if ! grep -q '${REGISTRY_HOST}' /etc/docker/daemon.json 2>/dev/null; then
|
||||
echo '{\"insecure-registries\": [\"${REGISTRY_HOST}\"]}' | sudo tee /etc/docker/daemon.json
|
||||
sudo systemctl restart docker
|
||||
fi
|
||||
cd /opt/mostovik-backend
|
||||
echo '${REGISTRY_PASSWORD}' | docker login --username '${REGISTRY_USER}' --password-stdin ${REGISTRY_HOST}
|
||||
export IMAGE_TAG=${BRANCH_TAG}
|
||||
@@ -246,6 +251,11 @@ jobs:
|
||||
|
||||
ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=no "${DEPLOY_USER}@${DEPLOY_HOST}" "
|
||||
set -e
|
||||
# Configure insecure registry if not already configured
|
||||
if ! grep -q '${REGISTRY_HOST}' /etc/docker/daemon.json 2>/dev/null; then
|
||||
echo '{\"insecure-registries\": [\"${REGISTRY_HOST}\"]}' | sudo tee /etc/docker/daemon.json
|
||||
sudo systemctl restart docker
|
||||
fi
|
||||
cd /opt/mostovik-backend
|
||||
echo '${REGISTRY_PASSWORD}' | docker login --username '${REGISTRY_USER}' --password-stdin ${REGISTRY_HOST}
|
||||
export IMAGE_TAG=${BRANCH_TAG}
|
||||
|
||||
Reference in New Issue
Block a user