Skip to content
Snippets Groups Projects
Commit bf0da29d authored by John Harris's avatar John Harris
Browse files

build: define ci process

parent 6100464e
No related branches found
No related tags found
No related merge requests found
Pipeline #30540 failed
image: "ruby:2.7"
stages:
- release
before_script:
- sudo apt-get update -qq
- ruby -v
- which ruby
- gem install bundler --no-document
- bundle install --jobs $(nproc) "${FLAGS[@]}"
rubocop:
script:
- bundle exec rubocop
release:
stage: release
rules:
- if: '$CI_COMMIT_TAG'
script:
- mkdir -p ~/.gem
- cp $RUBYGEMS_CREDENTIALS ~/.gem/credentials
- chmod 0600 ~/.gem/credentials
- gem update --system
- ruby --version
- gem env version
- sed -i "s/0.1.0/$CI_COMMIT_TAG/g" lib/nexus_semantic_logger/version.rb
- gem build nexus_semantic_logger.gemspec
- gem push nexus_semantic_logger*.gem
artifacts:
paths:
- nexus_semantic_logger*.gem
expire_in: 30 days
\ No newline at end of file
# frozen_string_literal: true
source 'https://rubygems.org'
gemspec
......@@ -5,7 +5,7 @@ module NexusSemanticLogger
class Application
include SemanticLogger::Loggable
def self.common(config)
def self.common(config, service)
# Set a safe logging level which individual environments can make more verbose if needed.
config.log_level = ENV.fetch('LOG_LEVEL', 'INFO')
......@@ -31,7 +31,7 @@ module NexusSemanticLogger
SemanticLogger.sync!
# Default logging is stdout in datadog compatible JSON.
config.rails_semantic_logger.format = NexusSemanticLogger::DatadogFormatter.new('users')
config.rails_semantic_logger.format = NexusSemanticLogger::DatadogFormatter.new(service)
config.rails_semantic_logger.add_file_appender = false
config.semantic_logger.add_appender(io: $stdout, formatter: config.rails_semantic_logger.format)
......
# frozen_string_literal: true
module NexusSemanticLogger
# Leave this as 0.1.0 in order for CI process to replace with the tagged version.
VERSION = '0.1.0'
end
\ No newline at end of file
Gem::Specification.new do |spec|
spec.name = "nexus_semantic_logger"
spec.version = "1.0.0"
spec.version = NexusSemanticLogger::VERSION
spec.summary = "semantic_logger usage for nexus"
spec.authors = ["Johnathon Harris"]
spec.email = "john.harris@nexusmods.com"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment