From c8115df2e95928e059f970640b3da3b6c9138da4 Mon Sep 17 00:00:00 2001 From: Spencer Pincott Date: Thu, 11 Aug 2022 21:26:29 -0400 Subject: [PATCH] Add CI/CD --- Dockerfile | 3 +++ Jenkinsfile | 45 +++++++++++++++++++++++++++++++++++++++++++++ public/index.html | 2 +- 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 Jenkinsfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7bed741 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM httpd + +COPY ./public/ /usr/local/apache2/htdocs/ diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..ee57a60 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,45 @@ +node { + stage ("Checkout") { + checkout scm + } + + stage ("Dependencies") { + npm ci + } + + stage ("Build Gatsby") { + environment { + GATSBY_FIREBASE_API_KEY = credentials('FIREBASE_API_KEY') + GATSBY_AUTH_DOMAIN = spencassemble-sol-journal.firebaseapp.com + GATSBY_DATABASE_URL = https://spencassemble-sol-journal.firebaseio.com + GATSBY_PROJECT_ID = spencassemble-sol-journal + GATSBY_STORAGE_BUCKET = spencassemble-sol-journal.appspot.com + GATSBY_MESSAGING_SENDER_ID = 299522647169 + GATSBY_APP_ID = 1:299522647169:web:fc74af44747fd7cef79980 + } + steps { + npm run build + } + } + + docker.withServer("ssh://rancher@192.168.1.116") { + docker.image("docker").withRun("") { + withCredentials([usernamePassword(credentialsId: "DockerHub", usernameVariable: "DOCKERUSER", passwordVariable: "DOCKERPASS")]) { + sh 'docker login -u "$DOCKERUSER" -p "$DOCKERPASS"' + } + + stage ("Build Container") { + sh "docker image build -t spencerpincott/sol-journal:1.${env.BUILD_NUMBER} ." + } + + stage ("Publish Container") { + sh "docker image push spencerpincott/sol-journal:1.${env.BUILD_NUMBER}" + } + } + } + + stage ("Deploy") { + sh "ssh rancher@192.168.1.116 'docker stop sol-journal && docker rm sol-journal'" + sh "ssh rancher@192.168.1.116 'docker run -dit -p 5000:80 --name sol-journal --restart=always spencerpincott/sol-journal:1.${env.BUILD_NUMBER}'" + } +} diff --git a/public/index.html b/public/index.html index da1c581..811d816 100644 --- a/public/index.html +++ b/public/index.html @@ -1 +1 @@ -
\ No newline at end of file +Sol Journal
SOL JOURNAL

Record what's on your mind, from anywhere

Journaling can improve your health and help you take inventory of your day. Sol Journal works offline and from any device. Use it as a place to record thoughts and events from the day.

splash

Features

Lightweight with the functionalities you need for journaling, and none of the things you don't:

Cross Platform
Write from any internet connected device, with pages optimized for all screen sizes
Install as an App
Add to your home screen on iPhone or Adroid to use it like you would an app
Offline Capable
Record thoughts as they come to you, whether you have internet or not, your entries are saved when you get a connection
Full Text Search
Search through your entries by text to quickly find past entries and recall what you've written
Export
Download all of your journal entries at any time for back-up or safe keeping
Dark Mode
Take it easy on your eyes, with an easily accessible toggle from all screens and detection of night hours to turn on automatically
\ No newline at end of file