Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

Add new build stage in CI #161

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 33 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ env:
- MINIKUBE_VERSION="v0.28.2"
- IMAGE_NAME=storageos/cluster-operator
- IMAGE_TAG=test
- CI_CONTAINER_REGISTRY=stosci
- CONTAINER_REPO_NAME=cluster-operator

before_install:
- |
Expand All @@ -32,43 +34,66 @@ install: true

jobs:
include:
- go: "1.11"
- stage: build
go: "1.12.9"
name: Build container image
script:
- make image/cluster-operator OPERATOR_IMAGE=$CI_CONTAINER_REGISTRY/$CONTAINER_REPO_NAME:$TRAVIS_BUILD_ID
- docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASS"
- docker push $CI_CONTAINER_REGISTRY/$CONTAINER_REPO_NAME:$TRAVIS_BUILD_ID
- stage: test
go: "1.12.9"
sudo: required
env:
- "TEST_CLUSTER=kind"
- "INSTALL_METHOD=olm"
name: OLM on KinD (k8s-1.13)
script: ./test/e2e.sh $TEST_CLUSTER $INSTALL_METHOD
- go: "1.11"
script:
- docker pull $CI_CONTAINER_REGISTRY/$CONTAINER_REPO_NAME:$TRAVIS_BUILD_ID
- docker tag $CI_CONTAINER_REGISTRY/$CONTAINER_REPO_NAME:$TRAVIS_BUILD_ID $IMAGE_NAME:$IMAGE_TAG
- ./test/e2e.sh $TEST_CLUSTER $INSTALL_METHOD
- stage: test
go: "1.12.9"
sudo: required
env:
- "TEST_CLUSTER=openshift"
- "INSTALL_METHOD=olm"
name: OLM on OpenShift (k8s-1.11)
script: ./test/e2e.sh $TEST_CLUSTER $INSTALL_METHOD
script:
- docker pull $CI_CONTAINER_REGISTRY/$CONTAINER_REPO_NAME:$TRAVIS_BUILD_ID
- docker tag $CI_CONTAINER_REGISTRY/$CONTAINER_REPO_NAME:$TRAVIS_BUILD_ID $IMAGE_NAME:$IMAGE_TAG
- ./test/e2e.sh $TEST_CLUSTER $INSTALL_METHOD
- &base-test
go: "1.11"
stage: test
go: "1.12.9"
sudo: required
env:
- "TEST_CLUSTER=openshift"
- "INSTALL_METHOD=none"
name: OpenShift-3.11 (k8s-1.11)
script: ./test/e2e.sh $TEST_CLUSTER $INSTALL_METHOD
script:
- docker pull $CI_CONTAINER_REGISTRY/$CONTAINER_REPO_NAME:$TRAVIS_BUILD_ID
- docker tag $CI_CONTAINER_REGISTRY/$CONTAINER_REPO_NAME:$TRAVIS_BUILD_ID $IMAGE_NAME:$IMAGE_TAG
- ./test/e2e.sh $TEST_CLUSTER $INSTALL_METHOD
- <<: *base-test
env:
- "TEST_CLUSTER=kind"
- "INSTALL_METHOD=none"
name: KinD (k8s-1.14)
- stage: deploy
go: "1.11"
go: "1.12.9"
sudo: required
env:
- "TEST_CLUSTER=kind"
- "INSTALL_METHOD=none"
name: Publish Container Image
script:
- make image/cluster-operator
# Pull the container from CI container registry and retag it.
- docker pull $CI_CONTAINER_REGISTRY/$CONTAINER_REPO_NAME:$TRAVIS_BUILD_ID
- docker tag $CI_CONTAINER_REGISTRY/$CONTAINER_REPO_NAME:$TRAVIS_BUILD_ID $IMAGE_NAME:$IMAGE_TAG
# Generate OLM metadata zip for rhel operator marketplace.
- make metadata-zip
# Generate uber manifest file.
- OPERATOR_IMAGE=storageos/cluster-operator:$TRAVIS_TAG make generate-install-manifest
before_deploy:
- docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASS"
Expand Down
6 changes: 1 addition & 5 deletions test/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,11 @@ main() {

NODE_NAME=$(kubectl get nodes --no-headers=true -o=name)

# Build the operator container image.
# This would build a container with tag storageos/cluster-operator:test,
# which is used in the e2e test setup below.
make image/cluster-operator

# Move the operator container inside Kind container so that the image is
# available to the docker in docker environment.
if [ "$1" = "kind" ]; then
x=$(docker ps -f name=kind-1-control-plane -q)
# This container image is built separately before running the e2e tests.
docker save storageos/cluster-operator:test > cluster-operator.tar
docker cp cluster-operator.tar $x:/cluster-operator.tar

Expand Down