Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • hive/common-ci-configuration
1 result
Show changes
Commits on Source (3)
......@@ -111,16 +111,6 @@ else
git push origin "HEAD:main"
fi
if [ ${FINAL_MERGE} -eq 1 ]; then
DOC_URL="${PROJECT_URL}/-/wikis/home"
else
DOC_URL="${PROJECT_URL}/-/wikis/non-stable/${FEATURE_BRANCH_NAME}/home"
fi
perform_wiki_cleanup "${WIKI_REPO_DIR}/non-stable" "${PROJECT_URL}"
echo "Documentation is available at url: ${DOC_URL}"
popd
echo GEN_DOC_URL="${DOC_URL}" > "gen_doc.env"
#! /bin/bash
set -e
PROJECT_URL="${1:?Missing arg #1 pointing project url. It is provided by CI_PROJECT_URL variable}"
FEATURE_BRANCH_NAME="${2:?Missing arg #2 pointing a branch name}"
FINAL_MERGE="${3:?Missing arg #3 pointing the final merge flag value}"
if [ "${FINAL_MERGE}" = "true" ]; then
FINAL_MERGE=1
else
FINAL_MERGE=0
fi
if [ ${FINAL_MERGE} -eq 1 ]; then
DOC_URL="${PROJECT_URL}/-/wikis/home"
else
DOC_URL="${PROJECT_URL}/-/wikis/non-stable/${FEATURE_BRANCH_NAME}/home"
fi
echo "Documentation url: ${DOC_URL}"
export DOC_URL="${DOC_URL}"
echo GEN_DOC_URL="${DOC_URL}" > "gen_doc.env"
......@@ -3,7 +3,7 @@ include:
variables:
# uses registry.gitlab.syncad.com/hive/common-ci-configuration/emsdk:4.0.1-2
EMSCRIPTEN_IMAGE_TAG: "4.0.1-2@sha256:d0c5fbd811ef2447fdf411ee1e2a111c50ad0ec610cf3d6bf2d186530bc883ad"
EMSCRIPTEN_IMAGE_TAG: "4.0.1-2@sha256:ab2b543775ba9159e29086c87f1d8be7456fb4ba3ec30ec29716fc357e442c55"
EMSCRIPTEN_IMAGE: "registry.gitlab.syncad.com/hive/common-ci-configuration/emsdk:$EMSCRIPTEN_IMAGE_TAG"
.node_based_job_base:
......@@ -217,6 +217,31 @@ variables:
when: manual
allow_failure: true
.npm_generate_doc_url:
extends: .npm_process_built_package_tarball
variables:
# The directory containing sources to be built - it can be overrided by derived job
SOURCE_DIR: "${CI_PROJECT_DIR}"
PROJECT_URL: "${CI_PROJECT_URL}"
DIST_DIR: "$CI_PROJECT_DIR/dist"
PACKAGE_TGZ_PATH: "${BUILT_PACKAGE_PATH}"
# This variable will be set in after_script, so we can perform operations in "script:" stage based on it.
DOC_URL: ""
before_script:
# start always at project root dir, to make sure .env file (included in artifacts) is generated there
- cd "${CI_PROJECT_DIR}"
- /home/emscripten/scripts/npm_set_doc_url.sh "${PROJECT_URL}" "${CI_COMMIT_REF_NAME}" "${CI_COMMIT_REF_PROTECTED}"
artifacts:
reports:
dotenv:
- "gen_doc.env" # contains URL to generated documentation pointed by `GEN_DOC_URL` variable
when: always
expire_in: 1 week
# Allows to store generated documentation files inside a wiki repo specific to given project. Wiki repo must be explicitly created before using this job.
# Documentation files coming to protected branches are committed into root directory in the wiki repo. All other changes are pushed into non-stable/<branch-name> subdirectory what allows to render them by wiki.
.npm_push_doc_template:
......@@ -232,14 +257,5 @@ variables:
DIST_DIR: "$CI_PROJECT_DIR/dist"
script:
# start always at project root dir, to make sure .env file (included in artifacts) is generated there
- cd "${CI_PROJECT_DIR}"
- /home/emscripten/scripts/npm_push_doc.sh "${SOURCE_DIR}" "${PROJECT_URL}" "${WIKI_PUSH_TOKEN}" "${DIST_DIR}" "${CI_COMMIT_REF_NAME}" "${CI_COMMIT_REF_PROTECTED}"
artifacts:
reports:
dotenv:
- "gen_doc.env" # contains URL to generated documentation pointed by `GEN_DOC_URL` variable
when: always
expire_in: 1 week