Skip to content

Commit

Permalink
update repo
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonEverling committed Jan 30, 2024
0 parents commit 0f2155e
Show file tree
Hide file tree
Showing 24 changed files with 2,680 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Set line endings to LF
* text eol=lf
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Docker CI
on:
push:
branches: [ main ]
paths-ignore:
- '.gitignore'
- 'README.md'
schedule:
- cron: '15 0 * * 0'
env:
BETA_CHANNEL: 24.04
STABLE_CHANNEL: 22.04
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Docker
env:
DOCKER_USER: ${{secrets.DOCKER_USER}}
DOCKER_TOKEN: ${{secrets.DOCKER_TOKEN}}
run: |
docker login -u $DOCKER_USER -p $DOCKER_TOKEN
- name: Build 22.04
run: |
docker build . --pull --build-arg OS_VERSION=${{env.STABLE_CHANNEL}} --tag bshp/ocie:latest --no-cache
- name: Push 22.04
run: |
docker tag bshp/ocie:latest bshp/ocie:${{env.STABLE_CHANNEL}}
docker push bshp/ocie:latest
docker push bshp/ocie:${{env.STABLE_CHANNEL}}
- name: Build 24.04
run: |
docker build . --pull --build-arg OS_VERSION=${{env.BETA_CHANNEL}} --tag bshp/ocie:beta --no-cache
- name: Push 24.04
run: |
docker tag bshp/ocie:beta bshp/ocie:${{env.BETA_CHANNEL}}
docker push bshp/ocie:beta
docker push bshp/ocie:${{env.BETA_CHANNEL}}
- name: Build Apache Base
run: |
curl -L -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: ${{secrets.WF_TOKEN}}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/bshp/apache2/actions/workflows/build.yml/dispatches \
-d '{"ref":"master"}'
- name: Build Mantis
run: |
curl -L -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: ${{secrets.WF_TOKEN}}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/bshp/mantis/actions/workflows/build.yml/dispatches \
-d '{"ref":"main"}'
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.log
.build
*.tar
*.tar.gz
46 changes: 46 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# syntax=docker/dockerfile-upstream:master

# Ubuntu Version, e.g 22.04 unquoted
ARG OS_VERSION

# Optional: Change Timezone
ARG TZ=America/North_Dakota/Center

FROM ubuntu:$OS_VERSION

LABEL org.opencontainers.image.authors="[email protected]"

ARG OS_VERSION
ARG TZ

ENV OCIE_HOME=/etc/ocie
ENV OCIE_LIB=/usr/lib/ocie
ENV OCIE_TYPES=${OCIE_LIB}/types

# Add Ocie
COPY --chown=root:root --chmod=0755 ./src/ ./

RUN <<-"EOD" bash
set -eu;
echo "Ocie: Setting up environment";
echo "OCIE_BIN=/usr/sbin" >> /etc/environment;
echo "OCIE_HOME=${OCIE_HOME}" >> /etc/environment;
echo "OCIE_LIB=${OCIE_LIB}" >> /etc/environment;
echo "OCIE_TYPES=${OCIE_TYPES}" >> /etc/environment;
echo "OS_BASE=${OS_VERSION}" >> /etc/environment;
echo "OS_CODENAME=$(grep -o 'VERSION_CODENAME=.*' </etc/os-release | cut -f2 -d'=')" >> /etc/environment;
echo "OS_IMAGE=ubuntu:${OS_VERSION}" >> /etc/environment;
echo "OS_TIMEZONE=${TZ}" >> /etc/environment;
echo "OS_VERSION=${OS_VERSION//.}" >> /etc/environment;
echo ". /etc/environment" >> /etc/bash.bashrc;
echo "Ocie: Setting up system";
echo "Ocie: Creating container account, [ ocie ]";
mkdir -p ${OCIE_HOME}/conf;
useradd -d ${OCIE_HOME} -r -s /bin/bash ocie;
install -d -m 0775 -o ocie -g ocie ${OCIE_HOME};
# Install base packages, timezone
ocie --pkg "-base -upgrade" --timezone "-set ${TZ}" --clean "-base" --print;
echo "Ocie: System setup complete";
EOD

CMD ["/bin/bash"]
Loading

0 comments on commit 0f2155e

Please sign in to comment.