forked from pyrocko/pyrocko
deployment: rework anaconda package building
parent
8d4ef8ebdb
commit
e017ebd554
@ -1,18 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
pyrockodir="pyrocko"
|
||||
|
||||
cd $HOME
|
||||
sudo yum -y install git gcc
|
||||
|
||||
if [ -e "$pyrockodir" ] ; then
|
||||
sudo rm -rf "$pyrockodir"
|
||||
fi
|
||||
|
||||
git clone "https://git.pyrocko.org/pyrocko/pyrocko.git" "$pyrockodir"
|
||||
cd "$pyrockodir/maintenance"
|
||||
|
||||
anaconda/deploy_anaconda3.sh
|
||||
anaconda/deploy_anaconda2.sh
|
@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
vagrant up
|
||||
vagrant ssh -- -t /vagrant/inside.sh
|
||||
vagrant halt
|
@ -1,17 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
pyrockodir="pyrocko"
|
||||
|
||||
cd $HOME
|
||||
|
||||
if [ -e "$pyrockodir" ] ; then
|
||||
sudo rm -rf "$pyrockodir"
|
||||
fi
|
||||
|
||||
git clone "https://github.com/pyrocko/pyrocko.git" "$pyrockodir"
|
||||
cd "$pyrockodir/maintenance"
|
||||
|
||||
anaconda/deploy_anaconda3.sh
|
||||
anaconda/deploy_anaconda2.sh
|
@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
vagrant up
|
||||
vagrant ssh -- -t /Users/vagrant/anaconda/inside.sh
|
||||
vagrant halt
|
@ -1,75 +0,0 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
# All Vagrant configuration is done below. The "2" in Vagrant.configure
|
||||
# configures the configuration version (we support older styles for
|
||||
# backwards compatibility). Please don't change it unless you know what
|
||||
# you're doing.
|
||||
Vagrant.configure("2") do |config|
|
||||
# The most common configuration options are documented and commented below.
|
||||
# For a complete reference, please see the online documentation at
|
||||
# https://docs.vagrantup.com.
|
||||
|
||||
# Every Vagrant development environment requires a box. You can search for
|
||||
# boxes at https://vagrantcloud.com/search.
|
||||
config.vm.box = "AndrewDryga/vagrant-box-osx"
|
||||
|
||||
# Disable automatic box update checking. If you disable this, then
|
||||
# boxes will only be checked for updates when the user runs
|
||||
# `vagrant box outdated`. This is not recommended.
|
||||
# config.vm.box_check_update = false
|
||||
|
||||
# Create a forwarded port mapping which allows access to a specific port
|
||||
# within the machine from a port on the host machine. In the example below,
|
||||
# accessing "localhost:8080" will access port 80 on the guest machine.
|
||||
# NOTE: This will enable public access to the opened port
|
||||
# config.vm.network "forwarded_port", guest: 80, host: 8080
|
||||
|
||||
# Create a forwarded port mapping which allows access to a specific port
|
||||
# within the machine from a port on the host machine and only allow access
|
||||
# via 127.0.0.1 to disable public access
|
||||
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
|
||||
|
||||
# Create a private network, which allows host-only access to the machine
|
||||
# using a specific IP.
|
||||
# config.vm.network "private_network", ip: "192.168.33.10"
|
||||
|
||||
# Create a public network, which generally matched to bridged network.
|
||||
# Bridged networks make the machine appear as another physical device on
|
||||
# your network.
|
||||
# config.vm.network "public_network"
|
||||
|
||||
# Share an additional folder to the guest VM. The first argument is
|
||||
# the path on the host to the actual folder. The second argument is
|
||||
# the path on the guest to mount the folder. And the optional third
|
||||
# argument is a set of non-required options.
|
||||
# config.vm.synced_folder "../data", "/vagrant_data"
|
||||
|
||||
# Provider-specific configuration so you can fine-tune various
|
||||
# backing providers for Vagrant. These expose provider-specific options.
|
||||
# Example for VirtualBox:
|
||||
#
|
||||
# config.vm.provider "virtualbox" do |vb|
|
||||
# # Display the VirtualBox GUI when booting the machine
|
||||
# vb.gui = true
|
||||
#
|
||||
# # Customize the amount of memory on the VM:
|
||||
# vb.memory = "1024"
|
||||
# end
|
||||
#
|
||||
# View the documentation for the provider you are using for more
|
||||
# information on available options.
|
||||
|
||||
# Enable provisioning with a shell script. Additional provisioners such as
|
||||
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
|
||||
# documentation for more information about their specific syntax and use.
|
||||
config.vm.synced_folder ".", "/Users/vagrant/anaconda",
|
||||
type: "rsync",
|
||||
rsync__chown: false
|
||||
config.vm.provision "shell", inline: <<-SHELL
|
||||
sudo chown -R vagrant:staff anaconda
|
||||
rm -rf anaconda/pyrocko.git/.git
|
||||
./anaconda/build_anaconda3.sh
|
||||
./anaconda/build_anaconda2.sh
|
||||
SHELL
|
||||
end
|
@ -1,44 +0,0 @@
|
||||
#!/bin/bash
|
||||
# To return a failure if any commands inside fail
|
||||
# More: https://conda.io/docs/user-guide/tutorials/build-pkgs.html
|
||||
set -e
|
||||
MINICONDA_URL="https://repo.continuum.io/miniconda"
|
||||
CONDA_PREFIX="$HOME/miniconda2"
|
||||
BUILD_DIR=`dirname $0`
|
||||
export PATH=$PATH:$CONDA_PREFIX/bin
|
||||
|
||||
if [ `uname` == "Darwin" ]; then
|
||||
MINICONDA_FILE="Miniconda2-latest-MacOSX-x86_64.sh"
|
||||
else
|
||||
MINICONDA_FILE="Miniconda2-latest-Linux-x86_64.sh"
|
||||
fi
|
||||
|
||||
# Install Miniconda
|
||||
read -r -p "Do you want to download and install $MINICONDA_FILE [y/N]?" resp
|
||||
case $resp in
|
||||
[yY][eE][sS]|[yY] )
|
||||
curl "$MINICONDA_URL/$MINICONDA_FILE" -o "$BUILD_DIR/miniconda.sh";
|
||||
chmod +x "$BUILD_DIR/miniconda.sh"
|
||||
./$BUILD_DIR/miniconda.sh -b -u
|
||||
conda install -y conda-build anaconda-client
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
# Install Anaconda client and build tools
|
||||
read -r -p "Do you want to upload pyrocko to Anaconda (https://anaconda.org/pyrocko/pyrocko) [y/N]?" resp
|
||||
case $resp in
|
||||
[yY][eE][sS]|[yY] )
|
||||
anaconda logout;
|
||||
anaconda login --username pyrocko;
|
||||
conda config --set anaconda_upload yes;
|
||||
;;
|
||||
* ) conda config --set anaconda_upload no;
|
||||
;;
|
||||
esac
|
||||
conda-build $BUILD_DIR
|
||||
|
||||
# Workaround for https://github.com/travis-ci/travis-ci/issues/6522
|
||||
# Turn off exit on failure.
|
||||
set +e
|
@ -1,45 +0,0 @@
|
||||
#!/bin/bash
|
||||
# To return a failure if any commands inside fail
|
||||
# More: https://conda.io/docs/user-guide/tutorials/build-pkgs.html
|
||||
set -e
|
||||
MINICONDA_URL="https://repo.continuum.io/miniconda"
|
||||
CONDA_PREFIX="$HOME/miniconda3"
|
||||
BUILD_DIR=`dirname $0`
|
||||
export PATH=$PATH:$CONDA_PREFIX/bin
|
||||
|
||||
if [ `uname` == "Darwin" ]; then
|
||||
MINICONDA_FILE="Miniconda3-latest-MacOSX-x86_64.sh"
|
||||
else
|
||||
MINICONDA_FILE="Miniconda3-latest-Linux-x86_64.sh"
|
||||
fi
|
||||
|
||||
# Install Miniconda
|
||||
read -r -p "Do you want to download and install $MINICONDA_FILE [y/N]?" resp
|
||||
case $resp in
|
||||
[yY][eE][sS]|[yY] )
|
||||
curl "$MINICONDA_URL/$MINICONDA_FILE" -o "$BUILD_DIR/miniconda.sh";
|
||||
chmod +x "$BUILD_DIR/miniconda.sh"
|
||||
./$BUILD_DIR/miniconda.sh -b -u
|
||||
conda install -y conda-build anaconda-client
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
# Install Anaconda client and build tools
|
||||
read -r -p "Do you want to upload pyrocko to Anaconda (https://anaconda.org/pyrocko/pyrocko) [y/N]?" resp
|
||||
case $resp in
|
||||
[yY][eE][sS]|[yY] )
|
||||
anaconda logout;
|
||||
anaconda login --username pyrocko;
|
||||
conda config --set anaconda_upload yes;
|
||||
;;
|
||||
* ) conda config --set anaconda_upload no;
|
||||
;;
|
||||
esac
|
||||
conda-build --python 3.6 $BUILD_DIR
|
||||
conda-build --python 3.7 $BUILD_DIR
|
||||
|
||||
# Workaround for https://github.com/travis-ci/travis-ci/issues/6522
|
||||
# Turn off exit on failure.
|
||||
set +e
|
@ -1,17 +0,0 @@
|
||||
#!/bin/bash
|
||||
if [ ! -f anaconda/deploy_anaconda2.sh ] ; then
|
||||
echo "must be run from pyrocko's maintenance directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
branch="$1"
|
||||
if [ -z "$branch" ]; then
|
||||
branch=master
|
||||
fi
|
||||
|
||||
echo "Building pyrocko for Anaconda2 on branch $branch"
|
||||
rm -rf "anaconda/pyrocko.git"
|
||||
git clone -b $branch "../" "anaconda/pyrocko.git"
|
||||
rm -rf "anaconda/pyrocko.git/maintenance/anaconda/meta.yaml"
|
||||
|
||||
anaconda/build_anaconda2.sh $1
|
@ -1,17 +0,0 @@
|
||||
#!/bin/bash
|
||||
if [ ! -f anaconda/deploy_anaconda3.sh ] ; then
|
||||
echo "must be run from pyrocko's maintenance directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
branch="$1"
|
||||
if [ -z "$branch" ]; then
|
||||
branch=master
|
||||
fi
|
||||
|
||||
echo "Building pyrocko for Anaconda3 on branch $branch"
|
||||
rm -rf "anaconda/pyrocko.git"
|
||||
git clone -b $branch "../" "anaconda/pyrocko.git"
|
||||
rm -rf "anaconda/pyrocko.git/maintenance/anaconda/meta.yaml"
|
||||
|
||||
anaconda/build_anaconda3.sh $1
|
@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
branch="$1"
|
||||
action="$2"
|
||||
|
||||
pyrockodir="pyrocko"
|
||||
|
||||
cd $HOME
|
||||
sudo yum -y install git gcc
|
||||
|
||||
if [ -e "$pyrockodir" ] ; then
|
||||
sudo rm -rf "$pyrockodir"
|
||||
fi
|
||||
|
||||
|
||||
git clone -b "$branch" /vagrant/pyrocko.git "$pyrockodir"
|
||||
cd "$pyrockodir/maintenance/conda"
|
||||
|
||||
source /vagrant/env.sh
|
||||
./build_packages.sh "$branch" "$action"
|
@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
vagrant halt
|
||||
|
||||
running=`vagrant global-status | grep running | grep conda/boxes/centos-7` || /bin/true
|
||||
|
||||
if [ ! -z "$running" ]; then
|
||||
echo "vagrant box already running:" $running
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -z "$(git status --untracked-files=no --porcelain)" ]; then
|
||||
echo "repos not clean"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -d "pyrocko.git" ]; then
|
||||
rm -rf "pyrocko.git"
|
||||
fi
|
||||
|
||||
branch=`git rev-parse --abbrev-ref HEAD`
|
||||
|
||||
action="$1"
|
||||
|
||||
if [ -z "$action" ] ; then
|
||||
echo "usage: outside.sh (dryrun|upload)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git clone --bare "../../../.." "pyrocko.git"
|
||||
|
||||
cat >env.sh <<EOF
|
||||
export CONDA_USERNAME=$CONDA_USERNAME
|
||||
export CONDA_PASSWORD=$CONDA_PASSWORD
|
||||
EOF
|
||||
|
||||
vagrant up
|
||||
|
||||
set +e
|
||||
vagrant ssh -- -t /vagrant/inside.sh "$branch" "$action"
|
||||
STATE=$?
|
||||
set -e
|
||||
|
||||
rm env.sh
|
||||
|
||||
vagrant halt
|
||||
exit $STATE
|
@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
branch="$1"
|
||||
action="$2"
|
||||
|
||||
pyrockodir="pyrocko"
|
||||
|
||||
cd $HOME
|
||||
|
||||
if [ -e "$pyrockodir" ] ; then
|
||||
sudo rm -rf "$pyrockodir"
|
||||
fi
|
||||
|
||||
|
||||
git clone -b "$branch" /vagrant/pyrocko.git "$pyrockodir"
|
||||
cd "$pyrockodir/maintenance/conda"
|
||||
|
||||
source /vagrant/env.sh
|
||||
./build_packages.sh "$branch" "$action"
|
@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
vagrant halt
|
||||
|
||||
running=`vagrant global-status | grep running | grep conda/boxes/osx` || /bin/true
|
||||
|
||||
if [ ! -z "$running" ]; then
|
||||
echo "vagrant box already running:" $running
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -z "$(git status --untracked-files=no --porcelain)" ]; then
|
||||
echo "repos not clean"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -d "pyrocko.git" ]; then
|
||||
rm -rf "pyrocko.git"
|
||||
fi
|
||||
|
||||
branch=`git rev-parse --abbrev-ref HEAD`
|
||||
|
||||
action="$1"
|
||||
|
||||
if [ -z "$action" ] ; then
|
||||
echo "usage: outside.sh (dryrun|upload)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git clone --bare "../../../.." "pyrocko.git"
|
||||
|
||||
cat >env.sh <<EOF
|
||||
export CONDA_USERNAME=$CONDA_USERNAME
|
||||
export CONDA_PASSWORD=$CONDA_PASSWORD
|
||||
EOF
|
||||
|
||||
vagrant up
|
||||
|
||||
set +e
|
||||
vagrant ssh -- -t /vagrant/inside.sh "$branch" "$action"
|
||||
STATE=$?
|
||||
set -e
|
||||
|
||||
rm env.sh
|
||||
|
||||
vagrant halt
|
||||
exit $STATE
|
@ -0,0 +1,86 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ ! -f "build_packages.sh" ] ; then
|
||||
echo 'must be run from inside maintenance/conda'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -z "$(git status --untracked-files=no --porcelain)" ]; then
|
||||
echo "repos not clean"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
BRANCH="$1"
|
||||
ACTION="$2"
|
||||
|
||||
if [ -z "$BRANCH" -o -z "$ACTION" ] ; then
|
||||
echo "usage: build_packages.sh <branch> (dryrun|upload)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$ACTION" == "UPLOAD" ] ; then
|
||||
if [ -z "$CONDA_USERNAME" -o -z "$CONDA_PASSWORD" ] ; then
|
||||
echo "need anaconda credentials as env variables"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
ORIGPATH="$PATH"
|
||||
|
||||
for VERSION in 3 2 ; do
|
||||
|
||||
CONDA_URL="https://repo.continuum.io/miniconda"
|
||||
HERE=`pwd`
|
||||
CONDA_PREFIX="$HERE/miniconda${VERSION}"
|
||||
CONDA_INSTALLER="miniconda${VERSION}.sh"
|
||||
|
||||
export PATH="$CONDA_PREFIX/bin:$ORIGPATH"
|
||||
|
||||
if [ `uname` == "Darwin" ]; then
|
||||
CONDA_FILE="Miniconda${VERSION}-latest-MacOSX-x86_64.sh"
|
||||
else
|
||||
CONDA_FILE="Miniconda${VERSION}-latest-Linux-x86_64.sh"
|
||||
fi
|
||||
|
||||
# Install Miniconda
|
||||
|
||||
if [ ! -f "$CONDA_INSTALLER" ] ; then
|
||||
curl "$CONDA_URL/$CONDA_FILE" -o "$CONDA_INSTALLER";
|
||||
chmod +x "$CONDA_INSTALLER"
|
||||
rm -rf "$CONDA_PREFIX"
|
||||
fi
|
||||
|
||||
if [ ! -d "$CONDA_PREFIX" ] ; then
|
||||
"./$CONDA_INSTALLER" -b -u -p "$CONDA_PREFIX"
|
||||
conda install -y conda-build conda-verify anaconda-client
|
||||
fi
|
||||
|
||||
if [ -d "build/pyrocko.git" ] ; then
|
||||
rm -rf "build/pyrocko.git"
|
||||
fi
|
||||
|
||||
git clone -b $BRANCH "../.." "build/pyrocko.git"
|
||||
rm -rf build/pyrocko.git/.git
|
||||
rm -rf build/pyrocko.git/maintenance/conda
|
||||
|
||||
if [ "$ACTION" == "UPLOAD" ] ; then
|
||||
anaconda logout
|
||||
anaconda login --username "$CONDA_USERNAME" --password "$CONDA_PASSWORD"
|
||||
conda config --set anaconda_upload yes
|
||||
else
|
||||
conda config --set anaconda_upload no
|
||||
fi
|
||||
|
||||
if [ "$VERSION" == "3" ] ; then
|
||||
conda-build --python 3.6 build
|
||||
conda-build --python 3.7 build
|
||||
conda-build --python 3.8 build
|
||||
fi
|
||||
|
||||
if [ "$VERSION" == "2" ] ; then
|
||||
conda-build build
|
||||
fi
|
||||
done
|
@ -1,18 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
cd anaconda-build-boxes
|
||||
|
||||
boxes="$1"
|
||||
if [ -z "$boxes" ]; then
|
||||
boxes=`ls`
|
||||
fi
|
||||
|
||||
for box in $boxes; do
|
||||
cd $box
|
||||
vagrant halt
|
||||
echo "Building Anaconda packages on $box"
|
||||
./outside.sh
|
||||
cd ..
|
||||
done
|
Loading…
Reference in New Issue