Skip to content

Commit 9c58fbc

Browse files
authored
Merge pull request #13 from influxdata/devel
* Update versions: * ansible-core 2.16.7 --> 2.16.14 * receptor 1.4.8 --> 1.5.2 * Refactor CI logic * Build all tags from one workflow * Create devel tag for latest push to devel branch * Create latest tag for latest push to main branch * Create nightly tag for bleeding edge from upstream (ie base OS, packages, etc) * This is generated on a schedule
2 parents 74b4108 + 9ad44b8 commit 9c58fbc

File tree

7 files changed

+118
-135
lines changed

7 files changed

+118
-135
lines changed

.github/workflows/build-devel-latest.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/build-latest.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/merge-pr.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
- closed
66
branches:
77
- main
8+
paths:
9+
- "./**"
10+
- '!**/*.md'
811

912
jobs:
1013
TagMerge:

.github/workflows/release.yml

Lines changed: 98 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,84 @@
1-
name: Release
1+
---
2+
# This workflow will build and push an AWX EE image to a container registry based upon the provided configuration
3+
#
4+
# Image tags will be generated based upon the event that triggered the workflow:
5+
# - push event:
6+
# - main branch: latest
7+
# - devel branch: devel
8+
# - all other branches: <branch name>-latest
9+
# Branches must be added to the on.push.branches array above to trigger
10+
# - pull_request event: DEV-PR-<pull_request_number>
11+
# Branches must be added to the on.pull_request.branches array above to trigger
12+
# - release event: <tag_name>
13+
# - schedule event: nightly
14+
# This will be the same configuration as the 'latest' tag, but may contain updated packages, etc. from upstream
15+
# - all other events: <first 7 chars of commit sha>
16+
#
17+
# Variables:
18+
# IMAGE_REGISTRY_URL: The container registry to push the image to (default: ghcr.io)
19+
# IMAGE_REPOSITORY: The repository to push the image to (default: github.repository)
20+
# IMAGE_REGISTRY_USER: The username to authenticate with the container registry (default: github.actor)
21+
#
22+
# Secrets:
23+
# IMAGE_REGISTRY_TOKEN: The token to authenticate with the container registry (default: secrets.GITHUB_TOKEN)
24+
#
25+
26+
name: Build & Release
227

328
on:
29+
push:
30+
# build and push anytime commits are merged to specified branches
31+
branches:
32+
- main
33+
- devel
34+
paths:
35+
- ".github/workflows/release.yml"
36+
- "./**"
37+
- '!**/*.md'
38+
pull_request:
39+
# build and push anytime a pull request is opened or synchronized
40+
branches:
41+
- main
42+
- devel
43+
paths:
44+
- ".github/workflows/release.yml"
45+
- "./**"
46+
- '!**/*.md'
447
release:
48+
# build and push anytime a release is created
549
types:
650
- created
51+
schedule:
52+
# build and push nightly
53+
- cron: "13 4 * * *"
754

855
jobs:
56+
ci:
57+
runs-on: ubuntu-latest
58+
name: CI Build (Podman)
59+
strategy:
60+
fail-fast: true
61+
steps:
62+
- uses: actions/checkout@v4
63+
64+
- uses: actions/setup-python@v5
65+
with:
66+
python-version: "3.12"
67+
68+
- name: Install dependencies
69+
run: |
70+
python -m pip install --upgrade pip setuptools
71+
pip install -r requirements.txt
72+
73+
- name: Build EE with Podman
74+
run: |
75+
ansible-builder build -v3 -t ${{ vars.IMAGE_REGISTRY_URL || 'ghcr.io' }}/${{ vars.IMAGE_REPOSITORY || github.repository }} --container-runtime=podman
76+
977
release:
10-
runs-on: ubuntu-22.04
78+
runs-on: ubuntu-latest
1179
name: Release
80+
strategy:
81+
fail-fast: true
1282
steps:
1383
- uses: actions/checkout@v4
1484

@@ -21,9 +91,32 @@ jobs:
2191
python -m pip install --upgrade pip setuptools
2292
pip install -r requirements.txt
2393
24-
- name: Quay login
94+
- name: Login to Docker Container Registry
95+
uses: docker/login-action@v3
96+
with:
97+
registry: ${{ vars.IMAGE_REGISTRY_URL || 'ghcr.io' }}
98+
username: ${{ vars.IMAGE_REGISTRY_USER || github.actor }}
99+
password: ${{ secrets.IMAGE_REGISTRY_TOKEN || secrets.GITHUB_TOKEN }}
100+
101+
- name: Generate image tag
25102
run: |
26-
echo "${{ secrets.QUAY_TOKEN }}" | docker login quay.io -u ${{ secrets.QUAY_USERNAME }} --password-stdin
103+
if [[ "${{ github.event_name }}" == "push" ]]; then
104+
if [[ "${{ github.ref_name }}" == "main" ]]; then
105+
echo "IMAGE_TAG=latest" >> $GITHUB_ENV
106+
elif [[ "${{ github.ref_name }}" == "devel" ]]; then
107+
echo "IMAGE_TAG=devel" >> $GITHUB_ENV
108+
else
109+
echo "IMAGE_TAG=${{ github.ref_name }}-latest" >> $GITHUB_ENV
110+
fi
111+
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
112+
echo "IMAGE_TAG=DEV-PR-${{ github.event.pull_request.number }}" >> $GITHUB_ENV
113+
elif [[ "${{ github.event_name }}" == "release" ]]; then
114+
echo "IMAGE_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
115+
elif [[ "${{ github.event_name }}" == "schedule" ]]; then
116+
echo "IMAGE_TAG=nightly" >> $GITHUB_ENV
117+
else
118+
echo "IMAGE_TAG=${GITHUB_SHA::7}" >> $GITHUB_ENV
119+
fi
27120
28121
- name: Build and push image
29122
run: |
@@ -33,6 +126,6 @@ jobs:
33126
docker buildx build \
34127
--push \
35128
--platform=linux/amd64,linux/arm64 \
36-
--tag=${{ vars.IMAGE_REGISTRY }}:${{ github.event.release.tag_name }} \
129+
--tag=${{ vars.IMAGE_REGISTRY_URL || 'ghcr.io' }}/${{ vars.IMAGE_REPOSITORY || github.repository }}:${{ env.IMAGE_TAG }} \
37130
context
38131

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
# AWX EE
22

3-
The InfluxData Execution Environment for AWX.
3+
An Execution Environment for AWX.
4+
5+
Main features:
6+
- Centos Stream 9
7+
- Python 3.12
8+
- ara
9+
- boto3
10+
- mitogen
11+
- redis
12+
- toml
13+
- Ansible 2.16
14+
- Minimal base collections installed
15+
16+
View the full configuration in the [execution-environment.yaml](execution-environment.yaml) file.
417

518
## Build the image locally
619

execution-environment.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ images:
66
dependencies:
77
ansible_core:
88
# A minimum of 2.15 is required to get ansible-inventory --limit option
9-
package_pip: ansible-core==2.16.7
9+
package_pip: ansible-core==2.16.14
1010
ansible_runner:
11-
package_pip: ansible-runner==2.4.0
11+
package_pip: ansible-runner>=2.4.0
1212
python_interpreter:
1313
package_system: python3.12
1414
python_path: "/usr/bin/python3.12"
@@ -69,6 +69,6 @@ additional_build_steps:
6969
- RUN $PYCMD -m pip install -U pip
7070
- RUN unlink /usr/bin/python3 && ln -s /usr/bin/python3.12 /usr/bin/python3
7171
append_final:
72-
- COPY --from=quay.io/ansible/receptor:v1.4.8 /usr/bin/receptor /usr/bin/receptor
72+
- COPY --from=quay.io/ansible/receptor:v1.5.2 /usr/bin/receptor /usr/bin/receptor
7373
- RUN mkdir -p /var/run/receptor
7474
- RUN git lfs install --system

0 commit comments

Comments
 (0)