Skip to content

Instantly share code, notes, and snippets.

@leowmjw
Last active June 18, 2016 11:32
Show Gist options
  • Save leowmjw/a56e2e337a3df9f9bb254ddaf943bab0 to your computer and use it in GitHub Desktop.
Save leowmjw/a56e2e337a3df9f9bb254ddaf943bab0 to your computer and use it in GitHub Desktop.

Binaries (test) for Trusty Base, with basic PHP app type fixes Compiled from this version: hashicorp/otto#515

This file has been truncated, but you can view the full file.
@mihailj
Copy link

mihailj commented May 30, 2016

Hi,

I've tested again on my primary windows_amd64 host OS after deleting ~/.otto.d and all Otto VM's with no luck...

Also made 2 tests that didn't have the expected results on 2 different Ubuntu VMs... one Ubuntu 16.04 and a new user created just for this test (directly installed in Virtualbox) and below you can find the log for a virgin (as in never had Otto installed) Vagrant box:

$ vagrant ssh
Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 3.13.0-86-generic x86_64)
...
vagrant@vagrant-ubuntu-trusty-64:~$ pwd
/home/vagrant
vagrant@vagrant-ubuntu-trusty-64:~$ mkdir otto
vagrant@vagrant-ubuntu-trusty-64:~$ cd otto
vagrant@vagrant-ubuntu-trusty-64:~/otto$ wget https://gist.github.com/leowmjw/a56e2e337a3df9f9bb254ddaf943bab0/raw/98e2d5b35b2bbc3074c5a197d04ecd45f1fc9f9e/linux_amd64.zip
...
100%[======================================>] 5,402,252   1.18MB/s   in 4.5s

2016-05-30 21:32:24 (1.16 MB/s) - ‘linux_amd64.zip’ saved [5402252/5402252]

vagrant@vagrant-ubuntu-trusty-64:~/otto$ ls -a
.  ..  linux_amd64.zip
vagrant@vagrant-ubuntu-trusty-64:~/otto$ unzip linux_amd64.zip
The program 'unzip' is currently not installed. To run 'unzip' please ask your administrator to install the package 'unzip'
vagrant@vagrant-ubuntu-trusty-64:~/otto$ sudo apt-get install unzip -y
Reading package lists... Done
...
Setting up unzip (6.0-9ubuntu1.5) ...
vagrant@vagrant-ubuntu-trusty-64:~/otto$ unzip linux_amd64.zip
Archive:  linux_amd64.zip
  inflating: otto
vagrant@vagrant-ubuntu-trusty-64:~/otto$ ./otto --version
Otto v0.2.1-dev (fcf86148714bad92e753973f4ba44586270d55c1)

vagrant@vagrant-ubuntu-trusty-64:~/otto$ nano Appfile
vagrant@vagrant-ubuntu-trusty-64:~/otto$ cat Appfile
application {
 name = "otto-ubuntu-14"
 type = "php"
}
vagrant@vagrant-ubuntu-trusty-64:~/otto$ ./otto compile
==> Loading Appfile...
==> Fetching all Appfile dependencies...
==> Compiling...
    Application:    otto-ubuntu-14 (php)
    Project:        otto
    Infrastructure: aws (simple)

    Compiling infra...
    Compiling foundation: consul
==> Compiling main application...
==> Compilation success!
    This means that Otto is now ready to start a development environment,
    deploy this application, build the supporting infrastructure, and
    more. See the help for more information.

    Supporting files to enable Otto to manage your application from
    development to deployment have been placed in the output directory.
    These files can be manually inspected to determine what Otto will do.
vagrant@vagrant-ubuntu-trusty-64:~/otto$ cd .otto/compiled/app/dev/layer-base/
vagrant@vagrant-ubuntu-trusty-64:~/otto/.otto/compiled/app/dev/layer-base$ cat Vagrantfile
# Generated by Otto, do not edit!
#
# This is a Vagrantfile that represents a single layer of a multi-layered
# dev environment. Do not modify, boot, or destroy this environment since
# it can corrupt other environments very easily.

Vagrant.configure("2") do |config|

  if ENV["OTTO_VAGRANT_LAYER_PATH"]
    config.vm.clone = ENV["OTTO_VAGRANT_LAYER_PATH"]
  else
    config.vm.box = "hashicorp/precise64"
    config.vm.box_check_update = false
    config.vm.provider :parallels do |p, o|
      o.vm.box = "parallels/ubuntu-12.04"
    end
  end


  # ScriptPacks
  dir = "/otto/scriptpacks"
  config.vm.provision "shell", inline: "sudo rm -rf #{dir}; sudo mkdir -p #{dir}; sudo chmod 0777 #{dir}"

  config.vm.provision "file", source: '/home/vagrant/otto/.otto/compiled/app/scriptpacks/STDLIB.tar.gz', destination: "#{dir}/STDLIB.tar.gz"
  config.vm.provision "shell", inline: "cd #{dir}; sudo mkdir STDLIB; sudo tar xzf STDLIB.tar.gz -C STDLIB"

  config.vm.provision "file", source: '/home/vagrant/otto/.otto/compiled/app/scriptpacks/PHP.tar.gz', destination: "#{dir}/PHP.tar.gz"
  config.vm.provision "shell", inline: "cd #{dir}; sudo mkdir PHP; sudo tar xzf PHP.tar.gz -C PHP"


  # Use a linked clone if we can
  config.vm.provider "virtualbox" do |v|
    v.linked_clone = true
  end

  if Vagrant.has_plugin?("vagrant-parallels", ">= 1.6.0")
    config.vm.provider "parallels" do |p|
      p.linked_clone = true
    end
  end

  # Disable the default synced folder
  config.vm.synced_folder ".", "/vagrant", disabled: true


  # Setup Ruby
  config.vm.provision "shell", inline: $script_app

end


$script_app = <<SCRIPT
#!/bin/bash
set -e

# Setup our scriptpacks
. /otto/scriptpacks/STDLIB/main.sh
. /otto/scriptpacks/PHP/main.sh

# Initialize
otto_init

# Make it so that `vagrant ssh` goes directly to the correct dir
vagrant_default_cd "vagrant" "/vagrant"

# Configuring SSH for faster login
vagrant_config_fast_ssh

# Install PHP
otto_output "Installing PHP Version 5.6 "
oe php_install "5.6"

otto_output "Installing supporting packages..."
oe sudo apt-get install -y \
  bzr git mercurial build-essential \
  curl

otto_output "Installing Composer..."
php_install_composer
SCRIPT

@leowmjw
Copy link
Author

leowmjw commented Jun 6, 2016

@mihailj You can try again. I tested in my copy and it works (basic PHP); after I readjusted the compilation path of the source. It seems the compilation needs to be <GO_PATH>/src/github.com/hashicorp/otto and cannot be compiled when in my copy of the repo <GO_PATH>/src/github.com/leowmjw/otto :(

I tested with the basic PHP 7.0 customization as per below:

application {
    name = "basic-otto-php"
    type = "php"


   dependency {
      source = "github.com/hashicorp/otto/examples/mongodb"
      # source = "/Users/leow/OTTO/WORKSPACE/otto/examples/mongodb"
      # source = "/Users/leow/OTTO/WORKSPACE/sample_app_3rd_edition/vue-project"
      # source = "./vue-node-docker"
   }
}

   customization {
     php_version = "7.0"
   } 

project {
   name = "sinar"
   infrastructure = "dev"
}

infrastructure "dev" {
    type = "aws"
    flavor = "simple"
    foundation "consul" {}
}

@mihailj
Copy link

mihailj commented Jun 18, 2016

Hello Michael, can you upload again the 64-bit windows version? The raw download doesn't work anymore... Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment