summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml39
1 files changed, 39 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 00000000..c560737e
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,39 @@
+image: docker:stable
+
+workflow:
+ rules:
+ - if: $CI_COMMIT_BRANCH == "gitlab"
+
+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