Skip to content Skip to sidebar Skip to footer

Upload Project to Ec2 From Command Line

section 0Earlier Yous Begin

This fifteen-minute tutorial shows you lot how to create a project in Oracle Visual Builder Studio (VB Studio) and upload an awarding's files to the project's Git repository using the Git command line tool.

Background

Oracle Visual Builder Studio (VB Studio) is a DevOps and life cycle management tool, and provides the infrastructure to assistance yous build and deploy apps.

To upload your application to VB Studio, y'all must create a projection with a Git repository. Afterward you create the projection, y'all clone the project's Git repository to your computer, re-create awarding's files to it, add together and commit the files to the local Git repository, and then push the commits from the local Git repository to the project'due south Git repository.

What Exercise Y'all Need?

  • A web browser
  • Your Oracle Deject account credentials
  • Access to a VB Studio instance
  • DEVELOPER_ADMINISTRATOR or DEVELOPER_USER identity domain role assigned to y'all
  • Git command line tool
    To admission Git, you tin can employ both Git graphical user interface and control line tools. In this tutorial, you'll utilize the command line tool to run Git commands. Download Git tools from https://git-scm.com/downloads and install them on your computer.
  • Sample application
    Click here to download the Employee sample application, a Java SE web awarding that uses Servlets, JSP, Bootstrap, and embedded Tomcat.

section 1Create a Projection

  1. Sign in to VB Studio.
  2. On the Organization folio, click + Create.
  3. On the New Project wizard'south Project Details page, enter these values, then click Adjacent:
    • Name: Employee App
    • Description: A Java SE web application with Servlets, JSP, Bootstrap, and embedded Tomcat
    Description of projectwizard_projectdetails.png follows
    Description of the analogy projectwizard_projectdetails.png
  4. On the Template page, select Initial Repository and click Adjacent.
    Description of projectwizard_template.png
    Description of the illustration projectwizard_template.png
  5. On the Project Backdrop Initial Repository page, brand sure that these options are selected:
    • Initial Repository: Initialize repository with README file
    • Wiki Markup: Markdown
    Description of projectwizard_projectproperties.png
    Clarification of the illustration projectwizard_projectproperties.png
  6. Click Finish.

Await for the projection'due south provisioning to complete. Later on provisioning completes, the Project Abode page opens.

Description of project_home.png
Description of the illustration project_home.png

section 2Clone the Projection'due south Git Repository

  1. On your estimator, open the Git command line.
  2. Alter the directory to where you desire to clone the project's Git repository, as in this case:
    $ cd MyApps
  3. Go back to the VB Studio project.
  4. In the navigation bar, click Git Git icon.
  5. From the Clone drop-down list, click the HTTPS URL's Re-create Clipboard icon icon to copy the URL.
    Description of vbstudio_git_urls.png
    Description of the illustration vbstudio_git_urls.png
  6. On the Git command line, enter git clone and paste the copied URL.
    Example:
    $ git clone https://alex.deject%40example.com@vbs-vbsdemo.programmer.ocp.oraclecloud.com/vbs-vbsdemo/s/vbs-vbsdemo_employee-app_1234/scm/employee-app.git
  7. Press Enter.
    The cloning process starts. Enter your VB Studio password when prompted.
    Your log should look like to this:
    $ git clone https://alex.cloud%40example.com@vbs-vbsdemo.programmer.ocp.oraclecloud.com/vbs-vbsdemo/south/vbs-vbsdemo_employee-app_1234/scm/employee-app.git Cloning into 'employee-app'... remote: Counting objects: 3, washed remote: Finding sources: 100% (3/three) remote: Getting sizes: 100% (2/2) remote: Compressing objects: 100% (55/55) remote: Full 3 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (3/3), done.
  8. In the File Explorer or the File Managing director, open the cloned repository'southward directory.
    Y'all'll find a README.md file and a .git directory created at that place. Don't delete or rename the .git directory, as it contains necessary Git repository files.
    Instance:
    Description of cloned_repo.png
    Description of the analogy cloned_repo.png

section 3Add the Sample Application Files to the Cloned Git Repository

  1. Extract the sample application files from the zip file to the cloned repository's directory.
    Instance:
    Description of cloned_repo_with_files.png
    Description of the illustration cloned_repo_with_files.png
  2. Open the README.md file in a text editor.
  3. Re-create the following text, paste information technology in the README.md file, and save the file.
    #Employee App Sample Awarding This awarding is a simple Java spider web application of employees that implements the CRUD operations using Bootstrap to add UI styles, Tomcat as the embedded server, and Maven to compile and package the dependencies needed to run the web application standalone.  Application files: * `src` directory: contains source files * pom.xml: defines dependencies required to run Tomcat in the embedded mode, and the plugins to compile and package the application in a single uber JAR * manifest.json: provides metadata of the Java awarding, including the Coffee version and the control to run the application
  4. On the Git command line, change to the cloned repository directory.
    /c/MyApps
    $ cd employee-app
    This is necessary because after the project Git repository is cloned, yous are not automatically navigated to information technology. Afterward you lot change to the cloned repository directory, you'll notice (master) after the path. chief is the default Git repository branch.
    Case:
    /c/MyApps/employee-app (master) $
  5. Enter the git add . command to add together or phase the sample awarding's files to the local Git repository index.
    $ git add .
  6. Enter the git status command to verify that all files accept been staged.
    $ git status On branch master Your branch is up to engagement with 'origin/master'.  Changes to be committed:   (use "git reset HEAD <file>..." to unstage)            modified:   README.doc         new file:   manifest.json         new file:   pom.xml         new file:   src/associates/distribution.xml         new file:   src/primary/java/com/case/employees/Employee.java         new file:   src/main/java/com/case/employees/EmployeeList.java         new file:   src/primary/java/com/instance/employees/EmployeeService.coffee         new file:   src/main/java/com/instance/employees/EmployeeServlet.java         new file:   src/chief/java/com/example/employees/Primary.coffee         new file:   src/chief/webapp/META-INF/context.xml         new file:   src/main/webapp/Web-INF/web.xml         new file:   src/main/webapp/css/bootstrap.min.css         new file:   src/main/webapp/fonts/glyphicons-halflings-regular.eot         new file:   src/main/webapp/fonts/glyphicons-halflings-regular.svg         new file:   src/chief/webapp/fonts/glyphicons-halflings-regular.ttf         new file:   src/main/webapp/fonts/glyphicons-halflings-regular.woff         new file:   src/chief/webapp/fonts/glyphicons-halflings-regular.woff2         new file:   src/primary/webapp/index.jsp         new file:   src/chief/webapp/js/bootstrap.min.js         new file:   src/main/webapp/jsp/list-employees.jsp         new file:   src/primary/webapp/jsp/new-employee.jsp                

section 4Commit and Push the Sample Application Files to the Project'due south Git Repository

  1. On the Git control line, enter the git commit -thousand "Initial commit" command to commit the staged files to the local Git repository and add Initial commit every bit the commit message.
    $ git commit -m "Initial commit"
    [chief c869517] Initial commit
    21 files changed, 964 insertions(+), 2 deletions(-)
    rewrite README.dr. (94%)
    create mode 100644 manifest.json
    create mode 100644 pom.xml
    create way 100644 src/assembly/distribution.xml
    create mode 100644 src/main/java/com/case/employees/Employee.java
    create mode 100644 src/chief/coffee/com/example/employees/EmployeeList.java
    create manner 100644 src/master/java/com/instance/employees/EmployeeService.java
    create mode 100644 src/main/java/com/case/employees/EmployeeServlet.coffee
    create mode 100644 src/main/java/com/instance/employees/Main.java
    create mode 100644 src/primary/webapp/META-INF/context.xml
    create style 100644 src/chief/webapp/WEB-INF/web.xml
    create mode 100644 src/main/webapp/css/bootstrap.min.css
    create mode 100644 src/primary/webapp/fonts/glyphicons-halflings-regular.eot
    create mode 100644 src/main/webapp/fonts/glyphicons-halflings-regular.svg
    create mode 100644 src/chief/webapp/fonts/glyphicons-halflings-regular.ttf
    create manner 100644 src/master/webapp/fonts/glyphicons-halflings-regular.woff
    create mode 100644 src/main/webapp/fonts/glyphicons-halflings-regular.woff2
    create manner 100644 src/chief/webapp/index.jsp
    create mode 100644 src/main/webapp/js/bootstrap.min.js
    create mode 100644 src/main/webapp/jsp/list-employees.jsp
    create mode 100644 src/main/webapp/jsp/new-employee.jsp
  2. Enter the git push -u origin master command to push the commits of the local Git repository master branch to the project Git repository.
    In the command, origin is the default proper noun assigned to the remote project Git repository. Enter your VB Studio password, when prompted.
    $ git push -u origin master Enumerating objects: 39, done. Counting objects: 100% (39/39), done. Delta compression using upwards to eight threads Compressing objects: 100% (29/29), done. Writing objects: 100% (37/37), 145.49 KiB | 4.41 MiB/s, done. Full 37 (delta 0), reused 0 (delta 0) remote: [Push Options] Do you lot want to create a merge request? Use git push button -o mr.target=<target-co-operative> origin <feature-co-operative> remote: Updating references: 100% (1/ane) To https://vbs-vbsdemo.developer.ocp.oraclecloud.com/vbs-vbsdemo/s/vbs-vbsdemo_employee-app_1234/scm/employee-app.git    f06779c..c869517  primary -> master Branch 'master' set up to track remote co-operative 'master' from 'origin'.
  3. Open up the browser with the the VB Studio projection.
  4. In the navigation bar, click Git Git icon and verify that all files are added to the repository.
    Description of vbstudio_gitpage_files.png
    Description of the illustration vbstudio_gitpage_files.png

That's information technology! You lot've successfully uploaded the sample application'south files from your estimator to the VB Studio project'south Git repository.


more informationWant to Learn More?

  • Visual Builder Studio Assist Center

griffinallacurs.blogspot.com

Source: https://docs.oracle.com/en/cloud/paas/visual-builder/tutorial-create-project-upload/index.html

Postar um comentário for "Upload Project to Ec2 From Command Line"