From 2e923d3abb8cb3d564327975587b8f9ceab76550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=83=D1=80=D0=B4=D0=B5=D0=BD=D0=BA=D0=BE=20=D0=90?= =?UTF-8?q?=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Thu, 14 Aug 2025 09:16:56 +0300 Subject: [PATCH] up ci --- ci/deploy/deploy-cloud.inc.yml | 40 +++++++++++++++++++++++++++++----- ci/rules.yml | 5 +---- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/ci/deploy/deploy-cloud.inc.yml b/ci/deploy/deploy-cloud.inc.yml index 4b0c626..6eb51ee 100644 --- a/ci/deploy/deploy-cloud.inc.yml +++ b/ci/deploy/deploy-cloud.inc.yml @@ -1,11 +1,41 @@ -deploy-cloud: +deploy-test-stand: stage: deploy + image: harbor.vimpelcom.ru/dockerhub/library/alpine + variables: + stand: cloud-stand.vega-dev.cloud.vimpelcom.ru rules: - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS when: never - if: $CI_COMMIT_BRANCH && $CI_PIPELINE_SOURCE == "merge_request_event" + when: never + - if: $CI_PIPELINE_SOURCE == "push" when: manual - - if: $CI_PIPELINE_SOURCE == "push" && ($CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "feature/ci") - when: manual - extends: - - .deploy-template + before_script: + - | + sed -i s%https://dl-cdn.alpinelinux.org/%http://rhrepo.vimpelcom.ru/ext/ya/mirrors/% /etc/apk/repositories && \ + apk --no-cache add tzdata ca-certificates curl openssh-client yq jq && \ + rm -rf /var/cache/apk/* + - which ssh-agent || (apt-get update -y && apt-get install openssh-client -y) + - eval $(ssh-agent -s) + - mkdir -p ~/.ssh + - echo -n "$TECH_SSH_KEY" | tr -d '\r' > ~/.ssh/id_rsa + - chmod 700 ~/.ssh + - chmod 600 ~/.ssh/id_rsa + - > + echo "stand: ${stand}" + ssh-keyscan "${stand}" >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + script: + - > + echo -e "Connect to ${stand}..." && + scp -o StrictHostKeyChecking=no ci/deploy/deploy.sh "dorootless@${stand}:~/deploy.sh" && + ssh "dorootless@${stand}" "export CONTAINER_REGISTRY=$CONTAINER_REGISTRY && + export PRODUCT=$PRODUCT && + export PRODUCT_VERSION=$PRODUCT_VERSION && + export IMAGE_NAME=$IMAGE_NAME && + chmod 700 ~/deploy.sh && + ~/deploy.sh ${IMAGE_NAME} && + rm -f ~/deploy.sh" + needs: + - job: build-image-npm + optional: true diff --git a/ci/rules.yml b/ci/rules.yml index 9849945..3e2516e 100644 --- a/ci/rules.yml +++ b/ci/rules.yml @@ -2,7 +2,4 @@ rules: - if: $CI_COMMIT_BRANCH && $CI_PIPELINE_SOURCE == "merge_request_event" when: never - - if: $CI_PIPELINE_SOURCE == "push" && ($CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "feature/ci") - exists: - - .npmrc - - ./*/.npmrc + - if: $CI_PIPELINE_SOURCE == "push"