Skip to content

Commit d5ec792

Browse files
committed
Test in CI.
1 parent 32f6357 commit d5ec792

File tree

5 files changed

+12
-19
lines changed

5 files changed

+12
-19
lines changed

.github/workflows/docker.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ jobs:
3434
username: ${{ github.actor }}
3535
password: ${{ secrets.GITHUB_TOKEN }}
3636

37+
- name: Test
38+
run: make test
39+
3740
- name: Make tag
3841
run: |
3942
[ "${GITHUB_EVENT_NAME}" == 'pull_request' ] && echo "tag=${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV || true

Dockerfile

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,10 @@ RUN set -x \
3535
&& mv ct /usr/local/bin/ \
3636
&& curl -Lo cosign https://github.com/sigstore/cosign/releases/download/v${VERSION_COSIGN}/cosign-linux-amd64 \
3737
&& chmod +x cosign \
38-
&& mv cosign /usr/local/bin/
39-
40-
RUN mkdir -p /usr/share/ansible/collections/ansible_collections/metalstack/base/plugins \
41-
&& cd /usr/share/ansible/collections/ansible_collections/metalstack/base/plugins \
42-
&& mkdir action modules \
43-
&& curl -Lo action/metal_stack_release_vector.py https://raw.githubusercontent.com/metal-stack/ansible-common/${METAL_ROLES_VERSION}/action_plugins/metal_stack_release_vector.py \
44-
&& curl -Lo modules/metal_stack_release_vector.py https://raw.githubusercontent.com/metal-stack/ansible-common/${METAL_ROLES_VERSION}/library/metal_stack_release_vector.py \
45-
&& chmod +x action/metal_stack_release_vector.py modules/metal_stack_release_vector.py
38+
&& mv cosign /usr/local/bin/ \
39+
&& bash -c 'mkdir -p /usr/share/ansible/collections/ansible_collections/metalstack/base/plugins/{action,modules}' \
40+
&& curl -Lo /usr/share/ansible/collections/ansible_collections/metalstack/base/plugins/action/metal_stack_release_vector.py https://raw.githubusercontent.com/metal-stack/ansible-common/${METAL_ROLES_VERSION}/action_plugins/metal_stack_release_vector.py \
41+
&& curl -Lo /usr/share/ansible/collections/ansible_collections/metalstack/base/plugins/modules/metal_stack_release_vector.py https://raw.githubusercontent.com/metal-stack/ansible-common/${METAL_ROLES_VERSION}/library/metal_stack_release_vector.py
4642

4743
COPY ansible.cfg /etc/ansible/ansible.cfg
4844
COPY gai.conf /etc/gai.conf

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
.PHONY: run
2-
run:
1+
.PHONY: test
2+
test:
33
docker build -t metal-deployment-base .
44
docker build -t metal-deployment-base-test -f Dockerfile.test .
55
docker run --rm -it metal-deployment-base-test bash -c 'ansible -m metalstack.base.metal_stack_release_vector localhost && find ~/.ansible/roles -maxdepth 1 -type d -ls'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This repository builds the deployment base image that can be used for deploying
77
In case your deployment depends on Ansible roles that are referenced in a metal-stack release vector (e.g. [releases](https://github.com/metal-stack/releases)), these role dependencies can be dynamically installed through the release vector OCI artifacts by running the following command before playbook execution:
88

99
```bash
10-
# requires the metal_stack_release_vector variable to be defined in your ansible variables
10+
# requires the metal_stack_release_vectors variable to be defined in your ansible variables
1111
$ ansible localhost -m metalstack.base.metal_stack_release_vector
1212
- Installing ansible-common (v0.6.13) to /root/.ansible/roles/ansible-common
1313
- Installing metal-ansible-modules (v0.2.10) to /root/.ansible/roles/metal-ansible-modules
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
1-
metal_stack_release_version: develop
2-
1+
---
32
metal_stack_release_vectors:
4-
- url: oci://ghcr.io/metal-stack/releases:{{ metal_stack_release_version }}
3+
- url: oci://ghcr.io/metal-stack/releases:develop
54
variable_mapping_path: metal_stack_release.mapping
65
include_role_defaults: metal-roles/common/roles/defaults
76
oci_cosign_verify_key: |
87
-----BEGIN PUBLIC KEY-----
98
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEdeAXd2namgVNDT0APmogKGwaV+Q4
109
rfe4uVgmsyBbb6TrhX5Py6x1PsonDahTvdVpbSGC7QGEjxIHdi8HnJ4Okg==
1110
-----END PUBLIC KEY-----
12-
13-
metal_stack_release_vector_replacements:
14-
- key: name
15-
old: ghcr.io/metal-stack/
16-
new: r.metal-stack.io/

0 commit comments

Comments
 (0)