Skip to content
Adrián Tóth edited this page May 9, 2019 · 7 revisions

Prerequisites

  1. You have an IBM Cloud account
  2. You have to be an owner or a contributor to cloud foundry organization on cloud.ibm.com
    • the necessary access permissions are granted to you
    • the organization owns a properly configured cloud foundry aplication

Requirements

  1. Ubuntu 16.04.6 LTS
  2. Cloud Foundry Command Line Interface (CF-CLI)
    • Execute the following commands or follow the CF-CLI installation guide
      wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add -
      echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
      sudo apt-get update
      sudo apt-get install cf-cli
  3. IBM Cloud Command Line Interface (ibmcloud-CLI)
  4. Clone of this repository - github.com/europ/MUNI-FI-PA181

Configure

  • NOTES
    • It does not matter if you use ibmcloud or cf in the steps below.
    • It is required to be logged in at least once, your credentials will be saved for later use avoiding re-login.
  1. Verify ibmcloud-CLI
    ibmcloud dev help
  2. Login to YOUR account
    ibmcloud login --sso
    # select "3. eu-de" because our location is set to "Frankfurt"
  3. Add API endpoint
    # our organization is set to 'eu-de'
    ibmcloud api https://api.eu-de.bluemix.net
  4. Add organization & space
    ibmcloud target -o PA181.org -s PA181.space
  5. Verify it via ibmcloud target command and the output should be as the following
    API endpoint:      https://cloud.ibm.com
    Region:            eu-de
    User:              email@example.com
    Account:           YourName YourSurname's Account (abcdefghijklmnopqrstuvwxyz123456)
    Resource group:    Default
    CF API endpoint:   https://api.eu-de.bluemix.net (API version: 2.106.0)
    Org:               PA181.org
    Space:             PA181.space
    

Local Setup - Whole Project

  1. Install .NET Core 2.2 SDK on Linux Ubuntu 16.04 - x64

    wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
    sudo dpkg -i packages-microsoft-prod.deb
    sudo apt-get install apt-transport-https
    sudo apt-get update
    sudo apt-get install dotnet-sdk-2.2
  2. Go to the project directory src/src/API

    cd REPOSITORY/src/src/API
  3. Restore the dependencies for the application

    dotnet restore
  4. Run the application from source

    dotnet run
  5. Open http://localhost:5000

Local Setup - Only UI

  1. Go to the UI directory src/src/API/wwwroot/UI

    • NOTE: the folder must contain package.json
    cd REPOSITORY/src/src/API/wwwroot/UI
  2. Install all dependencies for the project

    yarn
  3. Run the UI from source

    • NOTE: if the this command fails remove node_modules folder and yarn.lock file after that follow the second point above again
    yarn start
  4. Open http://localhost:3000

Manual Deployment

  1. Set target api url
    # our organization is set to 'eu-de'
    cf api https://api.eu-de.bluemix.net
  2. Login
    cf login
  3. Go to the src/ folder
    • NOTE: the folder must contain manifest.yml configuration file
    cd REPOSITORY/src
  4. Push a new app or sync changes to an existing app
    cf push
  5. List all apps in the target space (status report)
    cf apps
Clone this wiki locally