Skip to content

Commit

Permalink
spinnaker added
Browse files Browse the repository at this point in the history
  • Loading branch information
prakasha4devops committed Jun 2, 2021
1 parent 9c6dfb9 commit 6ff443a
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 9 deletions.
21 changes: 12 additions & 9 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ boxes = [
:name => "#{ENV['COMPUTERNAME'] || `hostname`[0..-2]}-devops",
:eth1 => '192.168.10.10',
:groups => "/vagrant",
:mem => "4048",
:cpu => "2"
:mem => "8056",
:cpu => "4"
},
]

Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.box = "bento/ubuntu-20.04" #ubuntu/bionic64

boxes.each do |opts|
config.vm.define opts[:name] do |devbox|
Expand All @@ -19,21 +19,24 @@ Vagrant.configure(2) do |config|
devbox.vm.network :forwarded_port, guest: 22, host: 2222, id: "ssh", disabled: true #ssh port
devbox.vm.network :forwarded_port, guest: 22, host: 2210, auto_correct: true #ssh port

devbox.vm.network "forwarded_port", guest: 8080, host: 8081 # jenkins master port
devbox.vm.network "forwarded_port", guest: 8080, host: 8080 # jenkins master port
devbox.vm.network "forwarded_port", guest: 8081, host: 8081 # jenkins - docker master port
devbox.vm.network "forwarded_port", guest: 50000, host: 50000 # jenkins slave port
devbox.vm.network "forwarded_port", guest: 80, host: 80 # http port
devbox.vm.network "forwarded_port", guest: 8090, host: 8090 # 8090 port
devbox.vm.network "forwarded_port", guest: 5432, host: 5432 # 5432 postgres port
devbox.vm.network "forwarded_port", guest: 8070, host: 8070 # 8070 postgres port
devbox.vm.network "forwarded_port", guest: 9200, host: 9200 # 9200 Elasticsearch port
devbox.vm.network "forwarded_port", guest: 9300, host: 9300 # 9300 Elasticsearch port

devbox.vm.network "forwarded_port", guest: 8200, host: 8200 # 8200 vault port
devbox.vm.network "forwarded_port", guest: 8000, host: 8000 # django python port
devbox.vm.network "forwarded_port", guest: 3306, host: 3306 # mysql 3306 port


devbox.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--memory", opts[:mem]]
v.customize ["modifyvm", :id, "--cpus", opts[:cpu]]
v.customize ["modifyvm", :id, "--groups", opts[:groups]]
v.customize ["modifyvm", :id, "--groups", opts[:groups]]
v.name = opts[:name]
v.gui = false
end
Expand All @@ -46,9 +49,9 @@ Vagrant.configure(2) do |config|
ansible.playbook = "/vagrant/ansible_playbook/playbook.yml"
end

if File.directory?(File.expand_path("E:/work/projects"))
devbox.vm.synced_folder "E:/work/projects", "/vagrant/projects",type: "virtualbox"
end
# if File.directory?(File.expand_path("E:/work/projects"))
# devbox.vm.synced_folder "E:/work/projects", "/vagrant/projects",type: "virtualbox"
# end

end
end
Expand Down
62 changes: 62 additions & 0 deletions scripts/install-spinnaker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash

export DEBIAN_FRONTEND=noninteractive
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure locales

sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
sudo swapon /swapfile

sudo add-apt-repository ppa:openjdk-r/ppa -y

sudo apt-get update
sudo apt-get -y install jq openjdk-11-jdk

SPINNAKER_VERSION=1.21.5
curl -Os https://raw.githubusercontent.com/spinnaker/halyard/master/install/debian/InstallHalyard.sh
sudo bash InstallHalyard.sh --user ubuntu
curl -fsSL get.docker.com -o get-docker.sh
sh get-docker.sh
sudo usermod -aG docker ubuntu
sudo docker run -p 127.0.0.1:9090:9000 -d --name minio1 -v /mnt/data:/data -v /mnt/config:/root/.minio minio/minio:RELEASE.2018-07-31T02-11-47Z server /data

MINIO_SECRET_KEY=`echo $(sudo docker exec minio1 cat /root/.minio/config.json) |jq -r '.credential.secretKey'`
MINIO_ACCESS_KEY=`echo $(sudo docker exec minio1 cat /root/.minio/config.json) |jq -r '.credential.accessKey'`
echo $MINIO_SECRET_KEY | hal config storage s3 edit --endpoint http://127.0.0.1:9090 \
--access-key-id $MINIO_ACCESS_KEY \
--secret-access-key

hal config storage edit --type s3

# env flag that need to be set:


set -e

if [ -z "${SPINNAKER_VERSION}" ] ; then
echo "SPINNAKER_VERSION not set"
exit
fi

sudo hal config version edit --version $SPINNAKER_VERSION
sudo hal deploy apply
sudo echo "host: 0.0.0.0" |sudo tee \
/home/ubuntu/.hal/default/service-settings/gate.yml \
/home/ubuntu/.hal/default/service-settings/deck.yml
sudo hal config security api edit --cors-access-pattern "http://192.168.33.10:9000"
sudo hal config security ui edit --override-base-url http://192.168.33.10:9000
sudo hal config security api edit --override-base-url http://192.168.33.10:8084
sudo hal deploy apply
sudo systemctl daemon-reload
sudo hal deploy connect
sudo systemctl enable redis-server.service
sudo systemctl start redis-server.service
printf " -------------------------------------------------------------- \n| Starting spinnaker, this can take several minutes |\n --------------------------------------------------------------"
sleep 300 #needed to be sure everyting is started correctly
printf " -------------------------------------------------------------- \n| Connect here to spinnaker: http://192.168.33.10:9000/ |\n --------------------------------------------------------------"

0 comments on commit 6ff443a

Please sign in to comment.