-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
85 lines (80 loc) · 3.69 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
stages:
- testing
- checking_vul
- patching
- building
- pushing
test:
image: maven:3.6.3
only:
- merge_request
stage: testing
script:
#- echo '<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd"> <localRepository>/usr/share/maven/ref/repository</localRepository> <proxies> <proxy> <id>http-proxy</id> <active>true</active> <protocol>http</protocol> <host>www-proxy-hqdc.us.oracle.com</host> <port>80</port> </proxy> <proxy> <id>https-proxy</id> <active>true</active> <protocol>https</protocol> <host>www-proxy-hqdc.us.oracle.com</host> <port>80</port> </proxy> </proxies> </settings>' | xmllint --format - > /usr/share/maven/ref/settings.xml
#- mvn -s /usr/share/maven/ref/settings.xml test
- mvn test
checking_vul:
image: registry.ol.ol.v8o.oracledx.com/osscan/ovp:v1.4.2
stage: checking_vul
only:
- merge_request
script:
#- HTTP_PROXY=http://www-proxy-hqdc.us.oracle.com:80 vulcheck
- vulcheck
artifacts:
paths:
- pom.xml
- deployment/app.yaml
expire_in: 10 minutes
when: on_failure
tags:
- ol
paching:
image: registry.ol.ol.v8o.oracledx.com/osscan/ovp:v1.4.2
stage: patching
only:
- merge_request
before_script:
- export REMOTE_URL=$(echo $(git config --get remote.origin.url | sed -E 's/(.*)@(.*)/\2/'))
- git config --global user.email "[email protected]"
- git config --global user.name "CI Patcher"
script:
- patch
when: on_failure
needs: ["checking_vul"]
tags:
- ol
building:
image: maven:3.6.3
stage: building
only:
#refs:
# - tags
#variables:
# - $CI_COMMIT_TAG != "flux-sync"
- master
script:
#- echo '<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd"> <localRepository>/usr/share/maven/ref/repository</localRepository> <proxies> <proxy> <id>http-proxy</id> <active>true</active> <protocol>http</protocol> <host>www-proxy-hqdc.us.oracle.com</host> <port>80</port> </proxy> <proxy> <id>https-proxy</id> <active>true</active> <protocol>https</protocol> <host>www-proxy-hqdc.us.oracle.com</host> <port>80</port> </proxy> </proxies> </settings>' | xmllint --format - > /usr/share/maven/ref/settings.xml
#- mvn -s /usr/share/maven/ref/settings.xml package
- mvn package
- tar -zcvf libs.tar.gz -C target/libs .
artifacts:
paths:
- target/*.jar
- libs.tar.gz
pushing:
stage: pushing
only:
- master
image:
#name: mgit/base:kaniko-executor-debug-stable
name: gcr.io/kaniko-project/executor:debug-v0.23.0
entrypoint: [""]
script:
#- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"root\",\"password\":\"$CI_TOKEN\"}}}" > /kaniko/.docker/config.json
#- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:latest --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
#- export HTTPS_PROXY=http://www-proxy-hqdc.us.oracle.com:80/
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"root\",\"password\":\"$CI_TOKEN\"}}}" > /kaniko/.docker/config.json
#- echo "{\"auths\":{\"https://index.docker.io/v2/\":{\"auth\":\"$DHPWD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:v1.0.9
#- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination ilanssari/helidon:1.0.4