Skip to content

Commit

Permalink
Merge pull request #28 from CptOfEvilMinions/deb_package_2
Browse files Browse the repository at this point in the history
Update DEB build files
  • Loading branch information
CptOfEvilMinions authored May 27, 2022
2 parents 5af7b8d + ea7b9b5 commit 3807f80
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
3 changes: 1 addition & 2 deletions deploy/cicd/deb/deb-conffiles
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/etc/osctrl/osctrl-{{ OSCTRL_COMPONTENT }}/service.json
/usr/share/osctrl/db.json.example
/usr/share/osctrl/redis.json.example
/etc/systemd/system/osctrl-{{ OSCTRL_COMPONTENT }}.service
12 changes: 7 additions & 5 deletions deploy/cicd/deb/generate-deb-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@ cp deploy/cicd/deb/deb-conffiles "${DEB_DIR}/DEBIAN/conffiles" && \


###################################### Example configs ######################################
cp deploy/config/db.json "${DEB_DIR}/usr/share/osctrl/db.json.example" && \
chmod 640 "${DEB_DIR}/usr/share/osctrl/db.json.example"
mkdir -p "${DEB_DIR}/tmp/osctrl-${OSCTRL_COMPONTENT}"

cp deploy/config/redis.json "${DEB_DIR}/usr/share/osctrl/redis.json.example" && \
chmod 640 "${DEB_DIR}/usr/share/osctrl/redis.json.example"
cp deploy/config/db.json "${DEB_DIR}/tmp/osctrl-${OSCTRL_COMPONTENT}/db.json.example" && \
chmod 640 "${DEB_DIR}/tmp/osctrl-${OSCTRL_COMPONTENT}/db.json.example"

cp deploy/config/redis.json "${DEB_DIR}/tmp/osctrl-${OSCTRL_COMPONTENT}/redis.json.example" && \
chmod 640 "${DEB_DIR}/tmp/osctrl-${OSCTRL_COMPONTENT}/redis.json.example"


###################################### General components content ######################################
mkdir -p "${DEB_DIR}/etc/osctrl/osctrl-${OSCTRL_COMPONTENT}" && \
mkdir -p "${DEB_DIR}/etc/osctrl/osctrl-${OSCTRL_COMPONTENT}"

cp osctrl-${OSCTRL_COMPONTENT}-${GOOS}-${GOARCH}.bin "${DEB_DIR}/usr/local/bin/osctrl-${OSCTRL_COMPONTENT}" && \
chmod 755 "${DEB_DIR}/usr/local/bin/osctrl-${OSCTRL_COMPONTENT}"
Expand Down
14 changes: 14 additions & 0 deletions deploy/cicd/deb/post-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@ then
chown root:osctrl -R /etc/osctrl/osctrl-{{ OSCTRL_COMPONTENT }}
fi

################### Copy common configs ###################
if [ ! -f /usr/share/osctrl/db.json.example ]
then
cp /tmp/osctrl-{{ OSCTRL_COMPONTENT }}/db.json.example /usr/share/osctrl/db.json.example
chown root:root /usr/share/osctrl/db.json.example
fi

if [ ! -f /usr/share/osctrl/redis.json.example ]
then
cp /tmp/osctrl-{{ OSCTRL_COMPONTENT }}/redis.json.example /usr/share/osctrl/redis.json.example
chown root:root /usr/share/osctrl/redis.json.example
fi
rm -rd /tmp/osctrl-{{ OSCTRL_COMPONTENT }}

################### osctrl-admin web assets ###################
if [ -d "/usr/share/osctrl/tmpl_admin" ]
then
Expand Down

0 comments on commit 3807f80

Please sign in to comment.