Skip to content

Commit 7cc6e98

Browse files
committed
Updates
1 parent abaf1bd commit 7cc6e98

File tree

1 file changed

+53
-117
lines changed

1 file changed

+53
-117
lines changed

wercker.yml

Lines changed: 53 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#
1111
# Werkcer workflow looks like this:
1212
#
13-
# build -> integration-tests179
14-
# -> integration-tests185
13+
# build -> integration-tests (1.7.9)
14+
# -> integration-tests (1.8.5)
1515
# -> quality
1616
#
1717

@@ -28,7 +28,7 @@ build:
2828
name: Hello
2929
code: |
3030
echo "Building Oracle WebLogic Server Kubernetes Operator..."
31-
echo "The commit id is $WERCKER_GIT_COMMIT"
31+
echo "The branch and commit id are $WERCKER_GIT_BRANCH, $WERCKER_GIT_COMMIT"
3232
- script:
3333
name: Install pre-reqs
3434
code: |
@@ -40,122 +40,53 @@ build:
4040
- script:
4141
name: Copy built-artifacts into the image
4242
code: |
43-
tar -cvf $WERCKER_OUTPUT_DIR/build.tar src/main/scripts/* target/weblogic-kubernetes-operator-0.1.0-alpha-SNAPSHOT.jar Dockerfile
43+
mkdir /operator
44+
cp -R src/main/scripts/* /operator/
45+
cp target/weblogic-kubernetes-operator-0.1.0-alpha-SNAPSHOT.jar /operator/weblogic-kubernetes-operator.jar
4446
- script:
45-
name: Clean up
47+
name: Remove things we do not want in the Docker image in order to reduce size of image
4648
code: |
47-
# remove unneeded RPMs and clean up the YUM cache
4849
yum -y remove tar gzip
4950
yum clean all
50-
51-
52-
# This pipeline runs the integration tests against 1.7.9 k8s cluster on OCI.
53-
integration-test179:
51+
# push the image to quay.io using the GIT branch as the tag
52+
# this image needs to be available to the integration-test pipeline for testing
53+
- internal/docker-push:
54+
username: $QUAY_USERNAME
55+
password: $QUAY_PASSWORD
56+
email: $QUAY_EMAIL
57+
repository: quay.io/markxnelson/weblogic-kubernetes-operator
58+
tag: $WERCKER_GIT_BRANCH
59+
working-dir: "/operator"
60+
cmd: "operator.sh"
61+
env: "PATH=$PATH:/operator"
62+
63+
# This pipeline runs the integration tests against a k8s cluster on OCI.
64+
integration-test:
5465
steps:
5566
- script:
5667
name: Run integration tests
5768
code: |
5869
# Copy Docker file to OCI host and load into local Docker registry
59-
yum install -y openssh-clients
60-
echo -e $OCI_K8S_179_SSHKEY > /tmp/ssh_key
61-
chmod 600 /tmp/ssh_key
62-
scp -o StrictHostKeyChecking=no -i /tmp/ssh_key $WERCKER_OUTPUT_DIR/build.tar opc@$OCI_K8S_179_WORKER0_IP:/scratch/build.tar
63-
ssh -o StrictHostKeyChecking=no -i /tmp/ssh_key opc@$OCI_K8S_179_WORKER0_IP "tar -xvf /scratch/operator.tar”
64-
ssh -o StrictHostKeyChecking=no -i /tmp/ssh_key opc@$OCI_K8S_179_WORKER0_IP "sudo docker build -t weblogic-kubernetes-operator:$WERCKER_GIT_BRANCH --no-cache=true /scratch/”
65-
ssh -o StrictHostKeyChecking=no -i /tmp/ssh_key opc@$OCI_K8S_179_WORKER0_IP "sudo docker save weblogic-kubernetes-operator:$WERCKER_GIT_BRANCH > /scratch/operator.tar”
66-
ssh -o StrictHostKeyChecking=no -i /tmp/ssh_key opc@$OCI_K8S_179_WORKER1_IP "sudo docker load < /scratch/operator.tar”
67-
68-
cp /etc/hosts $WERCKER_PIPELINE_DIR/hosts
69-
sed -i "$ a ${OCI_K8S_179_WORKER0_IP} ${OCI_K8S_179_WORKER0_HOSTNAME}" $WERCKER_PIPELINE_DIR/hosts
70-
cp $WERCKER_PIPELINE_DIR/hosts /etc/hosts
71-
72-
# Update KUBECONFIG for K8S 1.7.9 cluster
73-
export K8S_NODEPORT_HOST="${OCI_K8S_179_WORKER0_HOSTNAME}"
74-
sed -i -e "s,%ADDRESS%,https://$OCI_K8S_179_MASTER_IP:443,g" $WERCKER_SOURCE_DIR/build/kube.config
75-
sed -i -e "s,%CLIENT_CERT_DATA%,$OCI_K8S_179_CLIENT_CERT_DATA,g" $WERCKER_SOURCE_DIR/build/kube.config
76-
sed -i -e "s,%CLIENT_KEY_DATA%,$OCI_K8S_179_CLIENT_KEY_DATA,g" $WERCKER_SOURCE_DIR/build/kube.config
77-
export KUBECONFIG="$WERCKER_SOURCE_DIR/build/kube.config"
78-
79-
# running on Wercker
80-
export WERCKER="true"
81-
82-
# install kubectl
83-
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
84-
chmod +x ./kubectl
85-
mv ./kubectl /usr/local/bin/kubectl
86-
87-
# install maven, includes java as dependency
88-
curl -LO http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo
89-
mv epel-apache-maven.repo /etc/yum.repos.d/
90-
yum install -y apache-maven
91-
export M2_HOME="/usr/share/apache-maven"
92-
export PATH=$M2_HOME/bin:$PATH
93-
94-
# install opensll
95-
yum install -y openssl
96-
97-
export HOST_PATH="/scratch"
98-
export PV_ROOT=$HOST_PATH
99-
export RESULT_ROOT="$WERCKER_OUTPUT_DIR/k8s_dir"
100-
mkdir -m 777 -p $RESULT_ROOT
101-
export PROJECT_ROOT="$WERCKER_SOURCE_DIR"
102-
$WERCKER_SOURCE_DIR/src/integration-tests/bash/cleanup.sh
103-
104-
# create pull secrets
105-
kubectl delete secret docker-store --ignore-not-found=true
106-
kubectl create secret docker-registry docker-store --docker-server=index.docker.io/v1/ --docker-username=$DOCKER_USERNAME --docker-password=$DOCKER_PASSWORD --docker-email=$DOCKER_EMAIL
107-
108-
kubectl delete ns test1 --ignore-not-found=true
109-
kubectl create ns test1
110-
kubectl create secret docker-registry docker-store -n test1 --docker-server=index.docker.io/v1/ --docker-username=$DOCKER_USERNAME --docker-password=$DOCKER_PASSWORD --docker-email=$DOCKER_EMAIL
111-
112-
kubectl delete ns test2 --ignore-not-found=true
113-
kubectl create ns test2
114-
kubectl create secret docker-registry docker-store -n test2 --docker-server=index.docker.io/v1/ --docker-username=$DOCKER_USERNAME --docker-password=$DOCKER_PASSWORD --docker-email=$DOCKER_EMAIL
115-
116-
export IMAGE_NAME_OPERATOR="weblogic-kubernetes-operator"
117-
export IMAGE_TAG_OPERATOR="$WERCKER_GIT_BRANCH"
118-
export IMAGE_PULL_POLICY_OPERATOR="IfNotPresent"
119-
120-
export IMAGE_PULL_SECRET_WEBLOGIC="docker-store"
121-
122-
echo "Integration test suite against the test image which is:"
123-
echo "$IMAGE_NAME:$IMAGE_TAG"
124-
125-
# integration tests
126-
$WERCKER_SOURCE_DIR/src/integration-tests/bash/run.sh
127-
128-
# clean up
129-
yum clean all
70+
# yum install -y openssh-clients
71+
# echo -e $OCI_K8S_SSHKEY > /tmp/ssh_key
72+
# chmod 600 /tmp/ssh_key
73+
# scp -o StrictHostKeyChecking=no -i /tmp/ssh_key $WERCKER_OUTPUT_DIR/build.tar opc@$OCI_K8S_WORKER0_IP:/scratch/build.tar
74+
# ssh -o StrictHostKeyChecking=no -i /tmp/ssh_key opc@$OCI_K8S_WORKER0_IP "tar -xvf /scratch/operator.tar”
75+
# ssh -o StrictHostKeyChecking=no -i /tmp/ssh_key opc@$OCI_K8S_WORKER0_IP "sudo docker build -t weblogic-kubernetes-operator:$WERCKER_GIT_BRANCH --no-cache=true /scratch/”
76+
# ssh -o StrictHostKeyChecking=no -i /tmp/ssh_key opc@$OCI_K8S_WORKER0_IP "sudo docker save weblogic-kubernetes-operator:$WERCKER_GIT_BRANCH > /scratch/operator.tar”
77+
# ssh -o StrictHostKeyChecking=no -i /tmp/ssh_key opc@$OCI_K8S_WORKER1_IP "sudo docker load < /scratch/operator.tar”
13078
131-
132-
# This pipeline runs the integration tests against 1.8.5 k8s cluster on OCI.
133-
integration-test185:
134-
steps:
135-
- script:
136-
name: Run integration tests
137-
code: |
138-
# Copy Docker file to OCI host and load into local Docker registry
139-
yum install -y openssh-clients
140-
echo -e $OCI_K8S_185_SSHKEY > /tmp/ssh_key
141-
chmod 600 /tmp/ssh_key
142-
scp -o StrictHostKeyChecking=no -i /tmp/ssh_key $WERCKER_OUTPUT_DIR/build.tar opc@$OCI_K8S_185_WORKER0_IP:/scratch/build.tar
143-
ssh -o StrictHostKeyChecking=no -i /tmp/ssh_key opc@$OCI_K8S_185_WORKER0_IP "tar -xvf /scratch/operator.tar”
144-
ssh -o StrictHostKeyChecking=no -i /tmp/ssh_key opc@$OCI_K8S_185_WORKER0_IP "sudo docker build -t weblogic-kubernetes-operator:$WERCKER_GIT_BRANCH --no-cache=true /scratch/”
145-
ssh -o StrictHostKeyChecking=no -i /tmp/ssh_key opc@$OCI_K8S_185_WORKER0_IP "sudo docker save weblogic-kubernetes-operator:$WERCKER_GIT_BRANCH > /scratch/operator.tar”
146-
ssh -o StrictHostKeyChecking=no -i /tmp/ssh_key opc@$OCI_K8S_185_WORKER1_IP "sudo docker load < /scratch/operator.tar”
147-
14879
cp /etc/hosts $WERCKER_PIPELINE_DIR/hosts
149-
sed -i "$ a ${OCI_K8S_185_WORKER0_IP} ${OCI_K8S_185_WORKER0_HOSTNAME}" $WERCKER_PIPELINE_DIR/hosts
80+
sed -i "$ a ${OCI_K8S_WORKER0_IP} ${OCI_K8S_WORKER0_HOSTNAME}" $WERCKER_PIPELINE_DIR/hosts
15081
cp $WERCKER_PIPELINE_DIR/hosts /etc/hosts
151-
152-
# Update KUBECONFIG for K8S 1.8.5 cluster
153-
export K8S_NODEPORT_HOST="${OCI_K8S_185_WORKER0_HOSTNAME}"
154-
sed -i -e "s,%ADDRESS%,https://$OCI_K8S_185_MASTER_IP:443,g" $WERCKER_SOURCE_DIR/build/kube.config
155-
sed -i -e "s,%CLIENT_CERT_DATA%,$OCI_K8S_185_CLIENT_CERT_DATA,g" $WERCKER_SOURCE_DIR/build/kube.config
156-
sed -i -e "s,%CLIENT_KEY_DATA%,$OCI_K8S_185_CLIENT_KEY_DATA,g" $WERCKER_SOURCE_DIR/build/kube.config
82+
83+
# Update KUBECONFIG for K8S cluster
84+
export K8S_NODEPORT_HOST="${OCI_K8S_WORKER0_HOSTNAME}"
85+
sed -i -e "s,%ADDRESS%,https://$OCI_K8S_MASTER_IP:443,g" $WERCKER_SOURCE_DIR/build/kube.config
86+
sed -i -e "s,%CLIENT_CERT_DATA%,$OCI_K8S_CLIENT_CERT_DATA,g" $WERCKER_SOURCE_DIR/build/kube.config
87+
sed -i -e "s,%CLIENT_KEY_DATA%,$OCI_K8S_CLIENT_KEY_DATA,g" $WERCKER_SOURCE_DIR/build/kube.config
15788
export KUBECONFIG="$WERCKER_SOURCE_DIR/build/kube.config"
158-
89+
15990
# running on Wercker
16091
export WERCKER="true"
16192
@@ -170,45 +101,50 @@ integration-test185:
170101
yum install -y apache-maven
171102
export M2_HOME="/usr/share/apache-maven"
172103
export PATH=$M2_HOME/bin:$PATH
173-
104+
174105
# install opensll
175106
yum install -y openssl
176-
107+
177108
export HOST_PATH="/scratch"
178109
export PV_ROOT=$HOST_PATH
179-
export RESULT_ROOT="$WERCKER_OUTPUT_DIR/k8s_dir"
110+
export RESULT_ROOT="/pipeline/output/k8s_dir"
180111
mkdir -m 777 -p $RESULT_ROOT
181-
export PROJECT_ROOT="$WERCKER_SOURCE_DIR"
182-
$WERCKER_SOURCE_DIR/src/integration-tests/bash/cleanup.sh
112+
export PROJECT_ROOT="/pipeline/source"
113+
/pipeline/source/src/integration-tests/bash/cleanup.sh
183114
184115
# create pull secrets
185116
kubectl delete secret docker-store --ignore-not-found=true
186117
kubectl create secret docker-registry docker-store --docker-server=index.docker.io/v1/ --docker-username=$DOCKER_USERNAME --docker-password=$DOCKER_PASSWORD --docker-email=$DOCKER_EMAIL
187-
188118
kubectl delete ns test1 --ignore-not-found=true
189119
kubectl create ns test1
190120
kubectl create secret docker-registry docker-store -n test1 --docker-server=index.docker.io/v1/ --docker-username=$DOCKER_USERNAME --docker-password=$DOCKER_PASSWORD --docker-email=$DOCKER_EMAIL
191-
121+
192122
kubectl delete ns test2 --ignore-not-found=true
193123
kubectl create ns test2
194124
kubectl create secret docker-registry docker-store -n test2 --docker-server=index.docker.io/v1/ --docker-username=$DOCKER_USERNAME --docker-password=$DOCKER_PASSWORD --docker-email=$DOCKER_EMAIL
125+
kubectl delete ns weblogic-operator-1 --ignore-not-found=true
126+
kubectl create ns weblogic-operator-1
127+
kubectl create secret docker-registry quay-io -n weblogic-operator-1 --docker-server=quay.io --docker-username=$QUAY_USERNAME --docker-password=$QUAY_PASSWORD --docker-email=$QUAY_EMAIL
195128
196-
export IMAGE_NAME_OPERATOR="weblogic-kubernetes-operator"
129+
kubectl delete ns weblogic-operator-2 --ignore-not-found=true
130+
kubectl create ns weblogic-operator-2
131+
kubectl create secret docker-registry quay-io -n weblogic-operator-2 --docker-server=quay.io --docker-username=$QUAY_USERNAME --docker-password=$QUAY_PASSWORD --docker-email=$QUAY_EMAIL
132+
133+
export IMAGE_NAME_OPERATOR="quay.io/markxnelson/weblogic-kubernetes-operator"
197134
export IMAGE_TAG_OPERATOR="$WERCKER_GIT_BRANCH"
198135
export IMAGE_PULL_POLICY_OPERATOR="IfNotPresent"
199-
136+
export IMAGE_PULL_SECRET_OPERATOR="quay-io"
200137
export IMAGE_PULL_SECRET_WEBLOGIC="docker-store"
201138
202139
echo "Integration test suite against the test image which is:"
203140
echo "$IMAGE_NAME:$IMAGE_TAG"
204141
205142
# integration tests
206143
$WERCKER_SOURCE_DIR/src/integration-tests/bash/run.sh
207-
144+
208145
# clean up
209146
yum clean all
210147
211-
212148
# This pipeline runs quality checks
213149
quality:
214150
steps:

0 commit comments

Comments
 (0)