Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/known_hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
104.236.66.244 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBNiDodt9vD6R4Tkj6MjXpwWb1sYr6JMo/b8Aek4cHaPtHuyVWWVIXmF8e7H0oQCzJ4sixTePkjkf6xK31zz+1Y=
104.236.66.244 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCrINr29cQcqeVqpaBk36cQBv0tdCZ8SM7RIyW1uUHhxwRRd8RWbjGatLQhXELJGlSMLhrUf1KzfzCmXj/4L/l03TffeSDuGWJpxusTI93knKN+mWT69+IudkvIymQnCjaVio/MDOhwRLfkxE0nFGLdj8MbRJA35w/P6qbzIvwjKkHgw6VkbBS1c/4jEjsshIk+Z4P1GPiSw8lwscB8EjpZbOnhOWDYHaZUEpujdGbeIIKK31T/HSgFznEjZGuJmgLXnIf5+2h+WXrjeMljVVe613PNHrydBaR/7JxmWZIltoXyzL7ZDR9wZUQ47DumyMm07BtpQ+LZRCbeAvK+Smrt
68.183.148.118 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCq8NG9rifxGhkfA2/E4zXluAzMneDy4iSCOoaQkOXL8IugY4gmsIN0XGM40F1/p5CxfLPVLGU6ssT4vblFaCnnbUF6c522NZhIfDKpulJaFHesdmtinyHGkPBSgOWibm0ay2dsMfWOEPc95u0/CA1oeJ/OdNh4bq4jWFbbEndQ9nIBs9wOJxBXrGMHB3GFQhuEG/vU5iqVAlp3CNdpEY4IjGLlfO63pPxEQRc6MDQ7ILr1DuolOly4me4Inh63pb13ARduWHvqqzc7jf2yhnusworUaRIbZJhYKVcoZyJ0DHglh+Y5yIv2tRVEIyL5edY8YPMAb9mxAILr9dpfUFP
68.183.148.118 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNnXWiDC1zD8BL+LkIZfSHeZ87CPLJjHaPRltqDMlHJZXb9icnWH9yAwPu4J58CcxTTQpKVkG96q5PmvM/T1qgA=
73 changes: 73 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Deploy

# Replaces Travis CI. Builds the uberjar, copies it to both engine hosts
# (api-bible-docs web + worker generator) and restarts the supervisor program.
# Requires org secret ANYCHART_BOT_KEY: the anychart-bot private key, authorized
# as root on both hosts (servers-conf SSH_KEYS).

on:
push:
branches: [master, staging]
workflow_dispatch:

concurrency:
group: deploy-${{ github.ref_name }}
cancel-in-progress: false

permissions:
contents: read

env:
HOSTS: "104.236.66.244 68.183.148.118"

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Resolve target app
run: |
case "${GITHUB_REF_NAME}" in
master) echo "APP=reference-prod" >> "$GITHUB_ENV" ;;
staging) echo "APP=reference-stg" >> "$GITHUB_ENV" ;;
*) echo "No deploy target for ${GITHUB_REF_NAME}"; exit 1 ;;
esac

- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "8"

- uses: DeLaGuardo/setup-clojure@13.2
with:
lein: 2.9.8

- uses: actions/cache@v4
with:
path: ~/.m2
key: m2-${{ hashFiles('project.clj') }}
restore-keys: m2-

- name: Build uberjar
run: |
lein sass4clj once
lein uberjar

- name: Install SSH key
env:
ANYCHART_BOT_KEY: ${{ secrets.ANYCHART_BOT_KEY }}
run: |
test -n "$ANYCHART_BOT_KEY" || { echo "ANYCHART_BOT_KEY secret is not set"; exit 1; }
install -d -m 700 ~/.ssh
printf '%s\n' "$ANYCHART_BOT_KEY" > ~/.ssh/id_deploy
chmod 600 ~/.ssh/id_deploy
cp .github/known_hosts ~/.ssh/known_hosts

- name: Copy jar and restart
run: |
SSH_OPTS="-i $HOME/.ssh/id_deploy -o IdentitiesOnly=yes -o BatchMode=yes -o StrictHostKeyChecking=yes"
for host in $HOSTS; do
scp $SSH_OPTS "target/reference-3.0.0-standalone.jar" "root@${host}:/apps/${APP}/reference-3.0.0-standalone.jar.new"
ssh $SSH_OPTS "root@${host}" "mv /apps/${APP}/reference-3.0.0-standalone.jar.new /apps/${APP}/reference-3.0.0-standalone.jar && supervisorctl restart ${APP} && supervisorctl status ${APP}"
done
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ id_rsa_prod
id_rsa
.travis/id_rsa
package-lock.json
resources/public/css/style.css
resources/public/css/style.css
.clj-kondo
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ after_success:
- scp target/reference-3.0.0-standalone.jar root@68.183.148.118:/apps/$APP/reference-3.0.0-standalone.jar
- ssh root@104.236.66.244 "supervisorctl restart $APP"
- ssh root@68.183.148.118 "supervisorctl restart $APP"
notifications:
slack:
secure: eewE3FcToXLQj/qkqvqD4pKYKNcH9w0Q81+K66ieGSzIh31yJlbnjIMRLrA3vvXWzzVjmVcz3rKFU1HztZTYT6s632fbHUOI7OxRwCIXplAhjMqMIuMsu7JPbQfpeQ5YBG6sz5oyDVPOVbRy4irauOx5HDEAr2YikR/878qW7Lo=
# ToDo: Implement notifications
# notifications:
1 change: 1 addition & 0 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
[ring/ring-json "0.4.0"]
[ring/ring-core "1.7.1"]
[enlive "1.1.6"]
[org.apache.commons/commons-lang3 "3.8.1"]
;; logging
[com.taoensso/timbre "4.10.0"]
;; databases
Expand Down
145 changes: 87 additions & 58 deletions src-scss/elements/_footer.scss
Original file line number Diff line number Diff line change
@@ -1,63 +1,92 @@
#footer {
height: 70px;
background: #f6f6f6;
bottom: 0;
width: 100%;
position: absolute;
overflow: hidden;
#footer-inner {
border-top: 1px solid #dddddd;
margin: 0 25px;
font-size: 12px;
padding: 10px 0;

a.soc-network {
display: inline-block;
.soc-network-icon {
font-size: 20px;
display: inline-block;
margin-right: 10px;
vertical-align: middle;
width: 30px;
height: 30px;
line-height: 30px;
height: 70px;
background: #f6f6f6;
bottom: 0;
width: 100%;
position: absolute;
overflow: hidden;
#footer-inner {
border-top: 1px solid #dddddd;
margin: 0 25px;
font-size: 12px;
padding: 10px 0;
text-align: center;
border-radius: 50%;
color: #929292;
border: 2px solid #929292;
position: relative;
.sn-mini-icon {
font-size: 20px !important;
position: absolute;
top: 3px;
left: 3px;

.social-icons {
display: grid;
place-content: center;
grid-template-columns: repeat(auto-fit, 30px);
justify-content: space-evenly;

a.soc-network {
display: inline-block;
.soc-network-icon {
display: grid;
place-content: center;
width: 30px;
height: 30px;
border-radius: 50%;
color: #929292;
border: 2px solid #929292;

.sn-mini-icon {
font-size: 14px;
position: relative;
}

&.fb {
.sn-mini-icon {
top: -1px;
}
}

&.in {
.sn-mini-icon {
top: -1px;
}
}

&.md {
.sn-mini-icon {
font-size: 10px;
}
}
}

&:hover {
text-decoration: none;
color: #fff;
}
&:focus .soc-network-icon.fb,
&:hover .soc-network-icon.fb {
background: #3a5bad;
border-color: #3a5bad;
color: #fff;
}
&:focus .soc-network-icon.tw,
&:hover .soc-network-icon.tw {
background: #1dcbea;
border-color: #1dcbea;
color: #fff;
}
&:focus .soc-network-icon.in,
&:hover .soc-network-icon.in {
background: #1182c9;
border-color: #1182c9;
color: #fff;
}
&:focus .soc-network-icon.md,
&:hover .soc-network-icon.md {
background: #191919;
border-color: #191919;
color: #fff;
}
}
}
}

&:hover {
text-decoration: none;
color: #fff;
}
&:focus .soc-network-icon.fb, &:hover .soc-network-icon.fb {
background: #3a5bad;
border-color: #3a5bad;
color: #fff;
}
&:focus .soc-network-icon.tw, &:hover .soc-network-icon.tw {
background: #1dcbea;
border-color: #1dcbea;
color: #fff;
}
&:focus .soc-network-icon.in, &:hover .soc-network-icon.in {
background: #1182c9;
border-color: #1182c9;
color: #fff;
}
}

p {
padding: 5px 0 15px 0;
color: #929292;
p {
padding: 5px 0 15px 0;
color: #929292;
}
}
}
}
}
29 changes: 16 additions & 13 deletions src/reference/components/notifier.clj
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
(ns reference.components.notifier
(:require [com.stuartsierra.component :as component]
[cheshire.core :refer [generate-string]]
[reference.notification.skype :as skype]
[reference.notification.slack :as slack]))
;; ToDo: add notifications
)
)


(defrecord Notifier [config]
Expand All @@ -16,33 +17,35 @@


(defn start-building [notifier branches removed-branches queue-index]
(slack/start-building notifier branches removed-branches queue-index))
;; ToDo: add notifications
)


(defn complete-building [notifier branches removed-branches queue-index]
(slack/complete-building notifier branches removed-branches queue-index))
;; ToDo: add notifications
)


(defn complete-building-with-errors [notifier branches queue-index & [e]]
(slack/complete-building-with-errors notifier branches queue-index e)
;(skype/complete-building-with-errors notifier branches queue-index e)
;; ToDo: add notifications
)


(defn start-version-building [notifier branch queue-index]
(slack/start-version-building notifier (:name branch) queue-index)
(skype/start-version-building notifier branch queue-index))
;; ToDo: add notifications
)


(defn complete-version-building [notifier branch queue-index dts-enabled]
(slack/complete-version-building notifier (:name branch) queue-index)
(skype/complete-version-building notifier branch queue-index dts-enabled))
;; ToDo: add notifications
)


(defn complete-version-building-error [notifier branch queue-index e ts-error]
(slack/complete-version-building-error notifier (:name branch) queue-index e ts-error)
(skype/complete-version-building-error notifier branch queue-index e ts-error))
;; ToDo: add notifications
)


(defn notify-404 [notifier path]
(slack/notify-404 notifier path))
;; ToDo: add notifications
)
25 changes: 3 additions & 22 deletions src/reference/config/spec.clj
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,8 @@
:config.redis.spec/db]))
(s/def :config/redis (s/keys :req-un [:config.redis/spec]))


(s/def :config.notifications.slack/channel string?)
(s/def :config.notifications.slack/token string?)
(s/def :config.notifications.slack/username string?)
(s/def :config.notifications/slack (s/keys :req-un [:config.notifications.slack/channel
:config.notifications.slack/token
:config.notifications.slack/username]))


(s/def :config.notifications.skype/id string?)
(s/def :config.notifications.skype/chat-id string?)
(s/def :config.notifications.skype/release-chat-id string?)
(s/def :config.notifications.skype/key string?)
(s/def :config.notifications/skype (s/keys :req-un [:config.notifications.skype/id
:config.notifications.skype/chat-id
:config.notifications.skype/key
:config.notifications.skype/release-chat-id]))

(s/def :config/notifications (s/keys :req-un [:config.notifications/skype
:config.notifications/slack]))

;; ToDo: add notifications
(s/def :config/notifications (s/keys :req-un []))

(s/def :config.jdbc/subprotocol string?)
(s/def :config.jdbc/password string?)
Expand Down Expand Up @@ -86,4 +67,4 @@
:config/generator
:config/jdbc
:config/notifications
:config/redis]))
:config/redis]))
Loading
Loading