Compare commits

..

31 Commits

Author SHA1 Message Date
b894894c7c add debian 12 for more testing
All checks were successful
continuous-integration/drone/push Build is passing
2023-11-20 23:01:24 -05:00
9240abe863 add centos stream9 test
All checks were successful
continuous-integration/drone/push Build is passing
2023-11-20 20:24:18 -05:00
654181364a testing alpine image
All checks were successful
continuous-integration/drone/push Build is passing
2023-11-20 20:12:37 -05:00
18ed3a2197 revert .drone.yml to run ansible tests only
All checks were successful
continuous-integration/drone/push Build is passing
2023-11-20 09:38:28 -05:00
f58229937d yet another another test
Some checks failed
continuous-integration/drone/push Build is failing
2023-11-19 22:45:27 -05:00
e33a5059fe yet another test
Some checks failed
continuous-integration/drone/push Build is failing
2023-11-19 22:44:25 -05:00
6f4ce26baa another test
Some checks failed
continuous-integration/drone/push Build is failing
2023-11-19 22:37:40 -05:00
b7b150de94 testing something real quick
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2023-11-19 22:37:14 -05:00
f08a5de39b fix image
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2023-11-19 22:18:59 -05:00
de4b4bff42 why didnt this work previously; does it work now?
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2023-11-19 22:17:52 -05:00
07b1c64282 no cache builds; dnf update -y; update parallel downloads
All checks were successful
continuous-integration/drone/push Build is passing
2023-11-19 20:15:50 -05:00
85e92d9f8c fix yaml[empty-lines]: Too many blank lines (1 > 0)
All checks were successful
continuous-integration/drone/push Build is passing
2023-11-19 13:48:11 -05:00
ce16b086a4 remove git package add; break out docker build into steps
Some checks failed
continuous-integration/drone/push Build is failing
2023-11-19 13:47:35 -05:00
b0c67c10d1 update vars
All checks were successful
continuous-integration/drone/push Build is passing
2023-11-19 13:39:20 -05:00
1411f31406 try try again
Some checks failed
continuous-integration/drone/push Build is failing
2023-11-19 13:34:51 -05:00
4cb2be284f add secrets and login step
Some checks failed
continuous-integration/drone/push Build is failing
2023-11-19 13:24:22 -05:00
2f73c2ed2a test push, add quotes to docker images
Some checks failed
continuous-integration/drone/push Build is failing
2023-11-19 13:21:38 -05:00
e3c8d2930c add image display after build
Some checks failed
continuous-integration/drone/push Build is failing
2023-11-19 13:17:37 -05:00
1b6291e52f rename Containerfile -> Dockerfile
All checks were successful
continuous-integration/drone/push Build is passing
2023-11-19 13:13:06 -05:00
450aea89a6 explicit call to docker build
Some checks failed
continuous-integration/drone/push Build is failing
2023-11-19 13:11:53 -05:00
215db93cd7 remove env; not for exec runner
Some checks failed
continuous-integration/drone/push Build is failing
2023-11-19 01:53:39 -05:00
1d9bb863d0 add the other missing quote lol
Some checks failed
continuous-integration/drone/push Build is failing
2023-11-19 01:35:51 -05:00
641338b16c add missing quote
Some checks failed
continuous-integration/drone/push Build is failing
2023-11-19 01:32:25 -05:00
25436afc0c test build again
Some checks failed
continuous-integration/drone/push Build is failing
2023-11-19 01:31:32 -05:00
4edf11953f update vars; FIX ERROR: "docker buildx build" requires exactly 1 argument....i think
Some checks failed
continuous-integration/drone/push Build is failing
2023-11-19 01:14:58 -05:00
fa0caaf516 lint fixes and cleanup
Some checks failed
continuous-integration/drone/push Build is failing
2023-11-19 01:12:11 -05:00
2672ce0653 add docker build to test; this should be fun
Some checks failed
continuous-integration/drone/push Build is failing
2023-11-19 01:09:07 -05:00
b83d0e566b remove galaxy install for now as its pointless; add path test via cat
All checks were successful
continuous-integration/drone/push Build is passing
2023-11-19 01:00:37 -05:00
c09d9eb878 add pwd and tree commands; remove some others
All checks were successful
continuous-integration/drone/push Build is passing
2023-11-19 00:57:27 -05:00
4335f5762a tidy up and add .gitignore
All checks were successful
continuous-integration/drone/push Build is passing
2023-11-18 23:47:35 -05:00
cdf37dca49 reorder globals; replace task events with single trigger section; add local exec to see whats up
All checks were successful
continuous-integration/drone/push Build is passing
2023-11-18 23:23:55 -05:00
9 changed files with 238 additions and 70 deletions

View File

@ -1,20 +1,22 @@
---
kind: pipeline
type: docker
name: run_ansible_tests_fedora39
global-variables:
ansible_image : &ansible_image "gitea.thezengarden.net/podman/images/ansible-dev:latest"
ansible_inventory : &ansible_inventory "-i 127.0.0.1, --connection=local"
ansible_playbook : &ansible_playbook "hello.yml"
name: run_ansible_tests
kind: pipeline
type: docker
environment:
ANSIBLE_INVENTORY : *ansible_inventory
ANSIBLE_PLAYBOOK : *ansible_playbook
ANSIBLE_DOCKER_IMAGE : *ansible_image
trigger:
branch:
exclude:
- main
event: [push]
steps:
- name: "ansible_environment_verify"
@ -23,85 +25,202 @@ steps:
- git log -1
- ansible --version
- ansible-lint --version
when:
branch:
exclude:
- main
event: [push]
- name: "ansible_galaxy_requirements"
image: *ansible_image
commands:
- ansible-galaxy install -r requirements.yml
when:
branch:
exclude:
- main
event: [push]
- name: "ansible_lint"
image: *ansible_image
commands:
- ansible-lint --offline
when:
branch:
exclude:
- main
event: [push]
- name: "ansible_playbook_execution"
image: *ansible_image
commands:
- ansible-playbook -v $ANSIBLE_INVENTORY $ANSIBLE_PLAYBOOK
when:
---
kind: pipeline
type: docker
name: run_ansible_tests_centos9
global-variables:
ansible_image : &ansible_image "gitea.thezengarden.net/podman/images/ansible-dev:centos-stream9"
ansible_inventory : &ansible_inventory "-i 127.0.0.1, --connection=local"
ansible_playbook : &ansible_playbook "hello.yml"
environment:
ANSIBLE_INVENTORY : *ansible_inventory
ANSIBLE_PLAYBOOK : *ansible_playbook
trigger:
branch:
exclude:
- main
event: [push]
steps:
- name: "ansible_environment_verify"
image: *ansible_image
commands:
- git log -1
- ansible --version
- ansible-lint --version
###############################################################################
###############################################################################
###############################################################################
- name: "ansible_galaxy_requirements"
image: *ansible_image
commands:
- ansible-galaxy install -r requirements.yml
- name: "ansible_lint"
image: *ansible_image
commands:
- ansible-lint --offline
- name: "ansible_playbook_execution"
image: *ansible_image
commands:
- ansible-playbook -v $ANSIBLE_INVENTORY $ANSIBLE_PLAYBOOK
# - name: Update repo with build stats
# image: appleboy/drone-git-push
# settings:
# branch: testing
# remote: gitea@10.10.10.109:chris/drone-test-1.git
# force: false
# commit: true
# empty_commit: true
# commit_message: "Drone build ${DRONE_COMMIT_SHA:0:7} => ${DRONE_BUILD_STATUS}"
# author_name: "Drone CI"
# author_email: "chris@thezengarden.net"
# skip_verify: true
# ssh_key:
# from_secret: gitea_ssh_privkey
# when:
# branch:
# - development
---
kind: pipeline
type: docker
name: run_ansible_tests_debian12
global-variables:
ansible_image : &ansible_image "gitea.thezengarden.net/podman/images/ansible-dev:debian-12"
ansible_inventory : &ansible_inventory "-i 127.0.0.1, --connection=local"
ansible_playbook : &ansible_playbook "hello.yml"
environment:
ANSIBLE_INVENTORY : *ansible_inventory
ANSIBLE_PLAYBOOK : *ansible_playbook
trigger:
branch:
exclude:
- main
event: [push]
steps:
- name: "ansible_environment_verify"
image: *ansible_image
commands:
- git log -1
- ansible --version
- ansible-lint --version
- name: "ansible_galaxy_requirements"
image: *ansible_image
commands:
- ansible-galaxy install -r requirements.yml
- name: "ansible_lint"
image: *ansible_image
commands:
- ansible-lint --offline
- name: "ansible_playbook_execution"
image: *ansible_image
commands:
- ansible-playbook -v $ANSIBLE_INVENTORY $ANSIBLE_PLAYBOOK
# ---
# name: Test Ansible Linting of drone-test-1
# kind: pipeline
# type: docker
# type: exec
# name: check_docker
# trigger:
# branch:
# exclude:
# - main
# event: [push]
# status: [success]
# depends_on:
# - run_ansible_tests
# steps:
# - name: Add comment to pull request
# image: gitea.thezengarden.net/podman/images/ansible-dev:latest
# environment:
# GITEA_TOKEN:
# from_secret: gitea_token
# - name: check_env
# commands:
# - 'curl -sL -X POST -H "Authorization: token $GITEA_TOKEN" -H "Content-type: application/json" https://gitea.thezengarden.net/api/v1/repos/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/issues/${DRONE_PULL_REQUEST}/comments -d "{\"body\": \"Build complete and successful for $DRONE_REPO_NAME\"}"'
# depends_on:
# - "Install requirements, lint, and run Ansible playbook"
# when:
# event:
# - pull_request
# - whoami
# - hostnamectl
# - env
# - pwd
# - tree
# - cat requirements.yml
# - name: docker_info
# commands:
# - docker info
# - name: docker_build
# environment:
# REGISTRY : gitea.thezengarden.net
# BUILD_PREFIX : "podman/images"
# BUILD_NAME : ansible-dev
# commands:
# - echo "docker build --no-cache -t $REGISTRY/$BUILD_PREFIX/$BUILD_NAME:$CI_BUILD_NUMBER ."
# - docker build --no-cache -t $REGISTRY/$BUILD_PREFIX/$BUILD_NAME:$CI_BUILD_NUMBER .
# - name: docker_login
# environment:
# REGISTRY : gitea.thezengarden.net
# GITEA_USER :
# from_secret: gitea_user
# GITEA_PASSWORD :
# from_secret: gitea_password
# commands:
# - echo "$GITEA_PASSWORD" | docker login --username chris --password-stdin $REGISTRY
# - name: docker_push
# environment:
# REGISTRY : gitea.thezengarden.net
# BUILD_PREFIX : "podman/images"
# BUILD_NAME : ansible-dev
# commands:
# - docker push $REGISTRY/$BUILD_PREFIX/$BUILD_NAME:$CI_BUILD_NUMBER
# - docker images | grep "$REGISTRY/$BUILD_PREFIX/$BUILD_NAME"
# - name: docker_images
# environment:
# REGISTRY : gitea.thezengarden.net
# BUILD_PREFIX : "podman/images"
# BUILD_NAME : ansible-dev
# commands:
# - docker images | grep "$REGISTRY/$BUILD_PREFIX/$BUILD_NAME"
# ---
# kind: pipeline
# type: exec
# name: setup_env
# trigger:
# branch:
# exclude:
# - main
# event: [push]
# steps:
# - name: write_vars
# environment:
# DIMG:
# from_secret: docker_image
# commands:
# - pwd
# - ls -ltra
# - echo "dimg=$DIMG" > .drone_env_test
# - name: read_vars
# commands:
# - pwd
# - ls -ltra
# - cat .drone_env_test
# - source .drone_env_test
# - echo $dimg

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.old

20
Dockerfile Normal file
View File

@ -0,0 +1,20 @@
FROM fedora:39
LABEL maintainer="Chris Hammer (chris@thezengarden.net)"
RUN rm /etc/localtime \
&& ln -s /usr/share/zoneinfo/US/Eastern /etc/localtime
RUN mkdir -p /root/.ssh
COPY conf/ssh_config /root/.ssh/config
COPY conf/hosts /etc/hosts
COPY conf/dnf.conf /etc/dnf/dnf.conf
COPY python/requirements.txt /tmp/requirements.txt
RUN dnf update -y
RUN dnf install -y python3-pip git ansible-core python3-ansible-lint
# && pip install pip --upgrade \
# && pip install -r /tmp/requirements.txt
COPY ansible/ansible-check.yml /tmp/ansible-check.yml
CMD ["/bin/bash"]

10
ansible/ansible-check.yml Normal file
View File

@ -0,0 +1,10 @@
---
- name: Ansible Install Test
hosts: all
become: false
gather_facts: false
tasks:
- name: Test Ansible Installation
ansible.builtin.debug:
msg: "Ansible has been successfully installed!"

7
conf/dnf.conf Normal file
View File

@ -0,0 +1,7 @@
[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
best=True
skip_if_unavailable=False
max_parallel_downloads=20

1
conf/hosts Normal file
View File

@ -0,0 +1 @@
10.10.10.109 gitea.thezengarden.net

14
conf/ssh_config Normal file
View File

@ -0,0 +1,14 @@
AddKeysToAgent yes
Host 10.*
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
Host git git.thezengarden.net
Hostname gitlab
Host gitea gitea.thezengarden.net
Hostname 10.10.10.109

View File

@ -8,9 +8,3 @@
- name: Say Hello world
ansible.builtin.debug:
msg: Hello world!
- name: Install Git
ansible.builtin.package:
name: git
state: present

2
python/requirements.txt Normal file
View File

@ -0,0 +1,2 @@
ansible-core==2.14.11
ansible-lint==6.13.1