Skip to content

Commit 9da66ad

Browse files
authored
Update CI scripts (#734)
1 parent 4f7cb78 commit 9da66ad

File tree

6 files changed

+57
-15
lines changed

6 files changed

+57
-15
lines changed

hack/openshift/get-oc.sh

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,25 @@ TOOLS_BIN=${ROOT_DIR}/build/tools/bin
1212
UNAME_S=$(uname -s)
1313
UNAME_M=$(uname -m)
1414

15-
rm -rf oc-tmp
16-
mkdir oc-tmp
17-
1815
if [ "Darwin" = "${UNAME_S}" ]; then
1916
if [ "x86_64" = "${UNAME_M}" ]; then
2017
echo "Downloading OpenShift OC CLI ${UNAME_S} ${UNAME_M}"
21-
curl -Ls https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-client-mac.tar.gz -o oc-tmp/openshift-client.tar.gz
18+
curl -Ls https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-client-mac.tar.gz -o openshift-client.tar.gz
2219
else
2320
echo "Downloading OpenShift OC CLI ${UNAME_S} ${UNAME_M}"
24-
curl -Ls https://mirror.openshift.com/pub/openshift-v4/aarch64/clients/ocp/stable/openshift-client-mac-arm64.tar.gz -o oc-tmp/openshift-client.tar.gz
21+
curl -Ls https://mirror.openshift.com/pub/openshift-v4/aarch64/clients/ocp/stable/openshift-client-mac-arm64.tar.gz -o openshift-client.tar.gz
2522
fi
2623
else
2724
if [ "x86_64" = "${UNAME_M}" ]; then
2825
echo "Downloading OpenShift OC CLI ${UNAME_S} ${UNAME_M}"
29-
curl -Ls https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-client-linux.tar.gz -o oc-tmp/openshift-client.tar.gz
26+
curl -Ls https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-client-linux.tar.gz -o openshift-client.tar.gz
3027
else
3128
echo "Downloading OpenShift OC CLI ${UNAME_S} ${UNAME_M}"
32-
curl -Ls https://mirror.openshift.com/pub/openshift-v4/aarch64/clients/ocp/stable/openshift-client-linux.tar.gz -o oc-tmp/openshift-client.tar.gz
29+
curl -Ls https://mirror.openshift.com/pub/openshift-v4/aarch64/clients/ocp/stable/openshift-client-linux.tar.gz -o openshift-client.tar.gz
3330
fi
3431
fi
3532

36-
cd oc-tmp && tar -xvf openshift-client.tar.gz
37-
mv oc-tmp/oc ${TOOLS_BIN}/oc
38-
rm -rf oc-tmp
39-
33+
tar -zxvf openshift-client.tar.gz oc
34+
mv oc ${TOOLS_BIN}/oc
4035
chmod +x ${TOOLS_BIN}/oc
36+
rm openshift-client.tar.gz

hack/tools/get-tekton.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ TOOLS_BIN=${ROOT_DIR}/build/tools/bin
1313
UNAME_S=$(uname -s)
1414
UNAME_M=$(uname -m)
1515

16-
TEKTON_VERSION=$(curl -L -s https://dl.k8s.io/release/stable.txt)
16+
if [ "${TEKTON_VERSION}" == "" ]
17+
then
18+
TEKTON_VERSION=0.40.0
19+
fi
1720

1821
if [ "Darwin" = "${UNAME_S}" ]; then
1922
echo "Downloading Tekton ${VERSION} ${UNAME_S} ${UNAME_M}"

tekton/builder.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN dnf install oracle-java-jdk-release-el* -y \
99
&& dnf install jdk-21-headful -y \
1010
&& dnf install make which git -y
1111

12-
RUN curl -Ls https://go.dev/dl/$GoVersion.linux-$GoArch.tar.gz -o go-linux.tar.gz \
12+
RUN curl -Ls https://go.dev/dl/go$GoVersion.linux-$GoArch.tar.gz -o go-linux.tar.gz \
1313
&& rm -rf /usr/local/go \
1414
&& tar -C /usr/local -xzf go-linux.tar.gz \
1515
&& rm go-linux.tar.gz \

tekton/operator-ci-run.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
apiVersion: tekton.dev/v1
2+
kind: PipelineRun
3+
metadata:
4+
name: NAME_PLACEHOLDER
5+
spec:
6+
pipelineRef:
7+
name: operator-ci
8+
workspaces:
9+
- name: shared-data
10+
persistentVolumeClaim:
11+
claimName: operator-ci-pvc
12+
- name: dockerconfig
13+
secret:
14+
secretName: container-auth-json
15+
- name: git-credentials
16+
secret:
17+
secretName: github-ssh-credentials
18+
taskRunSpecs:
19+
- pipelineTaskName: git-clone
20+
podTemplate:
21+
securityContext:
22+
fsGroup: 65532
23+
timeouts:
24+
pipeline: "2h3m0s"
25+
tasks: "2h0m0s"
26+
params:
27+
- name: repo-url
28+
value: GIT_REPO_PLACEHOLDER
29+
- name: revision
30+
value: REVISION_PLACEHOLDER
31+
- name: builder-image-prefix
32+
value: "iad.ocir.io/odx-stateservice/tekton/builder"
33+
- name: env-configmap
34+
value: os-cert-config
35+
- name: oci-tenancy-ocid
36+
value: "ocid1.tenancy.oc1..aaaaaaaaztkccp2ubbxhhuftzvouv6t3b4sfencpgvsicrtmhwprk2mgahjq"
37+
- name: oci-user-ocid
38+
value: "ocid1.user.oc1..aaaaaaaa6vuuuw4vx3etfnugb6r34uyy2ovu2hbqivmazxylohc633pflkla"
39+
- name: oci-region
40+
value: "us-phoenix-1"
41+
- name: oci-cli-secret
42+
value: oci-cli-secret
43+

tekton/rbac-pipeline-admin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ roleRef:
99
subjects:
1010
- kind: ServiceAccount
1111
name: pipeline
12-
namespace: coherence-cert
12+
namespace: NAMESPACE_HOLDER

tekton/task-setup-env.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ spec:
4444
BUILD_ARCH=amd64
4545
fi
4646
DOCKER_FILE_SHA1SUM=$(sha1sum "${SOURCE_DIRECTORY}/tekton/builder.Dockerfile")
47-
OPERATOR_GO_VERSION=$(sed -n -e 's/^toolchain \(.*\)$/\1/p' ${SOURCE_DIRECTORY}/go.mod)
47+
OPERATOR_GO_VERSION=$(cat ${SOURCE_DIRECTORY}/.go-version)
4848
readarray -d ' ' -t DOCKER_FILE_SHA <<< "${DOCKER_FILE_SHA1SUM}"
4949
LATEST_GO=$(curl -s 'https://go.dev/VERSION?m=text' | head -n 1)
5050
BUILDER_IMAGE_NAME="${PARAM_BUILDER_IMAGE_PREFIX}:${DOCKER_FILE_SHA}-${OPERATOR_GO_VERSION}-${BUILD_ARCH}"

0 commit comments

Comments
 (0)