diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ed513c23cb8b667d853609c73aa37b6159667f06..7daf34c0a7c24d621ce331a90c8093198ed8ade8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,16 +11,19 @@ build-test: - apk add python3 - apk add py3-pip - apk add py3-yaml + - apk add openssh-client script: - hugo --config config.toml -D --destination=./public -pages: +deploy_cpanel: before_script: - apk update - apk add git - apk add python3 - apk add py3-pip - apk add py3-yaml + - apk add openssh-client + - apk add curl script: - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ics.muni.cz/cloud/hiera.git - sed -i '11,$d' content/cloud/flavors/index.md @@ -29,10 +32,21 @@ pages: - cat flavors.csv >> content/cloud/flavors/index.md - echo "{{</csv-table>}}" >> content/cloud/flavors/index.md - cat content/cloud/flavors/index.md + - sed -i -e "s/BUILDIDTAG/$CI_COMMIT_SHORT_SHA/g" ./layouts/partials/site-footer.html - hugo --config config.toml -D --destination=./public - artifacts: - paths: - - public + - eval $(ssh-agent -s) + - echo "$SSH_PRIVATE_KEY_cpanel" | tr -d '\r' | ssh-add - + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + - echo "$SSH_KNOWN_HOSTS_cpanel" >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + - ssh docscloudmuni@docs.cloud.muni.cz 'mkdir ~/tmpdeploy' + - scp -r ./public/* docscloudmuni@docs.cloud.muni.cz:~/tmpdeploy + - ssh docscloudmuni@docs.cloud.muni.cz 'mv ~/public_html ~/todelete && mv ~/tmpdeploy ~/public_html && rm -rf ~/todelete' + - sleep 5 + - latest_commit=$(git log -1 --pretty=format:%h ) + - "curl -H 'Cache-Control: no-cache' https://docs.cloud.muni.cz | grep $latest_commit" only: - - master \ No newline at end of file + - master + diff --git a/config.toml b/config.toml index 7d8bb15ce9a15918112e5b94ef13864a611fb972..a71582badbdce0aee1d2b45365b3ac4e3c15ffd9 100644 --- a/config.toml +++ b/config.toml @@ -1,4 +1,4 @@ -baseURL = "https://cloud.gitlab-pages.ics.muni.cz/documentation/" +baseURL = "https://docs.cloud.muni.cz/" languageCode = "en-us" title = "Metacentrum Cloud Documentation" theme = "hugo-geekdoc" diff --git a/layouts/partials/site-footer.html b/layouts/partials/site-footer.html index c56671ed46dc65ab9b41465c047ba0e74255345f..18d1549ffbe926605a2caf7e26e3cd66ec000ebe 100644 --- a/layouts/partials/site-footer.html +++ b/layouts/partials/site-footer.html @@ -1,6 +1,6 @@ <footer class="gdoc-footer"> <div class="container flex flex-wrap"> - + build: BUILDIDTAG {{ with .Site.Params.GeekdocLegalNotice }} <span class="gdoc-footer__item"> <a href="{{ . | relURL }}" class="gdoc-footer__link">Legal Notice</a>