Skip to content

Commit

Permalink
feat: update for modern ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Jmainguy committed Oct 17, 2024
1 parent 6e109fe commit b5bfa99
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 30 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build and Scan Docker Image

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
actions: read
contents: read
security-events: write

jobs:
docker-ci:
uses: Jmainguy/docker-workflows/.github/workflows/docker-ci.yml@v2
22 changes: 22 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release Docker Image

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release-please:
uses: Jmainguy/docker-workflows/.github/workflows/docker-release.yml@v2
secrets:
docker_username: ${{ secrets.DOCKER_USERNAME }}
docker_password: ${{ secrets.DOCKER_PASSWORD }}
with:
docker_url: zot.soh.re
image_name: ${{ github.event.repository.name }}
authors: "Jonathan Seth Mainguy <jon@soh.re>"
vendor: "Jmainguy"
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.0.0"
}
30 changes: 16 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
FROM centos:latest
MAINTAINER Jonathan Mainguy <jon@soh.re>
RUN yum install -y git ruby rubygem-bundler && \
yum clean all
RUN chmod 777 /opt
RUN mkdir -p /opt/statuscode
ADD . /opt/statuscode
WORKDIR /opt/statuscode
ENV HOME=/opt/statuscode
RUN gem install bundler
RUN bundle update --bundler
RUN bundler
FROM cgr.dev/chainguard/ruby:latest-dev as builder

ENV GEM_HOME=/work/vendor
ENV GEM_PATH=${GEM_PATH}:/work/vendor
COPY Gemfile /work/
RUN gem install bundler && bundle install

FROM cgr.dev/chainguard/ruby:latest

ENV GEM_HOME=/work/vendor
ENV GEM_PATH=${GEM_PATH}:/work/vendor

COPY --from=builder /work/ /work/
COPY app.rb /work/
EXPOSE 4567
USER 1337:1337
CMD ["ruby", "/opt/statuscode/app.rb"]

ENTRYPOINT [ "ruby", "app.rb" ]
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ source 'https://rubygems.org'
gem "rack", ">= 2.1.4"
gem "rack-protection", ">= 1.5.5"
gem 'sinatra'

gem "rackup", "~> 2.1"
31 changes: 21 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
GEM
remote: https://rubygems.org/
specs:
mustermann (1.1.2)
base64 (0.2.0)
mustermann (3.0.3)
ruby2_keywords (~> 0.0.1)
rack (2.2.9)
rack-protection (2.2.1)
rack
rack (3.1.8)
rack-protection (4.0.0)
base64 (>= 0.1.0)
rack (>= 3.0.0, < 4)
rack-session (2.0.0)
rack (>= 3.0.0)
rackup (2.1.0)
rack (>= 3)
webrick (~> 1.8)
ruby2_keywords (0.0.5)
sinatra (2.2.1)
mustermann (~> 1.0)
rack (~> 2.2)
rack-protection (= 2.2.1)
sinatra (4.0.0)
mustermann (~> 3.0)
rack (>= 3.0.0, < 4)
rack-protection (= 4.0.0)
rack-session (>= 2.0.0, < 3)
tilt (~> 2.0)
tilt (2.0.11)
tilt (2.4.0)
webrick (1.8.2)

PLATFORMS
ruby
x86_64-linux

DEPENDENCIES
rack (>= 2.1.4)
rack-protection (>= 1.5.5)
rackup (~> 2.1)
sinatra

BUNDLED WITH
2.1.4
2.5.22
2 changes: 0 additions & 2 deletions build.sh

This file was deleted.

17 changes: 17 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"include-v-in-tag": true,
"separate-pull-requests": true,
"packages": {
".": {
"release-type": "go",
"extra-files": [
{
"path": "README.md",
"type": "generic"
}
],
"changelog-path": "CHANGELOG.md"
}
},
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}
4 changes: 0 additions & 4 deletions run.sh

This file was deleted.

0 comments on commit b5bfa99

Please sign in to comment.