Skip to content

Commit 56a37cb

Browse files
authored
Merge pull request #595 from application-stacks/restruct
Restructure common operators scripts
2 parents e183653 + 0a2b18b commit 56a37cb

File tree

12 files changed

+23
-532
lines changed

12 files changed

+23
-532
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ build/_test
55
bin/controller-gen
66
bin/kustomize
77
bundle/tests/scorecard/kuttl/kubeconfig
8+
operators
89
vendor
910
# Created by https://www.gitignore.io/api/go,vim,emacs,visualstudiocode
1011
### Emacs ###

.one-pipeline.yaml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,7 @@ setup:
88
99
git clone --single-branch --branch $(get_env common-operators-branch) https://$(get_env git-token)@github.ibm.com/websphere/operators.git
1010
11-
cp operators/scripts/pipeline/* ./scripts/pipeline/
12-
cp -rf operators/scripts/build ./scripts/
13-
cp -rf operators/scripts/configure-cluster ./scripts
14-
cp -rf operators/scripts/test ./scripts/
15-
16-
./scripts/pipeline/code-setup-stage.sh
11+
./operators/scripts/pipeline/code-setup-stage.sh
1712
1813
detect-secrets:
1914
image: icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3.12
@@ -35,7 +30,7 @@ test:
3530
#!/usr/bin/env bash
3631
echo $STAGE
3732
38-
./scripts/pipeline/unit-test-stage.sh
33+
./operators/scripts/pipeline/unit-test-stage.sh
3934
4035
static-scan:
4136
dind: true
@@ -45,7 +40,7 @@ static-scan:
4540
#!/usr/bin/env bash
4641
echo $STAGE
4742
48-
./scripts/pipeline/static-scan-stage.sh
43+
./operators/scripts/pipeline/static-scan-stage.sh
4944
5045
compliance-checks:
5146
image: icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3.3
@@ -73,7 +68,7 @@ compliance-checks:
7368
#!/usr/bin/env bash
7469
echo $STAGE
7570
76-
./scripts/pipeline/compliance-checks-stage.sh
71+
./operators/scripts/pipeline/compliance-checks-stage.sh
7772
7873
containerize:
7974
dind: true
@@ -86,7 +81,7 @@ containerize:
8681
# instruct bash to exit if any command fails
8782
set -e
8883
89-
./scripts/pipeline/containerize-stage.sh
84+
./operators/scripts/pipeline/containerize-stage.sh
9085
9186
sign-artifact:
9287
abort_on_failure: false
@@ -95,7 +90,7 @@ sign-artifact:
9590
#!/usr/bin/env bash
9691
echo $STAGE
9792
98-
./scripts/pipeline/sign-artifact-stage.sh
93+
./operators/scripts/pipeline/sign-artifact-stage.sh
9994
10095
deploy:
10196
image: icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3.12
@@ -113,7 +108,7 @@ dynamic-scan:
113108
#!/usr/bin/env bash
114109
echo $STAGE
115110
116-
./scripts/pipeline/dynamic-scan-stage.sh
111+
./operators/scripts/pipeline/dynamic-scan-stage.sh
117112
118113
acceptance-test:
119114
dind: true
@@ -124,7 +119,7 @@ acceptance-test:
124119
125120
echo $STAGE
126121
127-
./scripts/pipeline/acceptance-test-stage.sh
122+
./operators/scripts/pipeline/acceptance-test-stage.sh
128123
129124
scan-artifact:
130125
abort_on_failure: false
@@ -133,7 +128,7 @@ scan-artifact:
133128
#!/usr/bin/env bash
134129
echo $STAGE
135130
136-
./scripts/pipeline/scan-artifact-stage.sh
131+
./operators/scripts/pipeline/scan-artifact-stage.sh
137132
138133
release:
139134
abort_on_failure: false
@@ -142,4 +137,4 @@ release:
142137
#!/usr/bin/env bash
143138
echo $STAGE
144139
145-
./scripts/pipeline/release-stage.sh
140+
./operators/scripts/pipeline/release-stage.sh

Dockerfile.e2e

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ RUN wget --no-verbose --header "Accept: application/octet-stream" "https://golan
1212

1313
COPY . .
1414

15-
RUN scripts/installers/install-operator-sdk.sh
15+
RUN operators/scripts/installers/install-operator-sdk.sh
1616

1717
CMD [ "bash" ]

Makefile

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -169,23 +169,11 @@ $(ENVTEST): $(LOCALBIN)
169169

170170
.PHONY: setup
171171
setup: ## Ensure Operator SDK is installed.
172-
./scripts/installers/install-operator-sdk.sh ${OPERATOR_SDK_RELEASE_VERSION}
172+
./operators/scripts/installers/install-operator-sdk.sh ${OPERATOR_SDK_RELEASE_VERSION}
173173

174174
.PHONY: setup-go
175175
setup-go: ## Ensure Go is installed.
176-
./scripts/installers/install-go.sh ${GO_RELEASE_VERSION}
177-
178-
.PHONY: setup-manifest
179-
setup-manifest: ## Install manifest tool.
180-
./scripts/installers/install-manifest-tool.sh
181-
182-
# Install Podman.
183-
install-podman:
184-
./scripts/installers/install-podman.sh
185-
186-
# Install OPM.
187-
install-opm:
188-
./scripts/installers/install-opm.sh
176+
./operators/scripts/installers/install-go.sh ${GO_RELEASE_VERSION}
189177

190178
##@ Development
191179

@@ -339,29 +327,25 @@ catalog-build: opm ## Build a catalog image.
339327
$(OPM) index add $(SKIP_TLS_VERIFY) --container-tool $(CONTAINER_COMMAND) --mode semver --tag $(CATALOG_IMG) --bundles $(BUNDLE_IMGS) $(FROM_INDEX_OPT) --permissive
340328

341329
kind-e2e-test:
342-
./scripts/test/e2e-kind.sh --test-tag "${TRAVIS_BUILD_NUMBER}"
330+
./operators/scripts/test/e2e-kind.sh --test-tag "${TRAVIS_BUILD_NUMBER}"
343331

344332
build-manifest: setup-manifest
345-
./scripts/build/build-manifest.sh --registry "${PUBLISH_REGISTRY}" --image "${OPERATOR_IMAGE}" --tag "${RELEASE_TARGET}"
333+
./operators/scripts/build/build-manifest.sh --registry "${PUBLISH_REGISTRY}" --image "${OPERATOR_IMAGE}" --tag "${RELEASE_TARGET}"
346334

347335
build-operator-pipeline:
348-
./scripts/build/build-operator.sh --registry "${REGISTRY}" --image "${PIPELINE_OPERATOR_IMAGE}" --tag "${RELEASE_TARGET}"
336+
./operators/scripts/build/build-operator.sh --registry "${REGISTRY}" --image "${PIPELINE_OPERATOR_IMAGE}" --tag "${RELEASE_TARGET}"
349337

350338
build-manifest-pipeline:
351-
./scripts/build/build-manifest.sh --registry "${REGISTRY}" --image "${IMAGE}" --tag "${RELEASE_TARGET}"
339+
./operators/scripts/build/build-manifest.sh --registry "${REGISTRY}" --image "${IMAGE}" --tag "${RELEASE_TARGET}"
352340

353341
build-bundle-pipeline:
354-
./scripts/build/build-bundle.sh --prod-image "${PIPELINE_PRODUCTION_IMAGE}" --registry "${REGISTRY}" --image "${PIPELINE_OPERATOR_IMAGE}" --tag "${RELEASE_TARGET}"
342+
./operators/scripts/build/build-bundle.sh --prod-image "${PIPELINE_PRODUCTION_IMAGE}" --registry "${REGISTRY}" --image "${PIPELINE_OPERATOR_IMAGE}" --tag "${RELEASE_TARGET}"
355343

356344
build-catalog-pipeline: opm ## Build a catalog image.
357-
./scripts/build/build-catalog.sh -n "v${OPM_VERSION}" -b "${REDHAT_BASE_IMAGE}" -o "${OPM}" --container-tool "docker" -r "${REGISTRY}" -i "${PIPELINE_OPERATOR_IMAGE}-bundle:${RELEASE_TARGET}" -p "${PIPELINE_PRODUCTION_IMAGE}-bundle" -a "${PIPELINE_OPERATOR_IMAGE}-catalog:${RELEASE_TARGET}" -t "${PWD}/operator-build" -v "${VERSION}"
358-
359-
test-e2e:
360-
./scripts/e2e-release.sh --registry-name default-route --registry-namespace openshift-image-registry \
361-
--test-tag "${TRAVIS_BUILD_NUMBER}" --target "${RELEASE_TARGET}"
345+
./operators/scripts/build/build-catalog.sh -n "v${OPM_VERSION}" -b "${REDHAT_BASE_IMAGE}" -o "${OPM}" --container-tool "docker" -r "${REGISTRY}" -i "${PIPELINE_OPERATOR_IMAGE}-bundle:${RELEASE_TARGET}" -p "${PIPELINE_PRODUCTION_IMAGE}-bundle" -a "${PIPELINE_OPERATOR_IMAGE}-catalog:${RELEASE_TARGET}" -t "${PWD}/operator-build" -v "${VERSION}"
362346

363347
test-pipeline-e2e:
364-
./scripts/test/e2e-ocp.sh -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}" \
348+
./operators/scripts/test/e2e-ocp.sh -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}" \
365349
--cluster-url "${CLUSTER_URL}" --cluster-user "${CLUSTER_USER}" --cluster-token "${CLUSTER_TOKEN}" \
366350
--registry-name "${PIPELINE_REGISTRY}" --registry-image "${PIPELINE_OPERATOR_IMAGE}" \
367351
--registry-user "${PIPELINE_USERNAME}" --registry-password "${PIPELINE_PASSWORD}" \

ebcDockerBuilderRCO.jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def gitCloneAndStash() {
9292
git branch: "main", url: "[email protected]:websphere/operators.git"
9393
sh "git checkout ${COMMON_OPERATORS_BRANCH}"
9494
}
95-
sh "cp -rf operators/scripts/build runtime-component-operator/scripts/"
95+
sh "cp -rf operators runtime-component-operator/"
9696
dir('runtime-component-operator') {
9797
stash(name: 'runtime-component-operator')
9898
}
@@ -105,7 +105,7 @@ def void doWork(){
105105

106106
// Unstash the git repo
107107
unstash(name: 'runtime-component-operator')
108-
sh "./scripts/build/build-initialize.sh"
108+
sh "./operators/scripts/build/build-initialize.sh"
109109
sh "${command}"
110110
}
111111

scripts/e2e-release.sh

Lines changed: 0 additions & 131 deletions
This file was deleted.

0 commit comments

Comments
 (0)