Merge branch 'master' into 7-assign-team-to-repo
This commit is contained in:
commit
1e838031e1
@ -1,17 +1,20 @@
|
|||||||
stages:
|
stages:
|
||||||
- test
|
|
||||||
- build
|
- build
|
||||||
- sign
|
- sign
|
||||||
- publish
|
- publish
|
||||||
|
|
||||||
test:
|
on_setup:
|
||||||
image: nextcloudci/android:android-49
|
image: tutum/curl
|
||||||
stage: test
|
stage: .pre
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
- tags
|
- tags
|
||||||
|
variables:
|
||||||
|
INSTANCE: "https://codeberg.org"
|
||||||
|
MAIN_REPO: gitnex/GitNex
|
||||||
|
STATE: pending
|
||||||
script:
|
script:
|
||||||
- ./gradlew test
|
- ./scripts/add_commit_status.sh
|
||||||
|
|
||||||
build:
|
build:
|
||||||
image: nextcloudci/android:android-49
|
image: nextcloudci/android:android-49
|
||||||
@ -67,3 +70,31 @@ release:
|
|||||||
script:
|
script:
|
||||||
- "[[ $CI_COMMIT_REF_NAME == *'-rc'* ]] && echo 'Upload blocked. Build seems to be a release candidate.' && exit 0"
|
- "[[ $CI_COMMIT_REF_NAME == *'-rc'* ]] && echo 'Upload blocked. Build seems to be a release candidate.' && exit 0"
|
||||||
- curl -T "$PLUGIN_FILE" -u "$WEBDAV_USERNAME":"$WEBDAV_PASSWORD" 'https://cloud.swatian.com/remote.php/dav/files/GitNexBot/gitnex/releases/'"$CI_COMMIT_REF_NAME"'.apk'
|
- curl -T "$PLUGIN_FILE" -u "$WEBDAV_USERNAME":"$WEBDAV_PASSWORD" 'https://cloud.swatian.com/remote.php/dav/files/GitNexBot/gitnex/releases/'"$CI_COMMIT_REF_NAME"'.apk'
|
||||||
|
|
||||||
|
on_success:
|
||||||
|
image: tutum/curl
|
||||||
|
stage: .post
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
- tags
|
||||||
|
variables:
|
||||||
|
INSTANCE: "https://codeberg.org"
|
||||||
|
MAIN_REPO: gitnex/GitNex
|
||||||
|
STATE: success
|
||||||
|
script:
|
||||||
|
- ./scripts/add_commit_status.sh
|
||||||
|
when: on_success
|
||||||
|
|
||||||
|
on_failure:
|
||||||
|
image: tutum/curl
|
||||||
|
stage: .post
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
- tags
|
||||||
|
variables:
|
||||||
|
INSTANCE: "https://codeberg.org"
|
||||||
|
MAIN_REPO: gitnex/GitNex
|
||||||
|
STATE: failure
|
||||||
|
script:
|
||||||
|
- ./scripts/add_commit_status.sh
|
||||||
|
when: on_failure
|
||||||
|
29
scripts/add_commit_status.sh
Normal file
29
scripts/add_commit_status.sh
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Environment variables which have to be set in order for this to work properly
|
||||||
|
# @author opyale
|
||||||
|
#
|
||||||
|
# INSTANCE (e.g. https://codeberg.org)
|
||||||
|
# MAIN_REPO (e.g. gitnex/GitNex)
|
||||||
|
# STATE (e.g. pending, success, error, failure or warning)
|
||||||
|
# CI_COMMIT_SHA; BOT_TOKEN
|
||||||
|
|
||||||
|
context="GitLab CI"
|
||||||
|
description="GitLab continuous integration tool"
|
||||||
|
state=$STATE
|
||||||
|
target_url="https://gitlab.com/opyale/gitnex/-/pipelines"
|
||||||
|
|
||||||
|
body='
|
||||||
|
{
|
||||||
|
"context": "'$context'",
|
||||||
|
"description": "'$description'",
|
||||||
|
"state": "'$state'",
|
||||||
|
"target_url": "'$target_url'"
|
||||||
|
}
|
||||||
|
'
|
||||||
|
|
||||||
|
curl --request POST \
|
||||||
|
--data "$body" \
|
||||||
|
--header "Accept: application/json" \
|
||||||
|
--header "Content-Type: application/json" \
|
||||||
|
"${INSTANCE}/api/v1/repos/${MAIN_REPO}/statuses/${CI_COMMIT_SHA}?token=${BOT_TOKEN}"
|
Loading…
x
Reference in New Issue
Block a user