Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Release v0.0.104 #41

Merged
merged 6 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/_zrb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Run Command

on:
workflow_call:
inputs:
command:
required: true
type: string
environment:
required: true
type: string
secrets: {}

jobs:

# Docs: https://docs.github.com/en/actions/using-workflows/reusing-workflows
Run-command:
runs-on: ubuntu-latest
container:
image: stalchmst/zrb:0.0.103
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Show Info
run: |
echo "🙋 PIC: ${{ github.actor }}"
echo "🎉 Event: ${{ github.event_name }}"
echo "🐧 OS: ${{ runner.os }}"
echo "🔎 Branch: ${{ github.ref }}"
echo "🔎 Repo: ${{ github.repository }}"
- name: Run command
shell: bash
run: |
set -e
export ZRB_ENV=${{ inputs.environment }}
export ZRB_SHOW_PROMPT=false
echo "🏁 Start running"
${{ inputs.command }}
- run: echo "🍏 This job's status is ${{ job.status }}."
11 changes: 11 additions & 0 deletions .github/workflows/hello.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: "Hello"
run-name: "Run hello for ${{ github.actor }}"
on: [push]

jobs:
run-command:
uses: ./.github/workflows/_zrb.yml
with:
environment: DEV
command: |
zrb explain solid
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ Once defined, your command will be instantly available from the CLI:

```bash
zrb hello
# or provide the parameter directly:
# zrb hello --name "Go Frendi"
# You can also provide the parameter directly:
# zrb hello --name "Go Frendi"
```

```
Expand Down
52 changes: 3 additions & 49 deletions docker-template/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,54 +1,8 @@
FROM debian:bookworm-slim
FROM python:3.10-bookworm

# Create and set workdir
RUN mkdir -p /project
WORKDIR /project

# Update and set third party repositories
RUN apt update --fix-missing && apt upgrade -y
RUN apt install -y ca-certificates curl gnupg
RUN install -m 0755 -d /etc/apt/keyrings
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
chmod a+r /etc/apt/keyrings/docker.gpg && \
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
RUN apt update

# Install packages
RUN apt install -y git ncat curl wget inetutils-tools inetutils-ping \
docker.io docker-compose-plugin zsh python-is-python3 pip \
build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev curl \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev && \
apt autoremove -yqq --purge && \
apt clean && \
rm -rf /var/lib/apt/lists/*

# Install pyenv
RUN curl https://pyenv.run | bash

# Configure pyenv for bash shell
RUN echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
RUN echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
RUN echo 'eval "$(pyenv init -)"' >> ~/.bashrc

# Install Python 3.10 on pyenv
RUN bash -c 'source ~/.bashrc && pyenv install 3.11 && pyenv global 3.11'

# Configure zsh shell
RUN sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

RUN echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
RUN echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
RUN echo 'eval "$(pyenv init -)"' >> ~/.zshrc

# Install Zrb on top of pyenv
RUN bash -c 'source ~/.bashrc && pip install zrb==ZRB_VERSION'

# Prepare environments
ENV DEBIAN_FRONTEND=noninteractive

# Set command
CMD ["bash", "-c", "echo 'To start working, invoke: docker exec -it <this-container-name> zsh' && sleep infinity"]
# Install zrb
RUN pip install zrb==ZRB_VERSION
1 change: 1 addition & 0 deletions docker-template/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ services:
logging: *default-logging
container_name: zrb
hostname: zrb
command: sleep infinity
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"

[project]
name = "zrb"
version = "0.0.103"
version = "0.0.104"
authors = [
{ name="Go Frendi Gunawan", email="[email protected]" },
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10.0
Loading