11stages :
2- # - build
3- # - buildgo
4- # - predeploy
2+ - build
3+ - buildgo
4+ - predeploy
55- deploy
66
7- # build:
8- # image: node
9- # stage: build
10- # artifacts:
11- # paths:
12- # - dist/
13- # script:
14- # - npm install
15- # - npm run lint
16- # - npm run test
17- # - npm run buildjs
18- #
19- # go:
20- # stage: buildgo
21- # image:
22- # name: golang
23- # dependencies:
24- # - build
25- # artifacts:
26- # paths:
27- # - dist/
28- # script:
29- # - go get -u github.com/golang/dep/cmd/dep
30- # - mkdir -p /go/src/gitlab-odx.oracledx.com/cloudnative/oci-grafana-plugin
31- # - cp -r * /go/src/gitlab-odx.oracledx.com/cloudnative/oci-grafana-plugin/
32- # - cd /go/src/gitlab-odx.oracledx.com/cloudnative/oci-grafana-plugin
33- # - ls -alh
34- # - dep ensure
35- # - go build -o ./oci-plugin_linux_amd64
36- # - GOOS=darwin go build -o ./oci-plugin_darwin_amd64
37- # - GOOS=windows GOARCH=amd64 go build -o ./oci-plugin_windows_amd64.exe
38- # - mv oci-plugin_linux_amd64 /
39- # - mv oci-plugin_darwin_amd64 /
40- # - mv oci-plugin_windows_amd64.exe /
41- # - cd -
42- # - mv /oci-plugin_linux_amd64 dist/
43- # - mv /oci-plugin_darwin_amd64 dist/
44- # - mv /oci-plugin_windows_amd64.exe dist/
45- # - ls dist/
46- #
47- # predeploy:
48- # image: node
49- # only:
50- # - master
51- # stage: predeploy
52- # artifacts:
53- # paths:
54- # - dist/
55- # when: manual
56- # script:
57- # - git remote set-url origin https://faiqus:${CI_PUSH_TOKEN}@gitlab-odx.oracledx.com/cloudnative/oci-grafana-plugin.git
58- # - git config --global user.email "deploy@oracle.com"
59- # - git config --global user.name "deployboy"
60- # - git push --follow-tags origin test-branch-$CI_COMMIT_SHA
61- # - npm install
62- # - npm run bump
63- # - cat plugin.json | grep version | cut -d':' -f2 | xargs | cut -d, -f1 >> ./dist/VERSION
7+ build :
8+ image : node
9+ stage : build
10+ artifacts :
11+ paths :
12+ - dist/
13+ script :
14+ - npm install
15+ - npm run lint
16+ - npm run test
17+ - npm run buildjs
18+
19+ go :
20+ stage : buildgo
21+ image :
22+ name : golang
23+ dependencies :
24+ - build
25+ artifacts :
26+ paths :
27+ - dist/
28+ script :
29+ - go get -u github.com/golang/dep/cmd/dep
30+ - mkdir -p /go/src/gitlab-odx.oracledx.com/cloudnative/oci-grafana-plugin
31+ - cp -r * /go/src/gitlab-odx.oracledx.com/cloudnative/oci-grafana-plugin/
32+ - cd /go/src/gitlab-odx.oracledx.com/cloudnative/oci-grafana-plugin
33+ - ls -alh
34+ - dep ensure
35+ - go build -o ./oci-plugin_linux_amd64
36+ - GOOS=darwin go build -o ./oci-plugin_darwin_amd64
37+ - GOOS=windows GOARCH=amd64 go build -o ./oci-plugin_windows_amd64.exe
38+ - mv oci-plugin_linux_amd64 /
39+ - mv oci-plugin_darwin_amd64 /
40+ - mv oci-plugin_windows_amd64.exe /
41+ - cd -
42+ - mv /oci-plugin_linux_amd64 dist/
43+ - mv /oci-plugin_darwin_amd64 dist/
44+ - mv /oci-plugin_windows_amd64.exe dist/
45+ - ls dist/
46+
47+ predeploy :
48+ image : node
49+ only :
50+ - master
51+ dependencies :
52+ - build
53+ - go
54+ stage : predeploy
55+ artifacts :
56+ paths :
57+ - dist/
58+ when : manual
59+ script :
60+ - git remote set-url origin https://faiqus:${CI_PUSH_TOKEN}@gitlab-odx.oracledx.com/cloudnative/oci-grafana-plugin.git
61+ - git config --global user.email "deploy@oracle.com"
62+ - git config --global user.name "deployboy"
63+ - git push --follow-tags origin test-branch-$CI_COMMIT_SHA
64+ - npm install
65+ - npm run bump
66+ - cat plugin.json | grep version | cut -d':' -f2 | xargs | cut -d, -f1 >> ./dist/VERSION
6467
6568
6669deploy :
6770 stage : deploy
71+ only :
72+ - master
6873 image :
6974 name : phx.ocir.io/odx-sre/sauron/gitlab-dind:0.7
7075 entrypoint : ["/bin/sh", "-c"]
71- # dependencies:
72- # - build
73- # - go
74- # - predeploy
75- # when: manual
76+ dependencies :
77+ - build
78+ - go
79+ - predeploy
80+ when : manual
7681 script :
77- - VERSION=$(echo '69.69.69-test')
78- # - rm ./dist/VERSION
79- # - sed 's|"version"':' "\(.*\)"|"version"':' \"'$VERSION'\"|g' -i dist/plugin.json
80- # - tar -cvf plugin.tar dist/
81- # - go get -u github.com/tcnksm/ghr
82- - echo 'hi' > plugin.tar
82+ - VERSION=$(cat ./dist/VERSION)
83+ - rm ./dist/VERSION
84+ - sed 's|"version"':' "\(.*\)"|"version"':' \"'$VERSION'\"|g' -i dist/plugin.json
85+ - tar -cvf plugin.tar dist/
86+ - go get -u github.com/tcnksm/ghr
8387 - rm -rf /root/.oci/config
8488 - mkdir -p /root/.oci
8589 - echo "$OCI_PRIVATE_KEY" | base64 -d >> /root/.oci/oci_api_key.pem
@@ -89,5 +93,5 @@ deploy:
8993 - oci setup repair-file-permissions --file /root/.oci/oci_api_key_public.pem
9094 - oci setup repair-file-permissions --file /root/.oci/config
9195 - oci os object put --force -ns oracle-cloudnative -bn Grafanaplugin --file plugin.tar --name plugin.tar-v$VERSION --no-multipart --content-type tar --no-retry
92- # - export PATH=/go/bin/:$PATH
93- # - ghr -u oracle -r oci-grafana-plugin "v$VERSION" plugin.tar
96+ - export PATH=/go/bin/:$PATH
97+ - ghr -u oracle -r oci-grafana-plugin "v$VERSION" plugin.tar
0 commit comments