Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.4.1: Pigs might 🪰 #241

Merged
merged 24 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
faf2d2c
Bump actions/checkout from 4.1.0 to 4.1.1
dependabot[bot] Oct 17, 2023
8bc8bb2
Bump docker/build-push-action from 5.0.0 to 5.1.0
dependabot[bot] Nov 17, 2023
0097f7a
WEB-6625: Add free attribute to Lesson
KapilSachdev Dec 28, 2023
50f4ae6
Merge pull request #234 from razeware/dependabot/github_actions/docke…
KapilSachdev Dec 28, 2023
51bac32
Merge pull request #233 from razeware/dependabot/github_actions/actio…
KapilSachdev Dec 28, 2023
4bc5c12
Merge pull request #235 from razeware/WEB-6625
KapilSachdev Dec 28, 2023
44eef29
WEB-6754: Fixing images in local preview
sammyd Jan 8, 2024
29cbf08
Merge pull request #237 from razeware/WEB-6754
sammyd Jan 8, 2024
e52f375
WEB-6755: Upgrading to ruby 3.3
sammyd Jan 9, 2024
dcb39bd
WEB-6755: Upgrading gems
sammyd Jan 9, 2024
91c362f
WEB-6755: Upgrading bundler
sammyd Jan 9, 2024
b6447f6
WEB-6755: Rubocop fixes
sammyd Jan 9, 2024
f575ea6
WEB-6755: Making it multi-stage build docker file
sammyd Jan 9, 2024
516d081
WEB-6755: Have to lock commonmarker to get it to work on musl
sammyd Jan 9, 2024
62d55f3
WEB-6755: There is better checking now...
sammyd Jan 9, 2024
db591df
WEB-6755: Adding a comment explaining the pinning
sammyd Jan 9, 2024
1dfca5a
WEB-6755: Missed dropping some places back to ruby 3.2
sammyd Jan 9, 2024
e4566d9
Merge pull request #238 from razeware/WEB-6755
sammyd Jan 9, 2024
5bb4d43
WEB-6757: Checking for image existence in content modules
sammyd Jan 10, 2024
a0d7ed2
WEB-6757: Improving lesson and segment validation
sammyd Jan 10, 2024
4c9fdd6
Merge pull request #239 from razeware/WEB-6757
sammyd Jan 10, 2024
a44d6aa
WEB-6568: Updating slack images in robles
sammyd Jan 15, 2024
d27bdbf
Merge pull request #240 from razeware/WEB-6568
sammyd Jan 15, 2024
c7fb8cb
Need to mark github directory as safe if we're inside CI
sammyd Jan 16, 2024
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
6 changes: 3 additions & 3 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/[email protected].0
- uses: actions/[email protected].1

- name: Run tests
run: |
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
status: STARTING
color: warning

- uses: actions/[email protected].0
- uses: actions/[email protected].1

- name: Set up QEMU
uses: docker/[email protected]
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
echo "::set-output name=tag_list::${TAG_LIST}"

- name: Build and push
uses: docker/build-push-action@v5.0.0
uses: docker/build-push-action@v5.1.0
with:
context: .
platforms: linux/amd64,linux/arm64
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/[email protected].0
- uses: actions/[email protected].1

- name: Run tests
run: |
Expand Down
59 changes: 52 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
FROM ruby:3.2-alpine
LABEL [email protected]
ARG RUBY_ENV

LABEL com.github.actions.name="robles"
LABEL com.github.actions.author="Kodeco <[email protected]>"
LABEL com.github.actions.description="Content publication for kodeco.com"
LABEL com.github.actions.color="purple"
LABEL com.github.actions.icon="book"
FROM ruby:3.2-alpine AS builder
LABEL [email protected]

ARG APP_ROOT=/app/robles
ARG BUILD_PACKAGES="build-base git"
Expand Down Expand Up @@ -41,3 +37,52 @@ RUN bundle install --jobs 20 --retry 5

# Copy the main application.
COPY . ./

# Remove extra files
RUN rm -rf /usr/local/bundle/cache/*


##############################
# PACKAGE STAGE #
##############################
FROM ruby:3.2-alpine
LABEL [email protected]
LABEL com.github.actions.name="robles"
LABEL com.github.actions.author="Kodeco <[email protected]>"
LABEL com.github.actions.description="Content publication for kodeco.com"
LABEL com.github.actions.color="purple"
LABEL com.github.actions.icon="book"

ARG APP_ROOT=/app/robles
ARG RUBY_ENV=${RUBY_ENV:-production}

ENV RUBY_ENV=${RUBY_ENV}

ARG RUNTIME_PACKAGES="imagemagick git tzdata"
ARG TEST_AND_DEV_PACKAGES="bash build-base libsodium-dev"

# SYSLOG TO STDOUT
RUN \
touch /var/log/syslog && \
ln -sf /proc/1/fd/1 /var/log/syslog

# libsodium
COPY --from=builder /usr/lib/libsodium.so* /usr/lib/
# Copy the app from builder
COPY --from=builder $APP_ROOT $APP_ROOT
COPY --from=builder /usr/local/bundle /usr/local/bundle

# Set the working directory
WORKDIR $APP_ROOT

# For runtime
RUN apk update \
&& apk upgrade \
&& apk add --update --no-cache $RUNTIME_PACKAGES \
&& rm -rf /var/cache/apk/*

# Test and dev packages
RUN if [ "$RUBY_ENV" == "test" -o "$RUBY_ENV" == "development" ]; then \
apk add --update --no-cache $TEST_AND_DEV_PACKAGES \
&& rm -rf /var/cache/apk/*; \
fi
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ gem 'cli-ui', '~> 2'
gem 'thor', '~> 1.0', '>= 1.0.1'

# Markdown processing
gem 'commonmarker'
# >= 1 switches out the underlying library to one that does not support musl
# Currently, there are no plans to support it, so let's lock to < 1
gem 'commonmarker', '< 1'

# HTTP Client
gem 'faraday', '~> 2'
Expand Down
86 changes: 43 additions & 43 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ GIT
GEM
remote: https://rubygems.org/
specs:
activemodel (7.1.1)
activesupport (= 7.1.1)
activesupport (7.1.1)
activemodel (7.1.2)
activesupport (= 7.1.2)
activesupport (7.1.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
Expand All @@ -26,44 +26,44 @@ GEM
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
addressable (2.8.5)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
aws-eventstream (1.2.0)
aws-partitions (1.835.0)
aws-sdk-core (3.185.1)
aws-eventstream (~> 1, >= 1.0.2)
aws-eventstream (1.3.0)
aws-partitions (1.877.0)
aws-sdk-core (3.190.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
aws-sigv4 (~> 1.8)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.72.0)
aws-sdk-core (~> 3, >= 3.184.0)
aws-sdk-kms (1.76.0)
aws-sdk-core (~> 3, >= 3.188.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.136.0)
aws-sdk-core (~> 3, >= 3.181.0)
aws-sdk-s3 (1.142.0)
aws-sdk-core (~> 3, >= 3.189.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.6)
aws-sigv4 (1.6.0)
aws-sigv4 (~> 1.8)
aws-sigv4 (1.8.0)
aws-eventstream (~> 1, >= 1.0.2)
backport (1.2.0)
base64 (0.1.1)
benchmark (0.2.1)
bigdecimal (3.1.4)
base64 (0.2.0)
benchmark (0.3.0)
bigdecimal (3.1.5)
cli-ui (2.2.3)
coderay (1.1.3)
commonmarker (0.23.10)
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
daemons (1.4.1)
diff-lcs (1.5.0)
drb (2.1.1)
drb (2.2.0)
ruby2_keywords
e2mmap (0.1.0)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
faraday (2.7.11)
faraday (2.8.1)
base64
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
Expand All @@ -77,7 +77,7 @@ GEM
websocket-driver (>= 0.6, < 0.8)
ffi (1.16.3)
formatador (1.1.0)
git (1.18.0)
git (1.19.0)
addressable (~> 2.8)
rchardet (~> 1.8)
google-protobuf (3.22.0)
Expand All @@ -101,7 +101,7 @@ GEM
concurrent-ruby (~> 1.0)
jaro_winkler (1.5.6)
jmespath (1.6.2)
json (2.6.3)
json (2.7.1)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
Expand All @@ -110,17 +110,17 @@ GEM
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
lumberjack (1.2.9)
lumberjack (1.2.10)
method_source (1.0.0)
mini_magick (4.12.0)
mini_portile2 (2.8.4)
mini_portile2 (2.8.5)
minitest (5.20.0)
multi_json (1.15.0)
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
mutex_m (0.1.2)
mutex_m (0.2.0)
nenv (0.3.0)
nokogiri (1.15.4)
nokogiri (1.16.0)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
notiffany (0.1.3)
Expand All @@ -129,48 +129,48 @@ GEM
octokit (7.2.0)
faraday (>= 1, < 3)
sawyer (~> 0.9)
parallel (1.23.0)
parser (3.2.2.4)
parallel (1.24.0)
parser (3.3.0.2)
ast (~> 2.4.1)
racc
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (5.0.3)
racc (1.7.1)
public_suffix (5.0.4)
racc (1.7.3)
rack (2.2.8)
rack-livereload (0.5.1)
rack
rack-protection (3.1.0)
rack-protection (3.2.0)
base64 (>= 0.1.0)
rack (~> 2.2, >= 2.2.4)
rack-test (2.1.0)
rack (>= 1.3)
rainbow (3.1.1)
rake (13.0.6)
rake (13.1.0)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rbnacl (7.1.1)
ffi
rbs (2.8.4)
rchardet (1.8.0)
regexp_parser (2.8.2)
regexp_parser (2.9.0)
reverse_markdown (2.1.1)
nokogiri
rexml (3.2.6)
rubocop (1.57.1)
base64 (~> 0.1.1)
rubocop (1.59.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.4)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
Expand All @@ -181,13 +181,13 @@ GEM
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
shellany (0.0.1)
sinatra (3.1.0)
sinatra (3.2.0)
mustermann (~> 3.0)
rack (~> 2.2, >= 2.2.4)
rack-protection (= 3.1.0)
rack-protection (= 3.2.0)
tilt (~> 2.0)
slack-notifier (2.4.0)
solargraph (0.49.0)
solargraph (0.50.0)
backport (~> 1.2)
benchmark
bundler (~> 2.0)
Expand All @@ -207,7 +207,7 @@ GEM
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
thor (1.2.2)
thor (1.3.0)
tilt (2.3.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
Expand All @@ -227,7 +227,7 @@ DEPENDENCIES
activesupport (< 7.2)
aws-sdk-s3 (~> 1.64)
cli-ui (~> 2)
commonmarker
commonmarker (< 1)
concurrent-ruby (~> 1.1)
faraday (~> 2)
faraday-retry
Expand All @@ -253,4 +253,4 @@ DEPENDENCIES
zeitwerk (~> 2.3)

BUNDLED WITH
2.4.20
2.5.4
14 changes: 0 additions & 14 deletions app/commands/content_module_cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,6 @@ def slides
snapshotter.generate
end


desc 'serve', 'starts local preview server'
option :dev, type: :boolean, desc: 'Run in development mode (watch robles files, not module files)'
def serve
fork do
if options[:dev]
Guard.start(no_interactions: true)
else
Guard.start(guardfile_contents: content_module_guardfile, watchdir: './', no_interactions: true)
end
end
RoblesContentModuleServer.run!
end

desc 'secrets [REPO]', 'configures a module repo with the necessary secrets'
long_desc <<-LONGDESC
`robles module secrets [REPO]` will upload the secrets requires to run robles on a
Expand Down
6 changes: 3 additions & 3 deletions app/commands/video_cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class VideoCli < Thor
option :'release-file', type: :string, desc: 'Location of the release.yaml file'
option :local, type: :boolean
def render
video_course = runner.render_video_course(release_file: options['release_file'], local: options['local'])
runner.render_video_course(release_file: options['release_file'], local: options['local'])
end

desc 'serve', 'starts local preview server'
Expand Down Expand Up @@ -39,8 +39,8 @@ def upload

desc 'lint [RELEASE_FILE]', 'runs a selection of linters on the video course'
option :'release-file', type: :string, desc: 'Location of the release.yaml file'
method_option 'without-version': :boolean, aliases: '-e', default: false, desc: 'Run linting without git branch naming check'
method_option silent: :boolean, aliases: '-s', default: false, desc: 'Hide all output'
method_option :'without-version', type: :boolean, aliases: '-e', default: false, desc: 'Run linting without git branch naming check'
method_option :silent, type: :boolean, aliases: '-s', default: false, desc: 'Hide all output'
def lint
output = runner.lint_video_course(release_file: options['publish_file'], options:)
exit 1 unless output.validated || ENVIRONMENT == 'staging'
Expand Down
2 changes: 1 addition & 1 deletion app/lib/linting/book_linter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def book
parser.parse
end
rescue Parser::Error => e
line_number = (e.message.match(/at line (\d+)/)&.captures&.first&.to_i || 0) + 1
line_number = e.message.match(/at line (\d+)/)&.captures&.first.to_i + 1
annotations.push(
Annotation.new(
absolute_path: e.file,
Expand Down
Loading
Loading