Sha256: 64e168911d232e2520cf5fa3ea3611cc03d6d808311abcc108bcf97423e4bcee

Contents?: true

Size: 1.4 KB

Versions: 250

Compression:

Stored size: 1.4 KB

Contents

#!/usr/bin/env ruby

require_relative 'helpers'

app_root do
  use_docker = ask(
    question: 'Would you like to use Docker Compose for Postgres?',
    valid_answers: ['y', 'N']
  )

  header 'Configuring git'
  target_upstream = "https://github.com/avo-hq/avo.git"
  current_upstream = `git config --get remote.upstream.url`.chomp
  if current_upstream.nil? || current_upstream.empty?
    puts "Adding new remote 'upstream' to #{target_upstream}"
    run! "git remote add upstream #{target_upstream}"
  elsif current_upstream != target_upstream
    puts "Updating existing remote 'upstream' to #{target_upstream}"
    run! "git remote set-url upstream #{target_upstream}"
  else
    puts "Remote 'upstream' already points to #{target_upstream}, no change"
  end

  header 'Installing gems'
  run! 'bundle install'

  header 'Installing Yarn packages'
  run! 'yarn'
  run! '(cd spec/dummy; yarn)'
  run! '(cp spec/dummy/.env.test.sample spec/dummy/.env.test)'

  if use_docker == 'y'
    header 'Creating the Docker volume'
    run! 'docker volume create --name=avo-db-data'

    header 'Creating and running the Docker image'
    run! 'docker-compose up -d'
  end

  header 'Preparing the database'
  run! 'bin/rails db:setup'

  header 'Building assets'
  run! 'yarn build:js'
  run! 'yarn build:custom-js'
  run! 'yarn build:css'

  if use_docker == 'y'
    header 'Stopping the Docker image'
    run! 'docker-compose stop'
  end
end

Version data entries

250 entries across 250 versions & 1 rubygems

Version Path
avo-3.18.1.tw4 bin/init
avo-3.18.1 bin/init
avo-3.18.0.tw4 bin/init
avo-3.18.0 bin/init
avo-3.17.9.beta2 bin/init
avo-3.17.9.beta1 bin/init
avo-3.17.9.tw4 bin/init
avo-3.17.9 bin/init
avo-3.17.8.tw4 bin/init
avo-3.17.8 bin/init
avo-3.17.7 bin/init
avo-3.17.6.tw4 bin/init
avo-3.17.6 bin/init
avo-3.17.5 bin/init
avo-3.17.4 bin/init
avo-3.17.3 bin/init
avo-3.17.5.tw4 bin/init
avo-3.17.4.tw4 bin/init
avo-3.17.3.tw4 bin/init
avo-3.17.2.tw4 bin/init