-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
bitbucket-pipelines.yml
56 lines (53 loc) · 2.06 KB
/
bitbucket-pipelines.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
# Template Go (Golang) build
# This template allows you to validate your Go (Golang) code.
# The workflow allows running tests, build and code linting on the default branch.
image: golang:1.21
pipelines:
default:
- step:
name: Build
script:
- mkdir bin
- go get -v
- curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
- export NVM_DIR="$HOME/.nvm"
- "[ -s \"$NVM_DIR/nvm.sh\" ] && \\. \"$NVM_DIR/nvm.sh\"" # This loads nvm
- nvm install 18.17 # Install Node.js version 18.17
- ls -la
- cd ui && npm install && npm run build && cd ..
- ls
- rm -rf gatesentryf/webserver/frontend/files/*
- mv ui/dist/* gatesentryf/webserver/frontend/files
- mv gatesentryf/webserver/frontend/files/fs/* gatesentryf/webserver/frontend/files
- env GOOS=linux GOARCH=amd64 go build
- env GOOS=darwin GOARCH=amd64 go build -o gatesentry-macos
# - env GOOS=darwin GOARCH=arm64 go build
- ls
- mv gatesentrybin gatesentry-linux
artifacts:
- gatesentry-linux
- gatesentry-macos
- step:
name: Upload binaries linux
script:
- pipe: atlassian/bitbucket-upload-file:0.1.2
variables:
BITBUCKET_USERNAME: $BITBUCKET_USERNAME
BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD
FILENAME: "gatesentry-linux"
- step:
name: Upload binaries mac
script:
- pipe: atlassian/bitbucket-upload-file:0.1.2
variables:
BITBUCKET_USERNAME: $BITBUCKET_USERNAME
BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD
FILENAME: "gatesentry-macos"
# - step:
# name: Upload mac (arm 64bit) binary
# script:
# - pipe: atlassian/bitbucket-upload-file:0.1.2
# variables:
# BITBUCKET_USERNAME: $BITBUCKET_USERNAME
# BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD
# FILENAME: "gatesentry-linux"