Skip to content

Commit

Permalink
CI Build and Push & Container Upgrades (#26)
Browse files Browse the repository at this point in the history
Adds docker build and push image to CI pipeline

Docker Image Upgrades
- Adds ksh, bash-completion, ripgrep
- Updates nodejs installation method
- Updates git 
- Fixes git-lfs installation
- Adds graphite-cli
  • Loading branch information
xbenng authored Dec 18, 2023
1 parent 4d9e811 commit 16b2c10
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 3,558 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

"remoteUser": "vscode",
"mounts": [
// "src=/home/<YOUR_WSL_USERNAME>/projects,target=/home/vscode/projects,type=bind", // Replace with you WSL username
"src=/home/osadmin/projects,target=/home/vscode/projects,type=bind", // Replace `osadmin` with your WSL username
"source=/mnt/wslg,target=/mnt/wslg,type=bind", // comment out if not on Windows 11
"source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind" // comment out if not on Windows 11
],
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build and Push Docker Image

on:
push:
branches: ['main']
pull_request:

env:
DOCKER_IMAGE_NAME: ghcr.io/staflsystems/stafl-devcontainer-ci

jobs:
push_to_registry:
name: Build and Push Docker Image
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Determine Version
if: github.ref == 'refs/heads/main'
id: staflversion
uses: StaflSystems/CustomGithubActions/DetermineVersion@main

- name: Display Version
if: github.ref == 'refs/heads/main'
run: |
echo "Version: ${{steps.staflversion.outputs.full}}"
- name: Build Docker image
if: github.ref != 'refs/heads/main'
uses: docker/build-push-action@v5
with:
context: ${{ github.workspace }}/stafl-devcontainer
push: false
tags: ghcr.io/staflsystems/stafl-devcontainer-ci

- name: Build and Push Docker image
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v5
with:
context: ${{ github.workspace }}/stafl-devcontainer
push: true
tags: |
${{ env.DOCKER_IMAGE_NAME }}:latest
${{ env.DOCKER_IMAGE_NAME }}:${{ steps.staflversion.outputs.major }}.${{ steps.staflversion.outputs.minor }}.${{ steps.staflversion.outputs.patch }}-${{ steps.staflversion.outputs.build }}
- name: Create a GitHub release (main)
if: github.ref == 'refs/heads/main'
uses: StaflSystems/release-action@main
with:
tag: ${{ steps.staflversion.outputs.full }}
commit: ${{ github.sha }}
14 changes: 9 additions & 5 deletions stafl-devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,24 @@ ADD user-setup-scripts /user-setup-scripts

RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get -y install --no-install-recommends curl clang llvm-14 clang-format-14 doxygen g++ lcov gdb ninja-build wget bzip2 python2.7-dev python3 python3-pip python3-dev gcc-multilib-mips-linux-gnu gcc-mips-linux-gnu g++-mips-linux-gnu qemu-user libncurses5 graphviz plantuml make software-properties-common udev \
&& apt-get -y install --no-install-recommends curl clang llvm-14 clang-format-14 doxygen g++ lcov gdb ninja-build wget bzip2 python2.7-dev python3 python3-pip python3-dev gcc-multilib-mips-linux-gnu gcc-mips-linux-gnu g++-mips-linux-gnu qemu-user libncurses5 graphviz plantuml make software-properties-common udev ksh ripgrep bash-completion ca-certificates curl gnupg dos2unix\
&& find -path '/user-setup-scripts/*' | xargs dos2unix \
&& pip install cmake breathe sphinx sphinx_rtd_theme sphinxcontrib-plantuml sphinxcontrib-kroki \
&& ln -s /usr/bin/llvm-cov-14 /usr/bin/llvm-cov \
&& ln -s /usr/bin/llvm-profdata-14 /usr/bin/llvm-profdata \
&& add-apt-repository -y -n ppa:mozillateam/ppa \
&& add-apt-repository -y -n ppa:saiarcot895/chromium-beta \
&& cat /user-setup-scripts/firefox/firefox-pin.txt > /etc/apt/preferences.d/mozilla-firefox \
&& echo 'Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${VARIANT}";' > /etc/apt/apt.conf.d/51unattended-upgrades-firefox \
&& curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash - \
&& sudo mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list \
&& add-apt-repository -y -n ppa:git-core/ppa \
&& curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash \
&& apt-get update \
&& apt-get -y install --no-install-recommends nodejs firefox chromium-browser \
&& apt-get -y install --no-install-recommends git git-lfs nodejs firefox chromium-browser \
&& npm -g install https://github.com/maphstr/mdpdf.git \
&& curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash \
&& sudo apt-get install git-lfs
&& npm install -g @withgraphite/graphite-cli@stable

WORKDIR /opt

Expand Down
Loading

0 comments on commit 16b2c10

Please sign in to comment.