mirror of
https://github.com/ansible/awx.git
synced 2026-05-10 10:57:35 -02:30
[CI][release_4.6] Fix schema upload (#6840)
This commit is contained in:
44
.github/workflows/upload_schema.yml
vendored
44
.github/workflows/upload_schema.yml
vendored
@@ -22,6 +22,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
show-progress: false
|
show-progress: false
|
||||||
|
|
||||||
|
- name: Set lower case owner name
|
||||||
|
shell: bash
|
||||||
|
run: echo "OWNER_LC=${OWNER,,}" >> $GITHUB_ENV
|
||||||
|
env:
|
||||||
|
OWNER: '${{ github.repository_owner }}'
|
||||||
|
|
||||||
- name: Get python version from Makefile
|
- name: Get python version from Makefile
|
||||||
run: echo py_version=`make PYTHON_VERSION` >> $GITHUB_ENV
|
run: echo py_version=`make PYTHON_VERSION` >> $GITHUB_ENV
|
||||||
|
|
||||||
@@ -34,18 +40,46 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||||
|
|
||||||
- name: Pre-pull image to warm build cache
|
- name: Pre-pull latest devel image to warm cache
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
docker pull -q ghcr.io/${{ github.repository_owner }}/awx_devel:${GITHUB_REF##*/} || :
|
DEV_DOCKER_TAG_BASE=ghcr.io/${OWNER_LC} \
|
||||||
|
COMPOSE_TAG=${{ github.base_ref || github.ref_name }} \
|
||||||
|
docker pull -q `make print-DEVEL_IMAGE_NAME`
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
- name: Generate placeholder SSH private key if SSH auth for private repos is not needed
|
||||||
|
id: generate_key
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [[ -z "${{ secrets.PRIVATE_GITHUB_KEY }}" ]]; then
|
||||||
|
ssh-keygen -t ed25519 -C "github-actions" -N "" -f ~/.ssh/id_ed25519
|
||||||
|
echo "SSH_PRIVATE_KEY<<EOF" >> $GITHUB_OUTPUT
|
||||||
|
cat ~/.ssh/id_ed25519 >> $GITHUB_OUTPUT
|
||||||
|
echo "EOF" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "SSH_PRIVATE_KEY<<EOF" >> $GITHUB_OUTPUT
|
||||||
|
echo "${{ secrets.PRIVATE_GITHUB_KEY }}" >> $GITHUB_OUTPUT
|
||||||
|
echo "EOF" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Add private GitHub key to SSH agent
|
||||||
|
uses: webfactory/ssh-agent@v0.9.0
|
||||||
|
with:
|
||||||
|
ssh-private-key: ${{ steps.generate_key.outputs.SSH_PRIVATE_KEY }}
|
||||||
|
|
||||||
- name: Build image
|
- name: Build image
|
||||||
run: |
|
run: |
|
||||||
DEV_DOCKER_TAG_BASE=ghcr.io/${{ github.repository_owner }} COMPOSE_TAG=${GITHUB_REF##*/} make docker-compose-build
|
DEV_DOCKER_TAG_BASE=ghcr.io/${OWNER_LC} \
|
||||||
|
COMPOSE_TAG=${{ github.base_ref || github.ref_name }} \
|
||||||
|
make docker-compose-build
|
||||||
|
|
||||||
- name: Generate API Schema
|
- name: Generate API Schema
|
||||||
run: |
|
run: |
|
||||||
|
DEV_DOCKER_TAG_BASE=ghcr.io/${OWNER_LC} \
|
||||||
|
COMPOSE_TAG=${{ github.base_ref || github.ref_name }} \
|
||||||
docker run -u $(id -u) --rm -v ${{ github.workspace }}:/awx_devel/:Z \
|
docker run -u $(id -u) --rm -v ${{ github.workspace }}:/awx_devel/:Z \
|
||||||
--workdir=/awx_devel ghcr.io/${{ github.repository_owner }}/awx_devel:${GITHUB_REF##*/} /start_tests.sh genschema
|
--workdir=/awx_devel `make print-DEVEL_IMAGE_NAME` /start_tests.sh genschema
|
||||||
|
|
||||||
- name: Upload API Schema
|
- name: Upload API Schema
|
||||||
env:
|
env:
|
||||||
@@ -56,5 +90,3 @@ jobs:
|
|||||||
ansible localhost -c local, -m command -a "{{ ansible_python_interpreter + ' -m pip install boto3'}}"
|
ansible localhost -c local, -m command -a "{{ ansible_python_interpreter + ' -m pip install boto3'}}"
|
||||||
ansible localhost -c local -m aws_s3 \
|
ansible localhost -c local -m aws_s3 \
|
||||||
-a "src=${{ github.workspace }}/schema.json bucket=awx-public-ci-files object=${GITHUB_REF##*/}/schema.json mode=put permission=public-read"
|
-a "src=${{ github.workspace }}/schema.json bucket=awx-public-ci-files object=${GITHUB_REF##*/}/schema.json mode=put permission=public-read"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user