From 6c62241540b2c49ca9ae4e78d537a537d85a08e1 Mon Sep 17 00:00:00 2001 From: vairakkumar-vairaperumal <55999782+vairakkumar-vairaperumal@users.noreply.github.com> Date: Sat, 15 Aug 2020 07:58:06 -0700 Subject: [PATCH 1/5] remove oracle lib reference and upgrade to openjdk 11 (#1) --- dependency-reduced-pom.xml | 4 ++-- pom.xml | 4 ++-- src/main/java/com/smartsheet/utils/HttpUtils.java | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml index 0b497e3..de64e79 100644 --- a/dependency-reduced-pom.xml +++ b/dependency-reduced-pom.xml @@ -41,8 +41,8 @@ maven-compiler-plugin - 6 - 6 + 11 + 11 diff --git a/pom.xml b/pom.xml index 397dec7..57ab49b 100644 --- a/pom.xml +++ b/pom.xml @@ -57,8 +57,8 @@ org.apache.maven.plugins maven-compiler-plugin - 6 - 6 + 11 + 11 diff --git a/src/main/java/com/smartsheet/utils/HttpUtils.java b/src/main/java/com/smartsheet/utils/HttpUtils.java index b404976..cc721dd 100644 --- a/src/main/java/com/smartsheet/utils/HttpUtils.java +++ b/src/main/java/com/smartsheet/utils/HttpUtils.java @@ -37,7 +37,6 @@ import com.smartsheet.exceptions.ServiceUnavailableException; import com.smartsheet.restapi.service.RetryingSmartsheetService; import com.smartsheet.tools.SmartsheetBackupTool; -import sun.misc.IOUtils; /** * Utilities for HTTP operations. From 2f6bc7ea61d2b8ab4bf096b025d9fa24fdb379c5 Mon Sep 17 00:00:00 2001 From: vairakkumar-vairaperumal <55999782+vairakkumar-vairaperumal@users.noreply.github.com> Date: Sat, 15 Aug 2020 08:14:29 -0700 Subject: [PATCH 2/5] Feature/upgrade java 11 (#2) * remove oracle lib reference and upgrade to openjdk 11 * update version number and add revision history in readme --- README.md | 2 ++ dependency-reduced-pom.xml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a7f0a22..8914f0d 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ This command-line backup utility takes a snapshot of the data in a Smartsheet Te Release History ------------ +* Auguest 15 , 2020 - version 1.7.0: + - fixed a broken link in the Readme * Jan 21, 2020 - fixed a broken link in the Readme * Nov 9, 2018 - version 1.6.2: - Updated vulnerable dependencies. diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml index de64e79..c119437 100644 --- a/dependency-reduced-pom.xml +++ b/dependency-reduced-pom.xml @@ -4,7 +4,7 @@ com.smartsheet.tools smartsheet-org-backup Smartsheet Org Backup - 1.6.1 + 1.7.0 Backs up the Smartsheet sheets of all users in an organization to a local directory. From eced724285cd159a207c60b28c859530b3b87053 Mon Sep 17 00:00:00 2001 From: vairakkumar vairaperumal <55999782+vairakkumar-vairaperumal@users.noreply.github.com> Date: Sat, 15 Aug 2020 08:21:55 -0700 Subject: [PATCH 3/5] dockerize --- .gitignore | 3 ++- Dockerfile | 12 ++++++++++++ config/.gitkeep | 0 dependency-reduced-pom.xml | 2 +- docker-compose.yml | 10 ++++++++++ 5 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 Dockerfile create mode 100644 config/.gitkeep create mode 100644 docker-compose.yml diff --git a/.gitignore b/.gitignore index 9afa60a..c785e43 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ target ./dependency-reduced-pom.xml /backup .DS_Store -.idea/ \ No newline at end of file +.idea/ +config/*.properties \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..792a277 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM maven:3.6.3-openjdk-11 as appbuilder +WORKDIR /project +COPY ./.classpath . +COPY ./dependency-reduced-pom.xml . +COPY ./pom.xml . +RUN mvn dependency:go-offline +COPY ./src/ ./src/ +RUN mvn package + +FROM openjdk:11.0.8-jdk +WORKDIR /app +COPY --from=appbuilder /project/target/smartsheet-org-backup-1.6.2.jar . diff --git a/config/.gitkeep b/config/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml index c119437..9245739 100644 --- a/dependency-reduced-pom.xml +++ b/dependency-reduced-pom.xml @@ -4,7 +4,7 @@ com.smartsheet.tools smartsheet-org-backup Smartsheet Org Backup - 1.7.0 + 1.8.0 Backs up the Smartsheet sheets of all users in an organization to a local directory. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..6afaf9e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: "3.5" +services: + smartsheetbackup: + build: + context: . + image: smartsheet/smartsheet-backup:openjdk-11 + command: ["java", "-jar", "./smartsheet-org-backup-1.8.0.jar"] + volumes: + - "./backup:/app/backup" + - "./config/smartsheet-backup.properties:/app/smartsheet-backup.properties:ro" From b2824cbbecd400ab2dc95ecee56c47997b59c0e1 Mon Sep 17 00:00:00 2001 From: vairakkumar-vairaperumal <55999782+vairakkumar-vairaperumal@users.noreply.github.com> Date: Sat, 15 Aug 2020 08:30:22 -0700 Subject: [PATCH 4/5] Feature/upgrade java 11 (#3) * remove oracle lib reference and upgrade to openjdk 11 * update version number and add revision history in readme * update readme file --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8914f0d..8510916 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ This command-line backup utility takes a snapshot of the data in a Smartsheet Te Release History ------------ * Auguest 15 , 2020 - version 1.7.0: - - fixed a broken link in the Readme + - fixed to remove oracle lib reference and upgraded to openjdk 11 * Jan 21, 2020 - fixed a broken link in the Readme * Nov 9, 2018 - version 1.6.2: - Updated vulnerable dependencies. From b69197d9a93d2e5ffe352043c77b263aa0fe5c9d Mon Sep 17 00:00:00 2001 From: vairakkumar vairaperumal <55999782+vairakkumar-vairaperumal@users.noreply.github.com> Date: Sat, 15 Aug 2020 08:34:16 -0700 Subject: [PATCH 5/5] added readme file for Dockerization --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 8510916..2185978 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ This command-line backup utility takes a snapshot of the data in a Smartsheet Te Release History ------------ +* Auguest 15 , 2020 - version 1.8.0: + - dockerize backup tool * Auguest 15 , 2020 - version 1.7.0: - fixed to remove oracle lib reference and upgraded to openjdk 11 * Jan 21, 2020 - fixed a broken link in the Readme @@ -98,6 +100,15 @@ To execute the backup, run the following command `java -jar smartsheet-org-backu Since it's a runnable jar, you don't need to set classpath or copy other jars. Everything you need is in the runnable jar. +Dockerize & Docker-Compose +-------------------------- +This utility can also be used as a docker container. This sample has dockerized and a sample docker-compose file to backup. + +``` +docker-compose run --rm smartsheetbackup +``` + + Logging ------------------ * All the messages, including what is backed up as well as the folders and files being created, are logged to stdout.