Skip to content

Commit

Permalink
Treewide: switch to arch & rewrite from scratch
Browse files Browse the repository at this point in the history
  • Loading branch information
XenonTheInertG committed Mar 7, 2022
1 parent 33ff393 commit c2dd102
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 75 deletions.
39 changes: 39 additions & 0 deletions .github/pyLint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: pyLint

on:
push:
workflow_dispatch:

jobs:
pyLint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install dependencies
run: pip install autopep8 autoflake isort black
- name: "[autopep8] Format fixes"
run: |
find -name "*.py" -not -path "./venv/*" -exec autopep8 --verbose --in-place --recursive --aggressive --aggressive '{}' \;
- name: "[autoflake] Remove unused imports and variables"
run: |
find . -regex "^.\/\Main\/\w+\/.+\.py$" -exec autoflake --in-place --recursive --remove-all-unused-imports --remove-unused-variables --ignore-init-module-imports -v -v '{}' \;
- name: "[black] lint"
run: |
black -v .
- name: "[isort] lint"
run: |
isort -v --cs --ca --ls --lss --ds --fss --lai 2 -m 4 .
- name: Commit Checkout
uses: stefanzweifel/git-auto-commit-action@v4
with:
repository: .
commit_user_name: XenonTheInertG
commit_user_email: [email protected]
commit_options: '--no-verify'
commit_message: 'auto: refactor'
commit_author: XenonTheInertG <[email protected]>
42 changes: 42 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and Push

on:
push:
branches:
- arch
workflow_dispatch:

env:
# Change these values if you have forked it for your own works
# Use Lowercase vaue of your Username
GITHUB_USERNAME: xenontheinertg
GITHUB_EMAIL: [email protected]

GITHUB_TOKEN: ${{ secrets.GHP }}

# Image name and tag. MUST be lowercase
IMAGE_NAME: docky
IMAGE_TAG: latest

jobs:
push:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Configuring git
run: |
git config --global user.name $GITHUB_USERNAME
git config --global user.email $GITHUB_EMAIL
- name: Logging in to Docker
run: |
echo $GITHUB_TOKEN | docker login ghcr.io -u $GITHUB_USERNAME --password-stdin
- name: Building the Image
run: |
docker build -t ghcr.io/${GITHUB_USERNAME}/${IMAGE_NAME}:${IMAGE_TAG} .
echo "Build Completed Successfully!"
- name: Pushing the Image
run: |
docker push ghcr.io/${GITHUB_USERNAME}/${IMAGE_NAME}:${IMAGE_TAG}
89 changes: 14 additions & 75 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,83 +1,22 @@
# Base Image: Ubuntu
FROM ubuntu:latest
# Base Image
FROM archlinux/archlinux:latest

# User
USER root

# Working Directory
WORKDIR /root

# Maintainer
MAINTAINER XenonTheInertG <[email protected]>

# Delete the profile files (we'll copy our own in the next step)
RUN \
rm -f \
/etc/profile \
~/.profile \
~/.bashrc

# Copy the Proprietary Files
COPY ./proprietary /

# apt update
RUN apt update

# Install sudo
RUN apt install apt-utils sudo -y

# tzdata
ENV TZ Asia/Dhaka

RUN \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata \
&& ln -sf /usr/share/zoneinfo/$TZ /etc/localtime \
&& apt-get install -y tzdata \
&& dpkg-reconfigure --frontend noninteractive tzdata

# Install git and ssh
RUN sudo apt install git ssh -y

# Configure git
ENV GIT_USERNAME XenonTheInertG
ENV GIT_EMAIL [email protected]
RUN \
git config --global user.name $GIT_USERNAME \
&& git config --global user.email $GIT_EMAIL
# Copy Rootfs
COPY rootfs /

# Install Packages
RUN \
sudo apt install \
curl wget aria2 tmate python2 python3 silversearch* \
iputils-ping iproute2 \
nano rsync rclone tmux screen openssh-server \
python3-pip adb fastboot jq npm neofetch mlocate \
zip unzip tar ccache \
cpio lzma \
-y

# Filesystems
RUN \
sudo apt install \
erofs-utils \
-y

RUN \
sudo pip install \
twrpdtgen

# Install schedtool and Java
RUN \
sudo apt install \
schedtool openjdk-8-jdk \
-y

# Setup Android Build Environment
RUN \
git clone https://github.com/akhilnarang/scripts.git /tmp/scripts \
&& sudo bash /tmp/scripts/setup/android_build_env.sh \
&& rm -rf /tmp/scripts
COPY ./install_packages.sh /tmp/
RUN bash /tmp/install_packages.sh

# Use python2 as the Default python
RUN \
sudo ln -sf /usr/bin/python2 /usr/bin/python
# Configuration
COPY ./config.sh /tmp/
RUN bash /tmp/config.sh

# Run bash
CMD ["bash"]
# docker run command
CMD ["bash"]
12 changes: 12 additions & 0 deletions config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# Git Configuration
export GIT_USERNAME="XenonTheInertG"
export GIT_EMAIL="[email protected]"

git config --global user.name "${GIT_USERNAME}"
git config --global user.email "${GIT_EMAIL}"

# TimeZone Configuration
export TZ="Asia/Dhaka"
ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime

0 comments on commit c2dd102

Please sign in to comment.