diff --git a/.ci/github.gitlab-ci.yml b/.ci/github.gitlab-ci.yml new file mode 100644 index 00000000..01190486 --- /dev/null +++ b/.ci/github.gitlab-ci.yml @@ -0,0 +1,19 @@ +include: + - local: .ci/commons.gitlab-ci.yml + +###################################### +### Sync master branch with Github ### +###################################### +push-github: + stage: sync + rules: + #- !reference [.default-rules, run-on-master] + - !reference [.default-rules, run-on-mr] + script: + - ./.ci/scripts/github-push.sh + secrets: + CLOUDFLARED_DEPLOY_SSH_KEY: + # vault: gitlab/cloudflare/tun/cloudflared/_branch/master/cloudflared_github_ssh/data@kv + vault: gitlab/cloudflare/tun/cloudflared/_dev/cloudflared_github_ssh/data@kv + file: false + cache: {} diff --git a/.ci/scripts/github-push.sh b/.ci/scripts/github-push.sh new file mode 100755 index 00000000..df61d5ef --- /dev/null +++ b/.ci/scripts/github-push.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -e -o pipefail + +mkdir -p tmp + +echo "$CLOUDFLARED_DEPLOY_SSH_KEY" > tmp/github-deploy-key +chmod 400 tmp/github-deploy-key + +ssh-keyscan -t rsa github.com > tmp/github.pub + +export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=$PWD/tmp/github.pub -o IdentitiesOnly=yes -i $PWD/tmp/github-deploy-key" + +git remote add github git@github.com:cloudflare/cloudflared.git || true +#git push -u github master +#if TAG="$(git describe --tags --exact-match 2>/dev/null)"; then +# git push -u github "$TAG" +#fi + +git push -u github origin/joaocarlos/TUN-9800-migrate-github-push-to-gitlab diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 09826a2c..e37eb564 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,7 @@ default: VAULT_ID_TOKEN: aud: https://vault.cfdata.org -stages: [pre-build, build, validate, test, package, release] +stages: [sync, pre-build, build, validate, test, package, release] include: ##################################################### @@ -15,27 +15,32 @@ include: ##################################################### - local: .ci/commons.gitlab-ci.yml + ##################################################### + ########### Sync Repository with Github ############# + ##################################################### + - local: .ci/github.gitlab-ci.yml + ##################################################### ############# Build or Fetch CI Image ############### ##################################################### - - local: .ci/ci-image.gitlab-ci.yml + #- local: .ci/ci-image.gitlab-ci.yml ##################################################### ################## Linux Builds ################### ##################################################### - - local: .ci/linux.gitlab-ci.yml + #- local: .ci/linux.gitlab-ci.yml ##################################################### ################## Windows Builds ################### ##################################################### - - local: .ci/windows.gitlab-ci.yml + #- local: .ci/windows.gitlab-ci.yml ##################################################### ################### macOS Builds #################### ##################################################### - - local: .ci/mac.gitlab-ci.yml + #- local: .ci/mac.gitlab-ci.yml ##################################################### ################# Release Packages ################## ##################################################### - - local: .ci/release.gitlab-ci.yml + #- local: .ci/release.gitlab-ci.yml