From 4d7170b5cf23e80ebc1ac7b7d782d4a40871ce83 Mon Sep 17 00:00:00 2001 From: "Rodriguez, Kelvin" Date: Thu, 14 Sep 2023 18:23:54 +0000 Subject: [PATCH] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..ab39f0e --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,30 @@ +image: ubuntu:18.04 + +clone_github: + stage: deploy + before_script: + - apt-get update -y && apt-get install openssh-client -y + - apt install git -y + - eval $(ssh-agent -s) + - echo "$GIT_SSH_PRIVATE_KEY" | openssl base64 -A -d | ssh-add - + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + - ssh-keyscan $GIT_LAB_HOST >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + - git config --global user.name "${GIT_USER_NAME}" + - git config --global user.email "${GIT_USER_EMAIL}" + - ssh "git@$GIT_LAB_HOST" + script: + - echo $SOURCE_REPOSITORY + - git config --global http.sslVerify false + - rm -rf spiceql # Needed to allow multiple CI runs + - git config --global user.name "${GIT_USER_NAME}" + - git config --global user.email "${GIT_USER_EMAIL}" + - git clone --mirror $SOURCE_REPOSITORY spiceql + - cd spiceql + - git remote remove origin + - git remote add origin $DESTINATION_REPOSITORY + - git push -f --prune --all + - git push -f --prune --tags + only: + - branches -- GitLab