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

Allow to build awx-ee from an arbitrary repo / branch and modify receptor source #147

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open
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
56 changes: 56 additions & 0 deletions .github/workflows/build_container_from_ref.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: "Build container from arbitrary repo / ref"
on:
workflow_dispatch:
inputs:
repository:
description: 'The receptor repository to build from.'
required: true
default: 'ansible/awx-ee'
ref:
description: 'The ref to build. Can be a branch or any other valid ref.'
required: true
default: 'devel'
receptor_image:
description: 'The receptor image to use for the build'
required: true
default: 'quay.io/ansible/receptor:devel'
tag:
description: 'The tag for the container.'
required: true
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
repository: ${{ github.event.inputs.repository }}
ref: ${{ github.event.inputs.ref }}

- uses: actions/setup-python@v2
with:
python-version: "3.8"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox

- name: Login To ghcr.io
uses: docker/login-action@v2
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io

- name: Build and push image
env:
DOCKER_BUILDKIT: 1
TAG: ghcr.io/${{ github.repository }}:${{ github.event.inputs.tag }}
RECEPTOR_IMAGE: ${{ github.event.inputs.receptor_image }}
run: |
TAG=$(echo $TAG | tr '[A-Z]' '[a-z]')
tox -e docker -- --tag=$TAG --build-arg RECEPTOR_IMAGE=${RECEPTOR_IMAGE}
docker push $TAG
3 changes: 2 additions & 1 deletion Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ COPY --from=galaxy /usr/share/ansible /usr/share/ansible

COPY --from=builder /output/ /output/
RUN /output/install-from-bindep && rm -rf /output/wheels
ARG RECEPTOR_IMAGE=quay.io/ansible/receptor:devel
RUN alternatives --set python /usr/bin/python3
COPY --from=quay.io/ansible/receptor:devel /usr/bin/receptor /usr/bin/receptor
COPY --from=$RECEPTOR_IMAGE /usr/bin/receptor /usr/bin/receptor
RUN mkdir -p /var/run/receptor
ADD run.sh /run.sh
CMD /run.sh
Expand Down
3 changes: 2 additions & 1 deletion execution-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ dependencies:
python: _build/requirements.txt
additional_build_steps:
append:
- ARG RECEPTOR_IMAGE=quay.io/ansible/receptor:devel
- RUN alternatives --set python /usr/bin/python3
- COPY --from=quay.io/ansible/receptor:devel /usr/bin/receptor /usr/bin/receptor
- COPY --from=$RECEPTOR_IMAGE /usr/bin/receptor /usr/bin/receptor
- RUN mkdir -p /var/run/receptor
- ADD run.sh /run.sh
- CMD /run.sh
Expand Down