Skip to content
Snippets Groups Projects
Commit 41f6ebd7 authored by Luigi Sbailo's avatar Luigi Sbailo
Browse files

Merge branch 'staging' into 'master'

Insert CI update of metainfo in GUI

See merge request !92
parents d0ceca8d 64b49261
Branches
No related tags found
1 merge request!92Insert CI update of metainfo in GUI
......@@ -67,6 +67,7 @@ deploy to production:
script:
- ./.gitlab-ci/update_tag_production.sh
- ./.gitlab-ci/update_tag_app.sh
- ./.gitlab-ci/update_metainfo_gui.sh
environment:
name: production
url: https://nomad-lab.eu/prod/analytics/hub
......
# !/bin/bash
# Based on: https://docs.gitlab.com/ee/ci/ssh_keys/README.html
# Install ssh-agent if not already installed, it is required by Docker.
# (change apt-get to yum if you use an RPM-based image)
# - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
# Run ssh-agent (inside the build environment)
eval $(ssh-agent -s)
# Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
# We're using tr to fix line endings which makes ed25519 keys work
# without extra base64 encoding.
# https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_48526556
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
# Create the SSH directory and give it the right permissions
mkdir -p ~/.ssh
chmod 700 ~/.ssh
# Use ssh-keyscan to scan the keys of your private server.
ssh-keyscan gitlab.mpcdf.mpg.de >> ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
# Set the user name and email.
git config --global user.name $GITLAB_USER_NAME
git config --global user.email $GITLAB_USER_EMAIL
# Clone the private repositories
git clone git@gitlab.mpcdf.mpg.de:nomad-lab/aitoolkit-gui.git /tmp/aitoolkit-gui
git clone --recurse git@gitlab.mpcdf.mpg.de:nomad-lab/analytics.git /tmp/analytics
# Create new metainfo based on staging version
cd /tmp/analytics
git checkout staging
python generate_tutorials_json.py > toolkitMetadata.json
# Copy new metainfo if files are different
cd /tmp
if ! cmp analytics/toolkitMetadata.json aitoolkit-gui/src/toolkitMetadata.json~ >/dev/null 2>&1
then
echo 'Update GUI with new metadata'
cp analytics/toolkitMetadata.json aitoolkit-gui/src/toolkitMetadata.json
cd /tmp/aitoolkit-gui
git add src/toolkitMetadata.json
git commit -m "CI: Update metainfo in the GUI"
git push
fi
rm -rf /tmp
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment