Skip to content

Commit

Permalink
Change entry point to peble
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-ratushnyy committed Sep 29, 2023
1 parent 2e52a77 commit cd5a324
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Install dependencies
run: |
sudo snap install yq
sudo snap install rockcraft --classic --edge --revision=687
sudo snap install rockcraft --classic --edge
sudo snap install charmcraft --classic --revision 1349
- name: Build ROCK
run: |
Expand Down
29 changes: 20 additions & 9 deletions rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,22 @@ description: |
as a NoSQL database program, MongoDB uses JSON
-like documents with optional schemas.
license: Apache-2.0 # your application's SPDX license
entrypoint:
- /usr/bin/setpriv
- --clear-groups
- --reuid
- mongodb
- --regid
- mongodb
- --
- /usr/bin/mongod

services:
mongod:
summary: Start Mongod
override: replace
startup: enabled
command:
- /usr/bin/setpriv
- --clear-groups
- --reuid
- mongodb
- --regid
- mongodb
- --
- /usr/bin/mongod


platforms: # The platforms this ROCK should be built on and run on
amd64:
Expand All @@ -44,13 +51,16 @@ parts:
useradd -R $CRAFT_OVERLAY -M -r -g mongodb -u 584788 mongodb
override-prime: |
craftctl default
# Give permission and create the required directories
mkdir -p $CRAFT_PRIME/data/db
chmod 0755 $CRAFT_PRIME/data/db
chown -R 584788:584788 $CRAFT_PRIME/data/db
# enable security monitoring
rocks=usr/share/rocks/
mkdir -p ${rocks}
## for deb packages
declare -a arr=()
arr+=('${db:Status-Abbrev},')
Expand All @@ -59,6 +69,7 @@ parts:
arr+=('${source:Package},')
arr+=('${Source:Version}\n')
dpkg-query -W -f "${arr[*]}" > ${rocks}/dpkg.query
## for snap packages
cp snap.charmed-mongodb/manifest.yaml ${rocks}
cp snap.charmed-mongodb/snapcraft.yaml ${rocks}
Expand Down

0 comments on commit cd5a324

Please sign in to comment.