Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Caosdb Versions
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
Caosdb Versions
Commits
81d7435f
Verified
Commit
81d7435f
authored
2 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
PIPELINE: switch to commits API
parent
c9f7ca61
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#31548
failed
2 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+4
-6
4 additions, 6 deletions
.gitlab-ci.yml
with
4 additions
and
6 deletions
.gitlab-ci.yml
+
4
−
6
View file @
81d7435f
...
...
@@ -17,12 +17,10 @@ add-commit:
-
echo "test" >> test.tsv
-
PRIVATE_TOKEN_HEADER='PRIVATE-TOKEN:'
-
CONTENT_TYPE_HEADER='Content-Type:'
-
BRANCH='"branch":'
-
AUTHOR_EMAIL='"author_email":'
-
AUTHOR_NAME='"author_name":'
-
CONTENT='"content":'
-
COMMIT_MESSAGE='"commit_message":'
-
curl --fail-with-body --request PUT --header "$PRIVATE_TOKEN_HEADER $CIPRIVATETOKEN" --header "$CONTENT_TYPE_HEADER application/json" --data "{$BRANCH \"main\", $AUTHOR_EMAIL \"author@example.com\", $AUTHOR_NAME \"Ms C. I. Pipeline\", $CONTENT \"$(cat test.tsv)\", $COMMIT_MESSAGE \"update test.tsv\"}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/repository/files/test%2Etsv"
-
echo '{"branch"
:
"
main"
,
"
commit_message"
:
"
new
commit
via
ci
pipeline"
,
"
actions"
:
[
{
"
action"
:
"
update"
,
"
file_path"
:
"
test.tsv"
,
"
encoding"
:
"
base64"
,
"
content"
:
"
'
>
commit.json
-
base64
test.tsv
>>
commit.json
-
echo
'"
}
]
}
'
>>
commit.json
-
curl
--fail-with-body
--request
POST
--header
"$PRIVATE_TOKEN_HEADER
$CIPRIVATETOKEN"
--header
"$CONTENT_TYPE_HEADER
application/json"
--data
"$(cat
commit.json)"
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/repository/commits"
pages:
rules:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment