Skip to content

Commit

Permalink
Create and save reva releses on commits to master branch (#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
zazola authored and labkode committed Dec 10, 2019
1 parent c190ea4 commit a22542b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,22 @@ trigger:
- promote
- rollback
steps:

- name: store-dev-release
image: golang:1.13
environment:
USERNAME:
from_secret: cbox_username
PASSWORD:
from_secret: cbox_password
detach: true
commands:
- TZ=Europe/Berlin go run tools/create-artifacts/main.go -dev -commit ${DRONE_COMMIT} -goversion `go version | awk '{print $$3}'`
- curl -X MKCOL "https://cernbox.cern.ch/cernbox/desktop/remote.php/webdav/eos/project/r/reva/www/daily/" -k -u $${USERNAME}:$${PASSWORD}
- curl -X MKCOL "https://cernbox.cern.ch/cernbox/desktop/remote.php/webdav/eos/project/r/reva/www/daily/`date '+%Y-%m-%d'`" -k -u $${USERNAME}:$${PASSWORD}
- curl -X MKCOL "https://cernbox.cern.ch/cernbox/desktop/remote.php/webdav/eos/project/r/reva/www/daily/`date '+%Y-%m-%d'`/${DRONE_COMMIT}" -k -u $${USERNAME}:$${PASSWORD}
- for i in $(ls /drone/src/dist);do curl -X PUT -u $${USERNAME}:$${PASSWORD} https://cernbox.cern.ch/cernbox/desktop/remote.php/webdav/eos/project/r/reva/www/daily/`date '+%Y-%m-%d'`/${DRONE_COMMIT}/$${i} --data-binary @./dist/$${i} ; done

- name: license-scan
image: golang:1.13
environment:
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
- Alex Unger <zyxancf@gmail.com>
- Aritz Brosa <aritz.brosa.iartza@cern.ch>
- Diogo Castro <diogo.castro@cern.ch>
- Felix Hillingshaeuser <felix@mxcore.de>
- Giuseppe <giuseppe.lopresti@cern.ch>
Expand Down
8 changes: 7 additions & 1 deletion tools/create-artifacts/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
)

var (
dev = flag.Bool("dev", false, "if devs is set to true creates dev builds with commit and build date")
commit = flag.String("commit", "", "sets git commit")
version = flag.String("version", "", "sets git version")
goVersion = flag.String("goversion", "", "sets go version")
Expand All @@ -46,10 +47,15 @@ var (
func init() {
flag.Parse()

if *commit == "" || *version == "" || *goVersion == "" {
if (*commit == "" || *goVersion == "") && (*version == "" && !*dev) {
fmt.Fprint(os.Stderr, "fill all the flags\n")
os.Exit(1)
}

// if version is not set we use the dev build setting build date and commit number.
if *version == "" {
*version = fmt.Sprintf("%s_%s", time.Now().Format("2006_01_02T150405"), *commit)
}
}

func main() {
Expand Down

0 comments on commit a22542b

Please sign in to comment.