64 lines
2.5 KiB
YAML
64 lines
2.5 KiB
YAML
|
|
tasks:
|
||
|
|
- checkout:
|
||
|
|
force-clean-build: 'true'
|
||
|
|
- script: |
|
||
|
|
#!/bin/bash
|
||
|
|
set -x
|
||
|
|
|
||
|
|
# Parse minor version from semantic version
|
||
|
|
MINOR_VERSION=$(echo "${bamboo.inject.gtag}" | grep -Eo "^[0-9]+\.[0-9]+")
|
||
|
|
|
||
|
|
# Inject version numbers into documentation
|
||
|
|
sed -i "s/{{ release_version }}/${bamboo.inject.gtag}/g;s/{{ minor_version }}/${MINOR_VERSION}/g" README.md
|
||
|
|
sed -i "s/{{ release_version }}/${bamboo.inject.gtag}/g;s/{{ minor_version }}/${MINOR_VERSION}/g" docs/*.md
|
||
|
|
|
||
|
|
# Create temporary folder
|
||
|
|
mkdir -p ./vi_certs
|
||
|
|
|
||
|
|
# Download latest Vanderlande certificate authority certificates
|
||
|
|
curl https://pki.vanderlande.com/pki/VanderlandeRootCA.crt -o - | openssl x509 -inform DER -out ./vi_certs/VanderlandeRootCA.crt
|
||
|
|
curl https://pki.vanderlande.com/pki/VanderlandeSubordinateCA-Internal.crt -o ./vi_certs/VanderlandeSubordinateCA-Internal.crt
|
||
|
|
|
||
|
|
# Update README markdown file
|
||
|
|
docker run --rm --name confluence-docs-update \
|
||
|
|
-v "${bamboo.hostvolume}:/code" \
|
||
|
|
-v "${bamboo.hostvolume}/vi_certs:/usr/local/share/ca-certificates" \
|
||
|
|
-w /code \
|
||
|
|
"${bamboo.container_mark}" \
|
||
|
|
/bin/bash -c "\
|
||
|
|
update-ca-certificates && \
|
||
|
|
mark \
|
||
|
|
-u '${bamboo.confluence_username}' \
|
||
|
|
-p '${bamboo.confluence_password}' \
|
||
|
|
-b '${bamboo.confluence_url}' \
|
||
|
|
--title-from-h1 \
|
||
|
|
--space ${bamboo.confluence_space} \
|
||
|
|
--parents 'IT Technology Platform/Team Devcolla'\''s/Application Stack/Harvester Cloud Native Virtualization' \
|
||
|
|
--dry-run \
|
||
|
|
-f './README.md' || exit 1"
|
||
|
|
|
||
|
|
# Update all markdown files in docs/
|
||
|
|
docker run --rm --name confluence-docs-update \
|
||
|
|
-v "${bamboo.hostvolume}:/code" \
|
||
|
|
-v "${bamboo.hostvolume}/vi_certs:/usr/local/share/ca-certificates" \
|
||
|
|
-w /code \
|
||
|
|
"${bamboo.container_mark}" \
|
||
|
|
/bin/bash -c "\
|
||
|
|
update-ca-certificates && \
|
||
|
|
mark \
|
||
|
|
-u '${bamboo.confluence_username}' \
|
||
|
|
-p '${bamboo.confluence_password}' \
|
||
|
|
-b '${bamboo.confluence_url}' \
|
||
|
|
--ci --changes-only \
|
||
|
|
--title-from-h1 \
|
||
|
|
--space ${bamboo.confluence_space} \
|
||
|
|
--parents 'IT Technology Platform/Team Devcolla'\''s/Application Stack/Harvester Cloud Native Virtualization' \
|
||
|
|
--dry-run \
|
||
|
|
-f './docs/*.md' || exit 1"
|
||
|
|
|
||
|
|
other:
|
||
|
|
clean-working-dir: true
|
||
|
|
requirements:
|
||
|
|
- system.docker.executable
|
||
|
|
- AGENT_TYPE: Linux_Base_Agent
|