All threads / Deploy RoR app from Azure DevOps to Linux Server

Ask A Question


You’re not receiving notifications from this thread.

Deploy RoR app from Azure DevOps to Linux Server

Andriy asked in General

Hi all.
Have some problem.
I'm newest in Azure DevOps (AD).

I created AD git repository for RoR project.
Created pipeline for master branch:

- master

  vmImage: 'ubuntu-18.04'

- task: [email protected]
    versionSpec: '= 2.5.5'
    addToPath: true

- script: |
    sudo apt install freetds-dev
    sudo apt install libpq-dev
    sudo apt install sqlite3 libsqlite3-dev
    sudo apt install postgresql postgresql-contrib
  displayName: 'lib for tiny_tds, postgres'

- script: |
    sudo -i -u postgres psql -c "CREATE USER user WITH PASSWORD 'pppppp';"
    sudo -i -u postgres psql -c "ALTER USER user WITH SUPERUSER;"
    sudo -i -u postgres psql -c "CREATE DATABASE db WITH OWNER = user;"
    sudo -i -u postgres psql -c "CREATE DATABASE db_test WITH OWNER = user;"
  displayName: 'create pg user & db'

- script: |
    echo "gem: --no-document" > ~/.gemrc
    gem install bundler
    bundle install --retry=3 --jobs=4
  displayName: 'bundle install'

- script: rails db:migrate RAILS_ENV=test
  displayName: 'db migrate ENV=test'

- script: bundle exec rake
  displayName: 'bundle exec rake'

- task: [email protected]
    testResultsFormat: 'JUnit'
    testResultsFiles: '**/TEST-*.xml'
    failTaskOnFailedTests: true

- task: [email protected]
    SourceFolder: '$(agent.builddirectory)'
    Contents: '**'
    TargetFolder: '$(build.artifactstagingdirectory)'

- task: [email protected]
    PathtoPublish: '$(Build.ArtifactStagingDirectory)'
    ArtifactName: 'drop'
    publishLocation: 'Container'

Successfully passed the tests in pipeline above.

How now use releases & environments for deploy project to linux server? How use pipeline above and created artifact?
I don't want use Azure Subscription. Maybe Kubernetes...
The main question is where I can compile ruby project and how deploy it on server? How automate this process?
Who can help with advice, tutorial, documentations?

Thanks all!

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 43,185+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2021 GoRails, LLC. All rights reserved.