Commit bc43b409 authored by Denis Konovalyenko's avatar Denis Konovalyenko

#25: an okapi snapshot trigger job added.

parent cbd71d1c
......@@ -8,15 +8,24 @@
# - snapshot
# - release
#
# On pushing to the code repository the "verification" job is run.
# The trigger stage jobs:
# - okapi-snapshot-trigger
#
# Normally, on pushing to the code repository the "verification" job is run.
#
# If a branch is a "snapshot branch", then the "snapshot" job is run.
# If a branch is a "tag", then the "release" job is run.
#
# If a branch is a "snapshot branch", then the "okapi-snapshot-trigger"
# job is run.
#
# If any of the jobs fails, no other consequential job is run.
#
stages:
- verification
- deployment
- trigger
variables:
CI_GITLAB_PATH: "ci/gitlab"
......@@ -56,13 +65,8 @@ verification:
- ${HOME}/target/
policy: pull
script:
- openssl ${OPENSSL_CLI_OPTS} -d -in ${CI_GITLAB_PATH}/code-signing-key.asc.enc -out ${CI_GITLAB_PATH}/code-signing-key.asc
- gpg --quiet --batch --import ${CI_GITLAB_PATH}/code-signing-key.asc
- echo "use-agent" > ${HOME}/{GPG_CONF}
- echo "pinentry-mode loopback" >> ${HOME}/${GPG_CONF}
- echo "allow-loopback-pinentry" > ${HOME}/${GPG_AGENT_CONF}
- ${CI_GITLAB_PATH}/gpg-import
- mvn deploy ${MAVEN_CLI_OPTS} -DskipITs -Dmaven.test.skip=true --activate-profiles sign_and_deploy,release #--quiet
- curl -X POST -F token=${OKAPI_TRIGGER_TOKEN} -F ref=${OKAPI_SNAPSHOTS_BRANCH} https://gitlab.com/api/v4/projects/${OKAPI_PROJECT_ID}/trigger/pipeline
- touch ${CI_GITLAB_PATH}/${CI_JOB_NAME}-passed
snapshot:
......@@ -80,3 +84,19 @@ release:
- tags
except:
- branches
.trigger: &trigger
stage: trigger
image: ${BASH_CURL_IMAGE}
okapi-snapshot-trigger:
<<: *trigger
script:
- curl -X POST -F token=${OKAPI_TRIGGER_TOKEN} -F ref=${OKAPI_SNAPSHOTS_BRANCH} https://gitlab.com/api/v4/projects/${OKAPI_PROJECT_ID}/trigger/pipeline
- touch ${CI_GITLAB_PATH}/${CI_JOB_NAME}-passed
only:
variables:
- $SNAPSHOTS_BRANCH == $CI_COMMIT_REF_NAME
except:
- tags
- master
......@@ -24,7 +24,6 @@ BITBUCKET_STATUS_API="$BITBUCKET_API_ROOT/repositories/$BITBUCKET_NAMESPACE/$BIT
BITBUCKET_KEY="ci/gitlab/$CI_JOB_NAME"
BITBUCKET_NAME="$CI_JOB_STAGE:$CI_JOB_NAME:$BUILD_STATUS"
BITBUCKET_DESCRIPTION="Pipeline #$CI_PIPELINE_ID"
GITLAB_URL=$CI_JOB_URL
case "$BUILD_STATUS" in
running)
......
#!/usr/bin/env bash
openssl ${OPENSSL_CLI_OPTS} -d -in ${CI_GITLAB_PATH}/code-signing-key.asc.enc -out ${CI_GITLAB_PATH}/code-signing-key.asc
gpg --quiet --batch --import ${CI_GITLAB_PATH}/code-signing-key.asc
echo "use-agent" > ${HOME}/{GPG_CONF}
echo "pinentry-mode loopback" >> ${HOME}/${GPG_CONF}
echo "allow-loopback-pinentry" > ${HOME}/${GPG_AGENT_CONF}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment