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
Best Practices
jupytext
Commits
c89e6381
Commit
c89e6381
authored
Feb 07, 2022
by
Cyril Matthey-Doret
Browse files
Add scheduled update in .gitlab-ci.yml file
parent
b0390d95
Pipeline
#315637
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
c89e6381
...
...
@@ -5,6 +5,7 @@ variables:
stages
:
-
build
-
pull_upstream
image_build
:
stage
:
build
...
...
@@ -14,4 +15,36 @@ image_build:
script
:
|
CI_COMMIT_SHA_7=$(echo $CI_COMMIT_SHA | cut -c1-7)
docker build --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA_7 .
docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA_7
\ No newline at end of file
docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA_7
pull_jupytext_github
:
stage
:
pull_upstream
script
:
|
whoami
printenv
CI_PUSH_REPO=$(echo $CI_REPOSITORY_URL | perl -pe 's#.*@(.+?(\:\d+)?)/#git@\1:#')
git remote set-url --push origin "${CI_PUSH_REPO}"
git config user.name "Gitlab CI"
git config user.email "tokenowner@email.com"
# runner runs on a detached HEAD, create a temporary local branch for editing
git checkout -b ci_processing
# update jupytext submodule
git submodule foreach git pull origin main
git add jupytext
git commit -m "sync: jupytext@$(git submodule status | sed 's/^ *//' | head -c8)"
# push changes
# always return true so that the build does not fail if there are no changes
git push origin ci_processing:${CI_BUILD_REF_NAME} || true
only
:
refs
:
-
schedules
variables
:
-
$SCHEDULE_TYPE == "check_upstream"
allow_failure
:
false
Write
Preview
Markdown
is supported
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