Skip to content

Instantly share code, notes, and snippets.

@Aricg
Created September 5, 2019 22:09
Show Gist options
  • Save Aricg/212b9865ab051b65e378058d32513301 to your computer and use it in GitHub Desktop.
Save Aricg/212b9865ab051b65e378058d32513301 to your computer and use it in GitHub Desktop.
#!/bin/bash -l
# SPDX-License-Identifier: EPL-1.0
##############################################################################
# Copyright (c) 2017 The Linux Foundation and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
##############################################################################
#sudo yum install python34 python34-devel python34-pip python34-setuptools python34-virtualenv
sudo yum -y install python36 python36-devel python36-pip python36-setuptools python36-virtualenv
ls /usr/bin/python*
ls -la /opt/pyenv/versions/
ls /usr/bin/pip*
sudo alternatives --list | grep -i python
sudo alternatives --install /usr/bin/python python /usr/bin/python3.6 2
sudo alternatives --install /usr/bin/python python /usr/bin/python2.7 1
echo "Check alias"
pip3.6 --version
python --version
python -m venv ~/.venv
source ~/.venv/bin/activate
pip install --upgrade pip
pip install yq
git clone "https://gerrit.linuxfoundation.org/infra/releng/lftools"
cd lftools
git fetch "https://gerrit.linuxfoundation.org/infra/releng/lftools" refs/changes/23/61523/11 && git checkout FETCH_HEAD
pip install -e .
lftools --help
echo "---> rtd-verify.sh"
set -xe -o pipefail
echo "---> Generating docs"
pip install tox
tox -edocs
echo "$PROJECT"
project_dashed="${PROJECT////-}"
umbrella="$(echo "$GERRIT_URL" | awk -F"." '{print $2}')"
if [[ "$(lftools rtd project-details "$umbrella"-"$project_dashed" | yq -r '.detail')" == "Not found." ]]; then
echo Project not found, creating project;
lftools rtd project-create "$project_dashed-test" "$GERRIT_URL/$PROJECT" git "https://$umbrella-$project_dashed-test.readthedocs.io" py en
fi
sleep 10
lftools rtd project-build-trigger "$project_dashed-test" master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment