This file contains 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
####################################################### | |
# Need to ensure following net, subnet, vpc, security group and testing image existed | |
# openstack network create packer-poc-net | |
# openstack subnet create --network packer-poc-net --subnet-range 10.0.20.0/24 packer-poc-subnet | |
# openstack router create packer-poc-vpc | |
# openstack router add subnet packer-poc-vpc packer-poc-subnet | |
# openstack security group create packer-poc-sg | |
# openstack security group rule create --ingress --protocol tcp --dst-port 22 packer-poc-sg | |
# |
This file contains 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 | |
#way 1: | |
curl --silent "https://api.github.com/repos/docker/machine/releases/latest" | python -c "import sys, json; print json.load(sys.stdin)['tag_name']" | |
# way 2: | |
apt install jq -y | |
curl --silent "https://api.github.com/repos/docker/machine/releases/latest" | jq -r .tag_name |
This file contains 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 | |
_NET_PREFIX="openlab-jobs" | |
export OS_NETWORK_NAME="$_NET_PREFIX-net" | |
export OS_NETWORK_ID="$(openstack network show $OS_NETWORK_NAME -f value -c id)" | |
if [ -z "$OS_NETWORK_ID" ]; then | |
export OS_NETWORK_ID="$(openstack network create $OS_NETWORK_NAME -f value -c id)" | |
openstack subnet create --network $OS_NETWORK_ID --subnet-range 172.16.10.0/24 $_NET_PREFIX-subnet | |
fi |
This file contains 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 | |
wget -c https://storage.googleapis.com/golang/go1.11.1.linux-amd64.tar.gz | |
sudo tar -C /usr/local/ -xvzf go1.11.1.linux-amd64.tar.gz | |
rm go1.11.1.linux-amd64.tar.gz | |
cat << EOF >> /etc/profile | |
export GOPATH=/home/zuul/ | |
export PATH=/usr/local/go/bin:$GOPATH/bin:$PATH: | |
export GOBIN=$GOPATH/bin | |
EOF |
This file contains 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 | |
export OS_IMAGE_NAME="cirros-0.4.0-x86_64-disk" | |
export OS_IMAGE_ID="$(openstack image show $OS_IMAGE_NAME -f value -c id)" | |
if [ -z "$OS_IMAGE_ID" ]; then | |
curl -O http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img | |
export OS_IMAGE_ID="$(openstack image create --file ./cirros-0.4.0-x86_64-disk.img --min-disk 1 --container-format bare --disk-format raw cirros-0.4.0-x86_64-disk -f value -c id)" | |
rm cirros-0.4.0-x86_64-disk.img | |
fi |
This file contains 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
1. configure `router-id` in `/etc/origin/cloudprovider/openstack.conf` | |
cat << EOF >> /etc/origin/cloudprovider/openstack.conf | |
[Route] | |
router-id = <router-id> | |
EOF | |
2. Adding following config options under `controllerArguments:` of `/etc/origin/master/master-config.yaml` | |
``` | |
allocate-node-cidrs: |
This file contains 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
git remote add upstream https://github.com/docker/machine | |
git config --global user.email '[email protected]' | |
git config --global user.name 'openlab' | |
git fetch upstream refs/pull/4545/head:pr4545 | |
git cherry-pick pr4545 |
This file contains 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
# step1:在跳板机(执行ansible工具的机器上)clone openshift的ansible部署工具,并应用fusioncloud 规避patch: | |
git clone http://github.com/huaweicloud/openshift-ansible | |
cd openshift-ansible | |
git config --global user.email '[email protected]' | |
git config --global user.name 'openlab' | |
git fetch origin refs/pull/12/head:pr12 | |
git cherry-pick pr12 |
This file contains 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
# replace specific word with another word following rows of another specific word | |
sed -i '/OS::Neutron::Router/,+5s|aaa|bbb|' path/to/file | |
#similar | |
sed -i '/OS::Neutron::Router/,+5d' path/to/file | |
sed '/OS::Neutron::Router/,+5p' path/to/file |
This file contains 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
FROM ubuntu:bionic | |
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | |
###### | |
# Install common dependencies from packages. Versions here are either | |
# sufficient or irrelevant. | |
# | |
# WARNING: DO NOT PUT JAVA APPS HERE! Otherwise they will install default | |
# Ubuntu Java. See Java section below! |
OlderNewer