Last active
February 7, 2019 14:40
-
-
Save tai271828/53844d73137155ae10a7203625b36ccd to your computer and use it in GitHub Desktop.
Bootstrap charm-tools development environment with SGE-cluster charms as an example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Author: Taihsiang Ho (tai271828) <[email protected]> | |
# | |
# You could build the development env for charm-tools | |
# Usage example: | |
# $ lxc launch ubuntu:16.04 charm-tool-dev-16-04 | |
# $ lxc exec charm-tool-dev-16-04 bash | |
# $ ./bootstrap.sh | |
# # in charm-tools folder | |
# $ source .tox/py35/bin/activate | |
# # build the target charm layer. in the target layer folder: | |
# # use charm-build directly because we don't have the charm bin wrapper | |
# $ charm-build --log-level DEBUG --series xenial --build-dir ../built-charms-sge-master ./ | |
# | |
source work-env.sh | |
# prerequisite to build charm-tools | |
sudo apt-get update | |
sudo apt-get install make tox libpython3.5-dev -y | |
mkdir -p ${WORK_DIR} | |
mkdir -p ${JUJU_REPOSITORY} | |
mkdir -p ${CHARM_LAYERS_DIR} | |
mkdir -p ${CHARM_INTERFACES_DIR} | |
mkdir -p ${CHARM_BUILD_DIR} | |
cd ${JUJU_REPOSITORY}/../ | |
git clone https://github.com/juju/charm-tools.git | |
cd ${CHARM_LAYERS_DIR} | |
git clone https://github.com/tai271828/charm-layer-sge-master.git | |
git clone https://github.com/tai271828/charm-layer-sge-client.git | |
cd ${CHARM_INTERFACES_DIR} | |
# please notice the name sge-cluster matters when building | |
git clone https://github.com/tai271828/charm-layer-sge-interface.git sge-cluster | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WORK_DIR_ASSIGN=$1 | |
WORK_DIR=${WORK_DIR_ASSIGN:-${HOME}/work-my-projects} | |
export JUJU_REPOSITORY=${WORK_DIR}/charms | |
export CHARM_LAYERS_DIR=${JUJU_REPOSITORY}/layers | |
export CHARM_INTERFACES_DIR=${JUJU_REPOSITORY}/interfaces | |
export CHARM_BUILD_DIR=${JUJU_REPOSITORY}/build | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment