Skip to content

Commit 6b430d5

Browse files
committed
cooler messages
1 parent 04a9a61 commit 6b430d5

File tree

12 files changed

+89
-17
lines changed

12 files changed

+89
-17
lines changed

.gitignore

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1+
2+
# Java
13
*.jar
4+
target
5+
.idea
6+
7+
# Python
8+
*.pyc
29

10+
# secret stuff
311
.oci/config
412
*.pem
13+
.md
514

6-
target
7-
8-
.idea
9-
10-
SECRETS.md
15+
# stuff for building the docker container
16+
*.rpm
17+
*.zip
18+
*.tar.gz

Dockerfile

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,32 @@ WORKDIR /opt/oracle/tools/nodejs/apps
6767
RUN git clone https://github.com/kbhanush/ATPConnectionTest
6868
EXPOSE 3050
6969

70-
70+
# install Java SDK /opt/oracle/tools/java/sdk
71+
# lib/ contains libraries & third-party/lib contains dependencies
72+
WORKDIR /opt/oracle/tools/java/sdk
73+
ADD https://github.com/oracle/oci-java-sdk/releases/download/v1.2.47/oci-java-sdk.zip .
74+
RUN unzip oci-java-sdk.zip && \
75+
rm oci-java-sdk.zip
76+
77+
# install JDBC /opt/oracle/tools/java
78+
ENV JDBC_DIR /opt/oracle/tools/java
79+
WORKDIR ${JDBC_DIR}
80+
ADD ojdbc8-full.tar.gz .
81+
RUN tar xvzf ojdbc8-full.tar.gz
82+
83+
# Sample apps - /opt/oracle/apps/<app_name>
84+
ENV JAVA_APP /opt/oracle/apps/ATP-REST-Java
85+
WORKDIR ${JAVA_APP}
86+
ADD https://github.com/sblack4/ATP-REST-Java/releases/download/v0.1/atp-rest-scripts.jar .
87+
ADD run-java-examples.sh .
88+
ADD picocli-3.6.1.jar .
89+
RUN mkdir lib && \
90+
mv picocli-3.6.1.jar lib
91+
ENV PATH $PATH:${JAVA_APP}
7192

7293
# Uninstall packages
7394
RUN echo "Cleaning up yum packages........................." && \
7495
yum -y remove unzip && \
7596
yum -y remove git
7697

98+
CMD ["sh", "run-java-examples.sh"]

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ REST APIs for Oracle Autonomous Transaciton Processing Service written in Java
33

44

55
## Objectives
6-
- [x] A base image based on frolvlad/alpine-glibc:alpine-3.8 that includes Oracle instant client 18.3, sqlplus and sqlcl for basic sql connectivity to an oracle ATP database
7-
https://hub.docker.com/r/frolvlad/alpine-glibc/
8-
- [x] A python, **Java** and node.js image each built on the base image and layered with drivers to connect respective language programs to an ATP database seamlessly Oracle Cloud Infrastructure CLI
6+
- [x] A base image based on Oracle linux
7+
- [x] A **python**, **Java** and **node.js** image each built on the base image and layered with drivers to connect respective language programs to an ATP database seamlessly Oracle Cloud Infrastructure CLI
98
- [x] instant client
109
- [x] SQLcl
1110
- [x] Java SDK
1211
- [x] Oracle JDBC driver
12+
- [ ] SQL Plus
1313
- [x] API language scripts for listing, creating, scaling, backing up an ATP instance
1414
- [ ] A sample program that can take a mapped ATP credentials .zip file and connect to the database
1515

SECRETS.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Secrets
2+
3+
4+
PFA env details:
5+
6+
Status Available
7+
8+
Access End Date 15-OCT-2018
9+
10+
Login Username lisa.jones / john.dunbar / bala.gupta / roland.dubois / cloud.admin
11+
12+
Login Password rotuNd@5PIcKuP
13+
14+
Identity Domain gse00014623
15+
16+
Notes OCI Automation that requires API Keys (example: Terraform, Ansible, Chef Scripts etc), please use this user
17+
18+
username = api.user
19+
20+
password = mAjeStic@1WHig
21+
22+
Direct URL : https://console.us-ashburn-1.oraclecloud.com/#/a/
23+
24+
Note : This user is only available on OCI. Do not use this user to login to the UCM Dashboard.

run-java-examples.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
4+
JDBC_LIB="/opt/oracle/tools/java/ojdbc8-full"
5+
JAVA_SDK="/opt/oracle/tools/java/sdk"
6+
CLASSPATH="$JDBC_LIB:$DIR:$JAVA_SDK/lib:$JAVA_SDK/third-party/lib:$DIR/atp-rest-scripts.jar"
7+
8+
java -cp "$CLASSPATH" com.github.sblack4.CLI "$@"

run.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/main/java/com/github/sblack4/CLI.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@
44
import picocli.CommandLine.*;
55

66

7-
@Command(name="CLI", header = "@|red Create, Scale, List, and Delete your ATP - examples in... JAVA!|@",
8-
subcommands = { CreateATP.class, ListATP.class, ScaleATP.class, DeleteATP.class, Database.class})
7+
@Command(name="CLI",
8+
sortOptions = false,
9+
header = "@|red,bg(white) " +
10+
" _ _ _ _ __ _ \n" +
11+
" | || |___| | |___ / _|_ _ ___ _ __ _ | |__ ___ ____ _ \n" +
12+
" | __ / -_) | / _ \\ | _| '_/ _ \\ ' \\ | || / _` \\ V / _` |\n" +
13+
" |_||_\\___|_|_\\___/ |_| |_| \\___/_|_|_| \\__/\\__,_|\\_/\\__,_||@\n" +
14+
"@|red Create, Scale, List, and Delete your ATP - examples in... JAVA!|@",
15+
subcommands = { CreateATP.class, ListATP.class, ScaleATP.class, DeleteATP.class, Database.class})
916
public class CLI implements Runnable {
1017
@Option(names = { "-h", "--help" }, usageHelp = true, description = "Displays this help message and quits.")
1118
private boolean helpRequested = false;
@@ -15,6 +22,10 @@ public void run() {
1522
}
1623

1724
public static void main(String[] args) {
25+
if (args.length < 1) {
26+
System.out.println("Incorrect Usage, please give command");
27+
CommandLine.usage(new CLI(), System.err);
28+
}
1829
CommandLine.run(new CLI(), args);
1930
}
2031
}

var/run.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
4+
java -cp "target/atp-rest-scripts.jar:lib/*" com.github.sblack4.CLI "$@"
5+
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)