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/README.md b/README.md index a7f0a22..2185978 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,10 @@ 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 * Nov 9, 2018 - version 1.6.2: - Updated vulnerable dependencies. @@ -96,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. 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 0b497e3..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.6.1 + 1.8.0 Backs up the Smartsheet sheets of all users in an organization to a local directory. @@ -41,8 +41,8 @@ maven-compiler-plugin - 6 - 6 + 11 + 11 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" 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.