Loading .gitlab-ci.yml +3 −2 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ build:web: tags: - generic_privileged before_script: - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - echo $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY script: - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG . - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG Loading Loading @@ -62,13 +62,14 @@ test:unit: - echo "$SSH_KNOWN_HOSTS" > $HOME/.ssh/known_hosts - chmod 600 ~/.ssh/id_ed25519 - chmod 644 ~/.ssh/known_hosts ~/.ssh/id_ed25519.pub - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - echo $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY script: - echo "Deploying to ($SSH_USER@$BACKEND_HOST)" - ssh $SSH_USER@$BACKEND_HOST "cd $DEPLOYMENT_PATH && git stash && git fetch && git fetch --tags -f && git checkout $SPOT_COMMIT && git reset --hard && mv docker-compose.prod.yml docker-compose.yml" - scp $ENV_FILE $SSH_USER@$BACKEND_HOST:$DEPLOYMENT_PATH/.env - ssh $SSH_USER@$BACKEND_HOST "cd $DEPLOYMENT_PATH && sed -i 's/SPOT_DOCKER_TAG=master/SPOT_DOCKER_TAG=$SPOT_DOCKER_TAG/g' .env && sed -i "s/GATEWAY_WG_IP/$GATEWAY_WG_IP/g" etc/nginx/nginx.conf && docker-compose pull && sleep 2 && docker-compose up -d --remove-orphans && docker-compose restart spot-nginx" deploy:spot.murenatest.io.backend1: Loading docker-compose.prod.yml +1 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ services: - ./etc/nginx/nginx.conf:/etc/nginx/nginx.conf - ./etc/nginx/proxy_spot_params:/etc/nginx/proxy_spot_params - ./searx/static:/var/www/spot/static - ${LOG_DIRECTORY}:/var/log/nginx/ labels: - "com.centurylinklabs.watchtower.scope=staging-spot" Loading etc/nginx/nginx.conf +6 −6 Original line number Diff line number Diff line Loading @@ -14,12 +14,12 @@ http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$remote_addr"'; set_real_ip_from GATEWAY_WG_IP; real_ip_header X-Forwarded-For; real_ip_recursive on; error_log stderr warn; access_log /dev/stdout main; error_log /var/log/nginx/spot-error.log warn; access_log /var/log/nginx/spot-access.log; sendfile on; #tcp_nopush on; Loading Loading
.gitlab-ci.yml +3 −2 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ build:web: tags: - generic_privileged before_script: - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - echo $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY script: - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG . - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG Loading Loading @@ -62,13 +62,14 @@ test:unit: - echo "$SSH_KNOWN_HOSTS" > $HOME/.ssh/known_hosts - chmod 600 ~/.ssh/id_ed25519 - chmod 644 ~/.ssh/known_hosts ~/.ssh/id_ed25519.pub - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - echo $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY script: - echo "Deploying to ($SSH_USER@$BACKEND_HOST)" - ssh $SSH_USER@$BACKEND_HOST "cd $DEPLOYMENT_PATH && git stash && git fetch && git fetch --tags -f && git checkout $SPOT_COMMIT && git reset --hard && mv docker-compose.prod.yml docker-compose.yml" - scp $ENV_FILE $SSH_USER@$BACKEND_HOST:$DEPLOYMENT_PATH/.env - ssh $SSH_USER@$BACKEND_HOST "cd $DEPLOYMENT_PATH && sed -i 's/SPOT_DOCKER_TAG=master/SPOT_DOCKER_TAG=$SPOT_DOCKER_TAG/g' .env && sed -i "s/GATEWAY_WG_IP/$GATEWAY_WG_IP/g" etc/nginx/nginx.conf && docker-compose pull && sleep 2 && docker-compose up -d --remove-orphans && docker-compose restart spot-nginx" deploy:spot.murenatest.io.backend1: Loading
docker-compose.prod.yml +1 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ services: - ./etc/nginx/nginx.conf:/etc/nginx/nginx.conf - ./etc/nginx/proxy_spot_params:/etc/nginx/proxy_spot_params - ./searx/static:/var/www/spot/static - ${LOG_DIRECTORY}:/var/log/nginx/ labels: - "com.centurylinklabs.watchtower.scope=staging-spot" Loading
etc/nginx/nginx.conf +6 −6 Original line number Diff line number Diff line Loading @@ -14,12 +14,12 @@ http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$remote_addr"'; set_real_ip_from GATEWAY_WG_IP; real_ip_header X-Forwarded-For; real_ip_recursive on; error_log stderr warn; access_log /dev/stdout main; error_log /var/log/nginx/spot-error.log warn; access_log /var/log/nginx/spot-access.log; sendfile on; #tcp_nopush on; Loading