From c18940ff99ae29053a6d852164f36e77260d703e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Wed, 7 Sep 2022 21:19:55 +0200 Subject: [PATCH] add Jenkinsfile for CI builds, extend Makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- .gitignore | 1 + Jenkinsfile | 47 +++++++++++++++++++++++++++++++++++++++++++++++ Makefile | 23 ++++++++++++++++------- config.toml | 2 +- static/CNAME | 1 + 5 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 Jenkinsfile create mode 100644 static/CNAME diff --git a/.gitignore b/.gitignore index 182026f9c..7415389d8 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ public resources .idea content/.obsidian +static/linkmap assets/indices/linkIndex.json assets/indices/contentIndex.json linkmap diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..fb6c58c43 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,47 @@ +pipeline { + agent { + label 'linux' + } + + options { + timestamps() + /* Prevent Jenkins jobs from running forever */ + timeout(time: 10, unit: 'MINUTES') + /* manage how many builds we keep */ + buildDiscarder(logRotator( + numToKeepStr: '20', + daysToKeepStr: '30', + )) + disableConcurrentBuilds() + } + + environment { + GIT_COMMITTER_NAME = 'status-im-auto' + GIT_COMMITTER_EMAIL = 'auto@status.im' + } + + stages { + stage('Deps') { + steps { + sh 'make setup' + } + } + + stage('Build') { + steps { + /* Make hugo-obsidian available. */ + withEnv(["PATH+EXTRA=${env.HOME}/go/bin"]) { + sh 'make build' + } + } + } + + stage('Publish Prod') { + steps { + sshagent(credentials: ['status-im-auto-ssh']) { + sh 'ghp-import -p public' + } + } + } + } +} diff --git a/Makefile b/Makefile index 5a88927fa..7b6e7b832 100644 --- a/Makefile +++ b/Makefile @@ -3,18 +3,27 @@ help: ## Show all Makefile targets @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' -update: ## Update Quartz to the latest version on Github +setup: install-hugo-obsidian + +install-hugo-obsidian: go install github.com/jackyzha0/hugo-obsidian@latest + +update: install-hugo-obsidian ## Update Quartz to the latest version on Github @git remote show upstream || (echo "remote 'upstream' not present, setting 'upstream'" && git remote add upstream https://github.com/jackyzha0/quartz.git) git fetch upstream git log --oneline --decorate --graph ..upstream/hugo - git checkout -p upstream/hugo -- layouts .github Makefile assets/js assets/styles/base.scss assets/styles/darkmode.scss config.toml data + git checkout -p upstream/hugo -- layouts .github assets/js assets/styles/base.scss assets/styles/darkmode.scss config.toml data -update-force: ## Forcefully pull all changes and don't ask to patch - go install github.com/jackyzha0/hugo-obsidian@latest +update-force: install-hugo-obsidian ## Forcefully pull all changes and don't ask to patch @git remote show upstream || (echo "remote 'upstream' not present, setting 'upstream'" && git remote add upstream https://github.com/jackyzha0/quartz.git) git fetch upstream - git checkout upstream/hugo -- layouts .github Makefile assets/js assets/styles/base.scss assets/styles/darkmode.scss config.toml data + git checkout upstream/hugo -- layouts .github assets/js assets/styles/base.scss assets/styles/darkmode.scss config.toml data -serve: ## Serve Quartz locally - hugo-obsidian -input=content -output=assets/indices -index -root=. && hugo server --enableGitInfo --minify +obsidian: + hugo-obsidian -input=content -output=assets/indices -index -root=. + +build: obsidian + hugo --enableGitInfo + +serve: obsidian ## Serve Quartz locally + hugo server --enableGitInfo diff --git a/config.toml b/config.toml index a545ed815..548320bb6 100644 --- a/config.toml +++ b/config.toml @@ -1,4 +1,4 @@ -baseURL = "https://quartz.jzhao.xyz/" +baseURL = "https://roadmap.logos.co/" languageCode = "en-us" googleAnalytics = "G-XYFD95KB4J" relativeURLs = false diff --git a/static/CNAME b/static/CNAME new file mode 100644 index 000000000..37d312365 --- /dev/null +++ b/static/CNAME @@ -0,0 +1 @@ +roadmap.logos.co