From 98bea3f421920cc43a45186d6ff930c0cd8e2ec8 Mon Sep 17 00:00:00 2001 From: Fascinated Date: Sat, 14 Jan 2023 00:21:01 +0000 Subject: [PATCH] Update file .gitlab-ci.yml --- .gitlab-ci.yml | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8e12124..cb871ae 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,26 +1,24 @@ -publish: - image: docker:latest - stage: build - variables: - DOCKER_DRIVER: overlay - before_script: - - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - script: - - docker build --pull -t "$CI_REGISTRY_IMAGE" . - - docker push "$CI_REGISTRY_IMAGE" - only: - - main +stages: + - First + - Second -deploy: - image: alpine:latest - stage: deploy - tags: +cache: + key: ${CI_COMMIT_REF_SLUG} + paths: + - workdir/ + +First: + stage: First + image: + name: docker:latest + entrypoint: ["/bin/sh", "-c"] script: - - chmod og= $ID_RSA - - apk update && apk add openssh-client - - ssh -i $ID_RSA -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP "cd /home/overlay && docker compose pull && docker compose up -d && docker image prune -f" - environment: - name: production - url: https://bs-overlay.fascinated.cc - only: - - main \ No newline at end of file + - mkdir -p workdir + - echo "asdf" > workdir/r.txt + + +Second: + stage: Second + image: alpine + script: + - cat workdir/r.txt