mirror of
https://github.com/Infisical/ansible-collection.git
synced 2025-08-03 12:44:26 -07:00
feat: ansible docker image
This commit is contained in:
parent
510e8c666f
commit
89ab21f235
3 changed files with 59 additions and 8 deletions
40
.github/workflows/distribute.yaml
vendored
40
.github/workflows/distribute.yaml
vendored
|
@ -2,19 +2,45 @@
|
|||
name: Deploy Collection
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
push:
|
||||
tags:
|
||||
- "*.*.*"
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
release-galaxy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Get the version name from the tags
|
||||
run: echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
|
||||
- name: Build and Deploy Collection
|
||||
uses: artis3n/ansible_galaxy_collection@v2
|
||||
with:
|
||||
api_key: "${{ secrets.GALAXY_API_KEY }}"
|
||||
galaxy_version: "${{ env.RELEASE_VERSION }}"
|
||||
galaxy_version: "${{ github.ref_name }}"
|
||||
|
||||
release-docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: 🔧 Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
|
||||
- name: 🔧 Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: 🐋 Login to Docker Hub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
build-args: VERSION=${{ github.ref_name }}
|
||||
context: docker
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: |
|
||||
infisical/ansible-collection:latest
|
||||
infisical/ansible-collection:${{ github.ref_name }}
|
||||
|
|
25
docker/Dockerfile
Normal file
25
docker/Dockerfile
Normal file
|
@ -0,0 +1,25 @@
|
|||
FROM python:3.11-slim
|
||||
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV ANSIBLE_HOST_KEY_CHECKING=false
|
||||
ENV ANSIBLE_STDOUT_CALLBACK=yaml
|
||||
ENV ANSIBLE_CALLBACKS_ENABLED=profile_tasks
|
||||
|
||||
ARG VERSION
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
git \
|
||||
openssh-client \
|
||||
sshpass \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN pip install --no-cache-dir ansible infisicalsdk
|
||||
|
||||
RUN ansible-galaxy collection install infisical.vault==${VERSION}
|
||||
|
||||
WORKDIR /ansible
|
||||
|
||||
RUN mkdir -p /root/.ansible
|
||||
|
||||
# Set default command
|
||||
CMD ["/bin/bash"]
|
|
@ -62,7 +62,7 @@ issues: https://github.com/Infisical/ansible-collection/issues
|
|||
# artifact. A pattern is matched from the relative path of the file or directory of the collection directory. This
|
||||
# uses 'fnmatch' to match the files or directories. Some directories and files like 'galaxy.yml', '*.pyc', '*.retry',
|
||||
# and '.git' are always filtered. Mutually exclusive with 'manifest'
|
||||
build_ignore: []
|
||||
build_ignore: ["/docker/*"]
|
||||
# A dict controlling use of manifest directives used in building the collection artifact. The key 'directives' is a
|
||||
# list of MANIFEST.in style
|
||||
# L(directives,https://packaging.python.org/en/latest/guides/using-manifest-in/#manifest-in-commands). The key
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue