image: docker:stable workflow: rules: - if: $CI_PIPELINE_SOURCE == "push" when: never - if: $CI_PIPELINE_SOURCE == "schedule" when: always stages: - main main-job: stage: main before_script: - apk update && apk add git jq make curl python3 bash openssh-client - git config user.email "_@users.noreply.gitlab.com" - git config user.name "Snapshot Automation Bot" - git remote add cdci_origin git@gitlab.com:$CI_PROJECT_PATH.git - eval `ssh-agent -s` - echo "${SSH_PRIVATE_KEY_TOOLKIT}" | tr -d '\r' | ssh-add - > /dev/null - echo "${SSH_PRIVATE_KEY_MIRROR}" | tr -d '\r' | ssh-add - > /dev/null - mkdir -p ~/.ssh - chmod 700 ~/.ssh - touch ~/.ssh/config - echo -e "Host gitlab.com\n\tStrictHostKeyChecking no" >> ~/.ssh/config - echo "$SSH_KNOWN_HOSTS_MIRROR" >> ~/.ssh/known_hosts - chmod 600 ~/.ssh/config ~/.ssh/known_hosts script: - git checkout gitlab - make clean - make - git add --all - git commit -sm 'Data snapshot commit' - git push cdci_origin gitlab - ssh -T cdci@embla.dev.snart.me