From 41f01c361a6f6a8c198cd0276c3a3838c50d7b90 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Tue, 25 Aug 2020 14:40:13 -0400 Subject: [PATCH] Ci docs (#15) * Remove cache during docker build * Add some docs for Prow --- README.md | 19 +++++++++++++++++++ ci/Dockerfile | 8 +++++--- ci/incluster_integration.sh | 2 +- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 81d4873..1c09959 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,25 @@ You can run the `molecule` integration tests with the command: These commands will create a directory called `ansible_collections` which should not be committed or added to the `.gitignore` (Tracking issue: https://github.com/ansible/ansible/issues/68499) + +### Prow + +This repository uses the OpenShift [Prow](https://github.com/kubernetes/test-infra/blob/master/prow/README.md) instance for testing against live OpenShift clusters. +The configuration for the CI jobs that this repository runs can be found in the [`openshift/release repository`](https://github.com/openshift/release/blob/master/ci-operator/config/ansible-collections/community.okd/ansible-collections-community.okd-main.yaml). + +The [Prow CI integration test job](https://github.com/openshift/release/blob/master/ci-operator/config/ansible-collections/community.okd/ansible-collections-community.okd-main.yaml#L35-L38) +runs the command: + + make test-integration-incluster + +which will create a job that runs the normal `make integration` target. In order to mimic the Prow CI job, you must +first build the test image using the Dockerfile in [`ci/Dockerfile`](ci/Dockerfile). Then, push the image +somewhere that it will be accessible to the cluster, and run + + IMAGE_FORMAT= make test-integration-incluser + +where the `IMAGE_FORMAT` environment variable is the full reference to your container (ie, `IMAGE_FORMAT=quay.io/example/molecule-test-runner`) + ## Publishing New Versions The current process for publishing new versions of the OKD Collection is manual, and requires a user who has access to the `community.okd` namespace on Ansible Galaxy to publish the build artifact. diff --git a/ci/Dockerfile b/ci/Dockerfile index 6c30601..163d38a 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -14,11 +14,13 @@ RUN yum install -y \ python3-devel \ python3-pip \ python3-setuptools \ - && pip3 install --upgrade setuptools pip \ - && pip3 install \ + && pip3 install --no-cache-dir --upgrade setuptools pip \ + && pip3 install --no-cache-dir \ openshift \ ansible \ - molecule + molecule \ + && yum clean all \ + && rm -rf $HOME/.cache COPY . /opt/ansible diff --git a/ci/incluster_integration.sh b/ci/incluster_integration.sh index 79da03a..c1d02aa 100755 --- a/ci/incluster_integration.sh +++ b/ci/incluster_integration.sh @@ -2,7 +2,7 @@ set -x -# IMAGE_FORMAT be in the form $registry/$org/$image:$$component, ie +# IMAGE_FORMAT is in the form $registry/$org/$image:$$component, ie # quay.io/openshift/release:$component # To test with your own image, build and push the test image # (using the Dockerfile in ci/Dockerfile)