Skip to content

Commit

Permalink
Merge pull request #331 from m-ildefons/wip/tools-merge
Browse files Browse the repository at this point in the history
Wip/tools merge
  • Loading branch information
m-ildefons authored Feb 6, 2023
2 parents 78c5a33 + 0e5f8e1 commit 91e90db
Show file tree
Hide file tree
Showing 66 changed files with 5,348 additions and 31 deletions.
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,10 @@ charset = utf-8
[*.md]
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2
end_of_line = lf

[*.md]
max_line_length = off
trim_trailing_whitespace = false
55 changes: 55 additions & 0 deletions .github/workflows/build-environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
name: Build Environment
on:
push:
branches:
- "main"

workflow_call:
inputs:
tag:
description: "A tag to use for the container image."
required: false
type: string
default: "latest"
ref:
description: "The git ref to checkout and build."
required: false
default: "main"
type: string

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
dockerfile:
- build-radosgw
- build-run-radosgw
- build-run-radosgw-tests

steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}

- name: Build image ${{ matrix.dockerfile }}
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: 's3gw/${{ matrix.dockerfile }}'
tags: latest ${{ github.sha }}
containerfiles: 'tools/build/Dockerfile.${{ matrix.dockerfile }}'
context: 'tools/build'

- name: Push build-radosgw to quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
6 changes: 3 additions & 3 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
- name: Set up Git repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
- name: Set up Python3
uses: actions/setup-python@v4

- name: Pre-Commit Checks
- name: Pre Commit
uses: pre-commit/action@v3.0.0
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
venv
.DS_Store
.vscode
.vagrant

*.swp
__pycache__/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "ui"]
path = ui
url = https://github.com/aquarist-labs/s3gw-ui
[submodule "k3s-ansible"]
path = tools/env/playbooks/k3s-ansible
url = https://github.com/k3s-io/k3s-ansible.git
59 changes: 31 additions & 28 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: check-yaml
- id: check-added-large-files
- id: end-of-file-fixer
- id: debug-statements
- id: mixed-line-ending
- id: detect-private-key
- id: destroyed-symlinks
- id: check-shebang-scripts-are-executable
- id: check-case-conflict
- id: trailing-whitespace
- id: check-yaml
args:
- --allow-multiple-documents
- id: check-added-large-files
- id: end-of-file-fixer
- id: debug-statements
- id: mixed-line-ending
- id: detect-private-key
- id: destroyed-symlinks
- id: check-shebang-scripts-are-executable
- id: check-case-conflict

- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 2.1.5
hooks:
- id: forbid-binary
exclude: >-
(?x)^(
assets/images/.*
)$
- id: git-check
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 2.1.5
hooks:
- id: forbid-binary
exclude: >-
(?x)^(
assets/images/.*
)$
- id: git-check

- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
- id: codespell
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
- id: codespell

- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.4.0
hooks:
- id: markdownlint-cli2
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.4.0
hooks:
- id: markdownlint-cli2
1 change: 1 addition & 0 deletions env/playbooks/k3s-ansible
Submodule k3s-ansible added at 8e7081
87 changes: 87 additions & 0 deletions tools/.s3cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
[default]
access_key = 0555b35654ad1656d804
access_token =
add_encoding_exts =
add_headers =
bucket_location = US
ca_certs_file =
cache_file =
check_ssl_certificate = True
check_ssl_hostname = True
cloudfront_host = cloudfront.amazonaws.com
connection_max_age = 5
connection_pooling = True
content_disposition =
content_type =
default_mime_type = binary/octet-stream
delay_updates = False
delete_after = False
delete_after_fetch = False
delete_removed = False
dry_run = False
enable_multipart = True
encoding = UTF-8
encrypt = False
expiry_date =
expiry_days =
expiry_prefix =
follow_symlinks = False
force = False
get_continue = False
gpg_command = /usr/bin/gpg
gpg_decrypt = %(gpg_command)s -d --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
gpg_encrypt = %(gpg_command)s -c --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
gpg_passphrase = s3gw
guess_mime_type = True
host_base = 127.0.0.1:7480
host_bucket = 127.0.0.1:7480/%(bucket)
human_readable_sizes = False
invalidate_default_index_on_cf = False
invalidate_default_index_root_on_cf = True
invalidate_on_cf = False
kms_key =
limit = -1
limitrate = 0
list_md5 = False
log_target_prefix =
long_listing = False
max_delete = -1
mime_type =
multipart_chunk_size_mb = 15
multipart_copy_chunk_size_mb = 1024
multipart_max_chunks = 10000
preserve_attrs = True
progress_meter = True
proxy_host =
proxy_port = 0
public_url_use_https = False
put_continue = False
recursive = False
recv_chunk = 65536
reduced_redundancy = False
requester_pays = False
restore_days = 1
restore_priority = Standard
secret_key = h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q==
send_chunk = 65536
server_side_encryption = False
signature_v2 = False
signurl_use_https = False
simpledb_host = sdb.amazonaws.com
skip_existing = False
socket_timeout = 300
ssl_client_cert_file =
ssl_client_key_file =
stats = False
stop_on_error = False
storage_class =
throttle_max = 100
upload_id =
urlencoding_mode = normal
use_http_expect = False
use_https = False
use_mime_magic = True
verbosity = WARNING
website_endpoint = http://%(bucket)s.s3-website-%(location)s.amazonaws.com/
website_error =
website_index = index.html
15 changes: 15 additions & 0 deletions tools/build-ui/Dockerfile.app
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:lts-alpine

RUN apk add gettext
RUN npm install -g http-server
RUN echo -e "#!/bin/sh\n" \
"envsubst < /app/assets/rgw_service.config.json.sample > /app/assets/rgw_service.config.json\n" \
"exec http-server /app/\n" > /usr/bin/entrypoint.sh
RUN chmod +x /usr/bin/entrypoint.sh

WORKDIR /app
COPY ./ .

EXPOSE 8080
STOPSIGNAL SIGINT
ENTRYPOINT [ "/usr/bin/entrypoint.sh" ]
6 changes: 6 additions & 0 deletions tools/build-ui/Dockerfile.app-builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM node:lts-alpine

COPY build-app.sh /usr/bin/build-app.sh

VOLUME ["/srv/app"]
ENTRYPOINT [ "/usr/bin/build-app.sh" ]
9 changes: 9 additions & 0 deletions tools/build-ui/build-app.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

set -e

cd /srv/app/
npm ci
npm run build:prod

exit 0
Loading

0 comments on commit 91e90db

Please sign in to comment.