Upload Project to Ec2 From Command Line
Earlier 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.
Create a Projection
- Sign in to VB Studio.
- On the Organization folio, click + Create.
- 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 the analogy projectwizard_projectdetails.png - Name:
- On the Template page, select Initial Repository and click Adjacent.
Description of the illustration projectwizard_template.png - On the Project Backdrop Initial Repository page, brand sure that these options are selected:
- Initial Repository: Initialize repository with README file
- Wiki Markup: Markdown
Clarification of the illustration projectwizard_projectproperties.png - Click Finish.
Await for the projection'due south provisioning to complete. Later on provisioning completes, the Project Abode page opens.

Clone the Projection'due south Git Repository
- On your estimator, open the Git command line.
- Alter the directory to where you desire to clone the project's Git repository, as in this case:
$ cd MyApps
- Go back to the VB Studio project.
- In the navigation bar, click Git
.
- From the Clone drop-down list, click the HTTPS URL's Re-create
icon to copy the URL.
Description of the illustration vbstudio_git_urls.png - 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
- 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.
- In the File Explorer or the File Managing director, open the cloned repository'southward directory.
Y'all'll find aREADME.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 the analogy cloned_repo.png
Add the Sample Application Files to the Cloned Git Repository
- Extract the sample application files from the zip file to the cloned repository's directory.
Instance:Description of the illustration cloned_repo_with_files.png - Open the
README.md
file in a text editor. - 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
- On the Git command line, change to the cloned repository directory.
/c/MyApps
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
$ cd employee-app(master)
after the path.chief
is the default Git repository branch.
Case:
/c/MyApps/employee-app (master) $
- Enter the
git add .
command to add together or phase the sample awarding's files to the local Git repository index.$ git add .
- 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
Commit and Push the Sample Application Files to the Project'due south Git Repository
- On the Git control line, enter the
git commit -thousand "Initial commit"
command to commit the staged files to the local Git repository and addInitial 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 - 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'.
- Open up the browser with the the VB Studio projection.
- In the navigation bar, click Git
and verify that all files are added to the repository.
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.
Want to Learn More?
- Visual Builder Studio Assist Center
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"