File tree Expand file tree Collapse file tree 5 files changed +35
-0
lines changed
actions/gen-install-scripts Expand file tree Collapse file tree 5 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -5,15 +5,21 @@ ENV KUBECTL_VERSION 1.18.12
55# Install
66RUN curl -L https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl -o /usr/bin/kubectl && \
77 chmod +x /usr/bin/kubectl
8+
89RUN cd /usr/local/bin &&\
910 curl -L https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh | bash
11+
1012RUN CONTROLLER_GEN_TMP_DIR=$(mktemp -d) && \
1113 cd $CONTROLLER_GEN_TMP_DIR && \
1214 go mod init tmp && \
1315 go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.1 && \
1416 rm -rf $CONTROLLER_GEN_TMP_DIR && \
1517 CONTROLLER_GEN=${GOBIN}/controller-gen
1618
19+ RUN curl -LO https://github.com/operator-framework/operator-sdk/releases/download/v1.4.2/operator-sdk_linux_amd64 && \
20+ chmod +x operator-sdk_linux_amd64 && \
21+ mv operator-sdk_linux_amd64 /usr/local/bin/operator-sdk
22+
1723# Copies your code file from your action repository to the filesystem path `/` of the container
1824COPY entrypoint.sh /home/entrypoint.sh
1925RUN chmod +x /home/entrypoint.sh
Original file line number Diff line number Diff line change 44 IMAGE_URL :
55 description : " Operator image"
66 required : true
7+ VERSION :
8+ description : " Version of the Operator"
9+ required : true
710 ENV :
811 description : " Kustomize patch name (enviroment configuration patch)"
912 required : true
Original file line number Diff line number Diff line change 1919
2020which kustomize
2121kustomize version
22+
2223# all-in-one
2324kustomize build --load-restrictor LoadRestrictionsNone " config/release/${INPUT_ENV} /allinone" > " ${target_dir} /all-in-one.yaml"
2425echo " Created all-in-one config"
@@ -36,4 +37,13 @@ echo "Created namespaced config"
3637# crds
3738cp config/crd/bases/* " ${crds_dir} "
3839
40+ # CSV bundle
41+ operator-sdk generate kustomize manifests -q --apis-dir=pkg/api
3942
43+ # We pass the version only for non-dev deployments (it's ok to have "0.0.0" for dev)
44+ if [[ " ${INPUT_ENV} " == " dev" ]]; then
45+ kustomize build --load-restrictor LoadRestrictionsNone config/manifests | operator-sdk generate bundle -q --overwrite
46+ else
47+ kustomize build --load-restrictor LoadRestrictionsNone config/manifests | operator-sdk generate bundle -q --overwrite --version " ${INPUT_VERSION} "
48+ fi
49+ operator-sdk bundle validate ./bundle
Original file line number Diff line number Diff line change 3030 uses : ./.github/actions/gen-install-scripts
3131 with :
3232 IMAGE_URL : ${{ env.DOCKER_RELEASE_REPO }}:${{ env.VERSION }}
33+ VERSION : ${{ env.VERSION }}
3334 ENV : prod
3435
3536 - name : Create branch and push it
4445 PATH_TO_COMMIT : " deploy"
4546 DESTINATION_BRANCH : " release/${{ env.VERSION }}"
4647
48+ - name : Commit and push bundle directory
49+ uses : ./.github/actions/push-files
50+ env :
51+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
52+ PATH_TO_COMMIT : " bundle"
53+ DESTINATION_BRANCH : " release/${{ env.VERSION }}"
54+
55+ - name : Commit and push bundle dockerfile
56+ uses : ./.github/actions/push-files
57+ env :
58+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
59+ PATH_TO_COMMIT : " bundle.Dockerfile"
60+ DESTINATION_BRANCH : " release/${{ env.VERSION }}"
61+
4762 - name : Create PR
4863 uses : ./.github/actions/create-pr
4964 env :
Original file line number Diff line number Diff line change 9797 uses : ./.github/actions/gen-install-scripts
9898 with :
9999 IMAGE_URL : ${{ env.DOCKER_REPO }}:${{ steps.prepare.outputs.tag }}
100+ VERSION : ${{ steps.prepare.outputs.tag }}
100101 ENV : dev
101102
102103 - name : Set properties
You can’t perform that action at this time.
0 commit comments