Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bitcoin-dot-org
developer.bitcoin.org
Commits
625e6b6f
Commit
625e6b6f
authored
Dec 17, 2021
by
Melroy van den Berg
Browse files
Add gitlab ci
parent
813ba3fb
Pipeline
#3656
failed with stages
in 13 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
0 → 100644
View file @
625e6b6f
image
:
"
python:3-slim"
cache
:
paths
:
-
.cache/pip
stages
:
-
pull
-
build
-
deploy
build
:
rules
:
-
if
:
'
$CI_PIPELINE_SOURCE
!=
"schedule"'
stage
:
build
before_script
:
-
pip install -r requirements.txt
script
:
-
make html
variables
:
PIP_CACHE_DIR
:
"
$CI_PROJECT_DIR/.cache/pip"
artifacts
:
expire_in
:
1 month
paths
:
-
_build/html
deploy
:
rules
:
-
if
:
'
$CI_PIPELINE_SOURCE
!=
"schedule"
&&
$CI_PROJECT_NAMESPACE
==
"bitcoin-dot-org"
&&
$CI_COMMIT_BRANCH
==
$CI_DEFAULT_BRANCH'
stage
:
deploy
image
:
instrumentisto/rsync-ssh:latest
before_script
:
# Run ssh-agent
-
eval $(ssh-agent -s)
-
mkdir -p ~/.ssh && chmod 700 ~/.ssh
-
echo "${SSH_PRIVATE_KEY}" | base64 -d | ssh-add - > /dev/null
-
echo "${SSH_HOST_KEY}" > ~/.ssh/known_hosts
script
:
-
rsync -azhv --delete _build/html/ "${SSH_USER_HOST_LOCATION}"
repo_pull_sync
:
stage
:
pull
image
:
danger89/repo_mirror_pull:latest
rules
:
-
if
:
'
$CI_PIPELINE_SOURCE
==
"schedule"'
-
if
:
$REMOTE_URL
-
if
:
$REMOTE_BRANCH
-
if
:
$ACCESS_TOKEN
before_script
:
-
git config --global user.name "${GITLAB_USER_NAME}"
-
git config --global user.email "${GITLAB_USER_EMAIL}"
script
:
-
git checkout $CI_DEFAULT_BRANCH
-
git pull
-
git remote remove upstream ||
true
-
git remote add upstream $REMOTE_URL
-
git fetch upstream
-
git merge upstream/$REMOTE_BRANCH
-
git push "https://${GITLAB_USER_LOGIN}:${ACCESS_TOKEN}@${CI_REPOSITORY_URL#*@}" "HEAD:${CI_DEFAULT_BRANCH}"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment