Skip to content

Commit

Permalink
Add saml and prometheus
Browse files Browse the repository at this point in the history
  • Loading branch information
nrobinaubertin committed Jul 7, 2023
1 parent af7faf2 commit 6e91856
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 48 deletions.
2 changes: 1 addition & 1 deletion image/scripts/app_launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export UNICORN_SIDEKIQS=1

cd "$CONTAINER_APP_ROOT/app" || exit

# bin/bundle exec prometheus_exporter &
bin/bundle exec prometheus_exporter &
bin/unicorn -c config/unicorn.conf.rb &

# If one of the processes exits, the other one will be killed so that the pod will be restarted by the failing probes
Expand Down
62 changes: 15 additions & 47 deletions rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,35 +103,17 @@ parts:
source-depth: 1
organize:
"*": srv/discourse/app/plugins/discourse-mermaid/
# get-saml-plugin-source:
# plugin: dump
# source: https://github.com/discourse/discourse-saml.git
# source-depth: 1
# after:
# - get-discourse
# organize:
# "*": srv/discourse/app/plugins/discourse-saml/
# build-packages:
# - ruby2.7
# - ruby2.7-dev
# override-stage: |
# craftctl default

# set -x
# mkdir -p "${CRAFT_STAGE}/srv/discourse/app/.gem"

# mkdir -p bin
# gem install -n "bin" bundler
# gem install bundler
# bin/bundle config set --local path 'bundle'
# grep ^gem $CRAFT_STAGE/srv/discourse/app/plugins/discourse-saml/plugin.rb >> ${CRAFT_STAGE}/srv/discourse/app/plugins/discourse-saml/Gemfile
# bin/bundle install --gemfile="${CRAFT_STAGE}/srv/discourse/app/plugins/discourse-saml/Gemfile"
# # echo "finished installing bundles"
# # gem install macaddr -v 1.0.0 -i /srv/discourse/app/plugins/discourse-saml/gems/2.7.0 --no-document --ignore-dependencies --no-user-install

# # cat plugin.rb
# # grep ^gem plugin.rb >> ${CRAFT_STAGE}/srv/discourse/app/discourse-saml/Gemfile
# # ${CRAFT_STAGE}/srv/discourse/app/bin/bundle install --gemfile=${CRAFT_STAGE}/srv/discourse/app/discourse-saml/Gemfile --path=${CRAFT_STAGE}/srv/discourse/app/discourse-saml/gems
get-saml-plugin-source:
plugin: dump
after:
- get-discourse
source: https://github.com/discourse/discourse-saml.git
source-depth: 1
override-build: |
craftctl default
grep -e ^gem plugin.rb >> Gemfile
organize:
"*": srv/discourse/app/plugins/discourse-saml/
get-patches:
plugin: dump
source: image/patches
Expand All @@ -153,6 +135,7 @@ parts:
plugin: nil
after:
- get-discourse
- get-saml-plugin-source
- apply-patches
build-packages:
- gettext-base
Expand All @@ -176,28 +159,13 @@ parts:
- ubuntu-dev-tools
- zlib1g-dev
override-build: |
set -x
cd $CRAFT_STAGE/srv/discourse/app
mkdir -p bin
gem install -n "bin" bundler
find / -name "Gemfile" || true
find / -name "gem" || true
find / -name "ruby2.7" || true
find / -name "bundle" || true
# echo "start installing bundles"
# bin/bundle config set --local path 'bundle'
grep mail Gemfile
echo "gem 'prometheus_exporter'" >> Gemfile
bin/bundle install
bin/bundle info rake
bin/bundle info mail
# echo "finished installing bundles"
find / -name "rake" || true
find / -name "rakefile" || true
find / -name "Rakefile" || true
find / -name "Rakefile.rb" || true
find / -name "rakefile.rb" || true
# gem install macaddr -v 1.0.0 -i /srv/discourse/app/plugins/discourse-saml/gems/2.7.0 --no-document --ignore-dependencies --no-user-install
bin/bundle install --gemfile="plugins/discourse-saml/Gemfile"
organize:
'/usr/local/bin/prometheus_exporter': usr/local/bin/
'/var/lib/gems': var/lib/gems
'srv/discourse/app/bin/*': srv/discourse/app/bin/
'srv/discourse/app/Rakefile': srv/discourse/app/
Expand Down

0 comments on commit 6e91856

Please sign in to comment.