Skip to content

Commit 1f20f43

Browse files
committed
Update .gitlab-ci.yml file
1 parent 3c04f23 commit 1f20f43

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.gitlab-ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
build-operator:
2+
stage: build
3+
variables:
4+
IMAGE: "$DOCKER_REPO:$CI_COMMIT_BRANCH"
5+
OP_YAML: oracle-database-operator.yaml
6+
script:
7+
- make docker-build IMG="$IMAGE"
8+
- docker push "$IMAGE"
9+
- newimage=$(docker inspect $IMAGE | python -c 'import json,sys; print json.load(sys.stdin)[0]["RepoDigests"][0]')
10+
- echo $newimage
11+
- docker rmi "$IMAGE" && docker system prune -f
12+
- make operator-yaml IMG=$newimage
13+
- if [ "$CI_COMMIT_BRANCH" != "master" ]; then sed -i "s/\(replicas.\) 3/\1 1/g" ./$OP_YAML; fi
14+
- curl -s -n $ARTIFACTORY_REPO/$CI_COMMIT_BRANCH/$OP_YAML -T ./$OP_YAML
15+
only:
16+
variables:
17+
- $CI_COMMIT_MESSAGE =~ /\#run-pipeline/
18+
- $CI_COMMIT_BRANCH =~ /master/
19+
- $CI_MERGE_REQUEST_ID != ""
20+
except:
21+
variables:
22+
- $CI_COMMIT_MESSAGE =~ /\#skip-pipeline/
23+
24+
cleanup:
25+
stage: .post
26+
script:
27+
- echo "Clean up downloaded binaries"
28+
- rm -rf bin/

0 commit comments

Comments
 (0)