10
10
#
11
11
# Werkcer workflow looks like this:
12
12
#
13
- # build -> integration-tests179
14
- # -> integration-tests185
13
+ # build -> integration-tests (1.7.9)
14
+ # -> integration-tests (1.8.5)
15
15
# -> quality
16
16
#
17
17
28
28
name : Hello
29
29
code : |
30
30
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"
32
32
- script :
33
33
name : Install pre-reqs
34
34
code : |
@@ -40,122 +40,53 @@ build:
40
40
- script :
41
41
name : Copy built-artifacts into the image
42
42
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
44
46
- script :
45
- name : Clean up
47
+ name : Remove things we do not want in the Docker image in order to reduce size of image
46
48
code : |
47
- # remove unneeded RPMs and clean up the YUM cache
48
49
yum -y remove tar gzip
49
50
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 :
54
65
steps :
55
66
- script :
56
67
name : Run integration tests
57
68
code : |
58
69
# 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”
130
78
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
-
148
79
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
150
81
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
157
88
export KUBECONFIG="$WERCKER_SOURCE_DIR/build/kube.config"
158
-
89
+
159
90
# running on Wercker
160
91
export WERCKER="true"
161
92
@@ -170,45 +101,50 @@ integration-test185:
170
101
yum install -y apache-maven
171
102
export M2_HOME="/usr/share/apache-maven"
172
103
export PATH=$M2_HOME/bin:$PATH
173
-
104
+
174
105
# install opensll
175
106
yum install -y openssl
176
-
107
+
177
108
export HOST_PATH="/scratch"
178
109
export PV_ROOT=$HOST_PATH
179
- export RESULT_ROOT="$WERCKER_OUTPUT_DIR /k8s_dir"
110
+ export RESULT_ROOT="/pipeline/output /k8s_dir"
180
111
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
183
114
184
115
# create pull secrets
185
116
kubectl delete secret docker-store --ignore-not-found=true
186
117
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
-
188
118
kubectl delete ns test1 --ignore-not-found=true
189
119
kubectl create ns test1
190
120
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
+
192
122
kubectl delete ns test2 --ignore-not-found=true
193
123
kubectl create ns test2
194
124
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
195
128
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"
197
134
export IMAGE_TAG_OPERATOR="$WERCKER_GIT_BRANCH"
198
135
export IMAGE_PULL_POLICY_OPERATOR="IfNotPresent"
199
-
136
+ export IMAGE_PULL_SECRET_OPERATOR="quay-io"
200
137
export IMAGE_PULL_SECRET_WEBLOGIC="docker-store"
201
138
202
139
echo "Integration test suite against the test image which is:"
203
140
echo "$IMAGE_NAME:$IMAGE_TAG"
204
141
205
142
# integration tests
206
143
$WERCKER_SOURCE_DIR/src/integration-tests/bash/run.sh
207
-
144
+
208
145
# clean up
209
146
yum clean all
210
147
211
-
212
148
# This pipeline runs quality checks
213
149
quality :
214
150
steps :
0 commit comments