-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b37ec44
Showing
24 changed files
with
1,630 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @lloesche @aquamatthias @meln1k |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Description | ||
|
||
<!-- Please describe the changes included in this PR here. --> | ||
|
||
# To-Dos | ||
|
||
<!-- Before submitting this PR, please lint and test your changes locally. --> | ||
<!-- Add an 'x' between the brackets to mark each checkbox as checked. --> | ||
<!-- (Feel free to remove any items that do not apply to this PR.) --> | ||
|
||
- [ ] Add test coverage for new or updated functionality | ||
- [ ] Lint and test with `tox` | ||
- [ ] Document new or updated functionality (someengineering/resoto.com#XXXX) | ||
|
||
# Issues Fixed | ||
|
||
<!-- If this PR will fix/resolve an open issue on the repository, please reference it below. --> | ||
<!-- (Otherwise, feel free to delete this section.) --> | ||
|
||
- Fixes #XXXX | ||
|
||
# Code of Conduct | ||
|
||
By submitting this pull request, I agree to follow the [code of conduct](https://fix.tt/code-of-conduct). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
name: Build Docker Images | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*.*.*" | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
split-build: | ||
name: "Build Docker images" | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get short commit SHA | ||
id: sha | ||
run: echo "short=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT | ||
|
||
- name: Set build platforms | ||
id: platform | ||
run: | | ||
GITHUB_REF="${{ github.ref }}" | ||
GITHUB_TAG=${GITHUB_REF##*/} | ||
echo "targets=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT | ||
if [ "${{ github.ref_type }}" = tag ]; then | ||
if [[ "$GITHUB_TAG" =~ [0-9]([ab]|rc)[0-9]* ]]; then | ||
echo "latest=false" >> $GITHUB_OUTPUT | ||
else | ||
echo "latest=true" >> $GITHUB_OUTPUT | ||
fi | ||
else | ||
echo "latest=false" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Docker Metadata | ||
id: basemeta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
someengineering/fixattiosync | ||
ghcr.io/someengineering/fixattiosync | ||
flavor: | | ||
latest=${{ steps.platform.outputs.latest }} | ||
tags: | | ||
type=pep440,pattern={{version}} | ||
type=pep440,pattern={{major}}.{{minor}} | ||
type=pep440,pattern={{major}} | ||
type=sha,prefix= | ||
type=edge | ||
labels: | | ||
org.opencontainers.image.title=fixbackup | ||
org.opencontainers.image.description=FIX DB Backup System | ||
org.opencontainers.image.vendor=Some Engineering Inc. | ||
- name: Set up QEMU | ||
id: qemu | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: arm64,amd64 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Log in to Docker Hub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USER }} | ||
password: ${{ secrets.DOCKERHUB_PASS }} | ||
|
||
- name: Log in to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: ${{ steps.platform.outputs.targets }} | ||
push: ${{ github.event_name != 'pull_request' }} | ||
build-args: | | ||
SOURCE_COMMIT=${{ github.sha }} | ||
tags: ${{ steps.basemeta.outputs.tags }} | ||
labels: ${{ steps.basemeta.outputs.labels }} | ||
provenance: false # Temporary workaround for https://github.com/docker/buildx/issues/1533 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Run tests | ||
on: | ||
push: | ||
tags: | ||
- "*.*.*" | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
tox: | ||
name: "tox" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
architecture: 'x64' | ||
|
||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install tox wheel flake8 build | ||
- name: Run tests | ||
run: tox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
__pycache__ | ||
this | ||
.idea/ | ||
tmp/ | ||
runner.env | ||
artifacts/ | ||
*~ | ||
*backups | ||
.cache | ||
docker-tag | ||
.tox/ | ||
.*.swp | ||
*.egg-info | ||
wheelhouse/ | ||
test/build/* | ||
PASSED | ||
FAILED | ||
test/.vagrant/* | ||
.pytest_cache | ||
.eggs/ | ||
venv* | ||
/config/ | ||
*.code-workspace | ||
*/build/ | ||
docs/_build/ | ||
.DS_Store | ||
.coverage | ||
.dccache | ||
resotoshell/backup_* | ||
resotocore/tools/Assets | ||
out/ | ||
*.iml | ||
**/.hypothesis/ | ||
.sandbox/* | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
FROM fedora:40 AS build-env | ||
ENV LANG="C.UTF-8" | ||
ARG TARGETPLATFORM | ||
ARG BUILDPLATFORM | ||
ARG TESTS | ||
ARG SOURCE_COMMIT | ||
|
||
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
RUN echo "I am running on ${BUILDPLATFORM}, building for ${TARGETPLATFORM}" | ||
|
||
WORKDIR / | ||
RUN dnf -y update \ | ||
&& dnf -y groupinstall "Development Tools" "Development Libraries" \ | ||
&& dnf -y install \ | ||
gcc \ | ||
python3-devel \ | ||
python3-pip \ | ||
shellcheck \ | ||
curl \ | ||
ca-certificates \ | ||
dateutils \ | ||
openssl \ | ||
openssl-devel \ | ||
rustc \ | ||
cargo \ | ||
git | ||
|
||
# Create CPython venv | ||
WORKDIR /usr/local | ||
RUN python3 -m venv fix-venv-python3 | ||
|
||
# Download and install Python test tools | ||
RUN . /usr/local/fix-venv-python3/bin/activate && python -m pip install -U pip wheel tox flake8 | ||
|
||
# Build Fix Inventory | ||
COPY . /usr/src/fixattiosync | ||
|
||
WORKDIR /usr/src/fixattiosync | ||
RUN . /usr/local/fix-venv-python3/bin/activate && pip install -r requirements.txt | ||
RUN . /usr/local/fix-venv-python3/bin/activate && python -m pip install . | ||
|
||
COPY bootstrap /usr/local/sbin/bootstrap | ||
RUN chmod 755 \ | ||
/usr/local/sbin/bootstrap | ||
RUN echo "${SOURCE_COMMIT:-unknown}" > /usr/local/etc/git-commit.HEAD | ||
|
||
|
||
# Setup main image | ||
FROM fedora:40 | ||
ENV LANG="C.UTF-8" | ||
ENV TERM="xterm-256color" | ||
ENV COLORTERM="truecolor" | ||
ENV EDITOR="vim" | ||
COPY --from=build-env /usr/local /usr/local | ||
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
WORKDIR / | ||
RUN groupadd -g "${PGID:-0}" -o fix \ | ||
&& useradd -g "${PGID:-0}" -u "${PUID:-0}" -o --create-home fix \ | ||
&& dnf -y update \ | ||
&& dnf -y install \ | ||
dumb-init \ | ||
python3 \ | ||
python3-pip \ | ||
iproute \ | ||
libffi \ | ||
openssl \ | ||
procps \ | ||
dateutils \ | ||
curl \ | ||
ca-certificates \ | ||
&& dnf clean all \ | ||
&& rm -rf /var/cache/dnf /tmp/* /var/tmp/* | ||
|
||
ENTRYPOINT ["/bin/dumb-init", "--", "/usr/local/sbin/bootstrap"] | ||
CMD ["/bin/bash"] |
Oops, something went wrong.