Skip to content

Update CI scripts #734

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 28, 2025
Merged
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
18 changes: 7 additions & 11 deletions hack/openshift/get-oc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,25 @@ TOOLS_BIN=${ROOT_DIR}/build/tools/bin
UNAME_S=$(uname -s)
UNAME_M=$(uname -m)

rm -rf oc-tmp
mkdir oc-tmp

if [ "Darwin" = "${UNAME_S}" ]; then
if [ "x86_64" = "${UNAME_M}" ]; then
echo "Downloading OpenShift OC CLI ${UNAME_S} ${UNAME_M}"
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
curl -Ls https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-client-mac.tar.gz -o openshift-client.tar.gz
else
echo "Downloading OpenShift OC CLI ${UNAME_S} ${UNAME_M}"
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
curl -Ls https://mirror.openshift.com/pub/openshift-v4/aarch64/clients/ocp/stable/openshift-client-mac-arm64.tar.gz -o openshift-client.tar.gz
fi
else
if [ "x86_64" = "${UNAME_M}" ]; then
echo "Downloading OpenShift OC CLI ${UNAME_S} ${UNAME_M}"
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
curl -Ls https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-client-linux.tar.gz -o openshift-client.tar.gz
else
echo "Downloading OpenShift OC CLI ${UNAME_S} ${UNAME_M}"
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
curl -Ls https://mirror.openshift.com/pub/openshift-v4/aarch64/clients/ocp/stable/openshift-client-linux.tar.gz -o openshift-client.tar.gz
fi
fi

cd oc-tmp && tar -xvf openshift-client.tar.gz
mv oc-tmp/oc ${TOOLS_BIN}/oc
rm -rf oc-tmp

tar -zxvf openshift-client.tar.gz oc
mv oc ${TOOLS_BIN}/oc
chmod +x ${TOOLS_BIN}/oc
rm openshift-client.tar.gz
5 changes: 4 additions & 1 deletion hack/tools/get-tekton.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ TOOLS_BIN=${ROOT_DIR}/build/tools/bin
UNAME_S=$(uname -s)
UNAME_M=$(uname -m)

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

if [ "Darwin" = "${UNAME_S}" ]; then
echo "Downloading Tekton ${VERSION} ${UNAME_S} ${UNAME_M}"
Expand Down
2 changes: 1 addition & 1 deletion tekton/builder.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN dnf install oracle-java-jdk-release-el* -y \
&& dnf install jdk-21-headful -y \
&& dnf install make which git -y

RUN curl -Ls https://go.dev/dl/$GoVersion.linux-$GoArch.tar.gz -o go-linux.tar.gz \
RUN curl -Ls https://go.dev/dl/go$GoVersion.linux-$GoArch.tar.gz -o go-linux.tar.gz \
&& rm -rf /usr/local/go \
&& tar -C /usr/local -xzf go-linux.tar.gz \
&& rm go-linux.tar.gz \
Expand Down
43 changes: 43 additions & 0 deletions tekton/operator-ci-run.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: NAME_PLACEHOLDER
spec:
pipelineRef:
name: operator-ci
workspaces:
- name: shared-data
persistentVolumeClaim:
claimName: operator-ci-pvc
- name: dockerconfig
secret:
secretName: container-auth-json
- name: git-credentials
secret:
secretName: github-ssh-credentials
taskRunSpecs:
- pipelineTaskName: git-clone
podTemplate:
securityContext:
fsGroup: 65532
timeouts:
pipeline: "2h3m0s"
tasks: "2h0m0s"
params:
- name: repo-url
value: GIT_REPO_PLACEHOLDER
- name: revision
value: REVISION_PLACEHOLDER
- name: builder-image-prefix
value: "iad.ocir.io/odx-stateservice/tekton/builder"
- name: env-configmap
value: os-cert-config
- name: oci-tenancy-ocid
value: "ocid1.tenancy.oc1..aaaaaaaaztkccp2ubbxhhuftzvouv6t3b4sfencpgvsicrtmhwprk2mgahjq"
- name: oci-user-ocid
value: "ocid1.user.oc1..aaaaaaaa6vuuuw4vx3etfnugb6r34uyy2ovu2hbqivmazxylohc633pflkla"
- name: oci-region
value: "us-phoenix-1"
- name: oci-cli-secret
value: oci-cli-secret

2 changes: 1 addition & 1 deletion tekton/rbac-pipeline-admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ roleRef:
subjects:
- kind: ServiceAccount
name: pipeline
namespace: coherence-cert
namespace: NAMESPACE_HOLDER
2 changes: 1 addition & 1 deletion tekton/task-setup-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
BUILD_ARCH=amd64
fi
DOCKER_FILE_SHA1SUM=$(sha1sum "${SOURCE_DIRECTORY}/tekton/builder.Dockerfile")
OPERATOR_GO_VERSION=$(sed -n -e 's/^toolchain \(.*\)$/\1/p' ${SOURCE_DIRECTORY}/go.mod)
OPERATOR_GO_VERSION=$(cat ${SOURCE_DIRECTORY}/.go-version)
readarray -d ' ' -t DOCKER_FILE_SHA <<< "${DOCKER_FILE_SHA1SUM}"
LATEST_GO=$(curl -s 'https://go.dev/VERSION?m=text' | head -n 1)
BUILDER_IMAGE_NAME="${PARAM_BUILDER_IMAGE_PREFIX}:${DOCKER_FILE_SHA}-${OPERATOR_GO_VERSION}-${BUILD_ARCH}"
Expand Down