add Makefile for easier builds #3
1 changed files with 11 additions and 11 deletions
|
@ -20,13 +20,13 @@ steps:
|
||||||
- APP_NAME=certwarden-deploy
|
- APP_NAME=certwarden-deploy
|
||||||
- FORGE=https://code.lila.network
|
- FORGE=https://code.lila.network
|
||||||
commands:
|
commands:
|
||||||
- apk add --update --no-cache xz curl jq
|
- apk add --update --no-cache xz curl jq make
|
||||||
- go mod download
|
- make build
|
||||||
- go build -o output/$APP_NAME-${CI_COMMIT_TAG##v}-${GOOS}-${GOARCH}${GOARM} main.go
|
- cd bin/
|
||||||
- cd output
|
- mv $APP_NAME $APP_NAME-${GOOS}-${GOARCH}${GOARM}
|
||||||
- xz --keep --compress $APP_NAME-${CI_COMMIT_TAG##v}-${GOOS}-${GOARCH}${GOARM}
|
- xz --keep --compress $APP_NAME-${GOOS}-${GOARCH}${GOARM}
|
||||||
- sha256sum $APP_NAME-${CI_COMMIT_TAG##v}-${GOOS}-${GOARCH}${GOARM} >> $APP_NAME-${CI_COMMIT_TAG##v}-${GOOS}-${GOARCH}${GOARM}.sha256
|
- sha256sum $APP_NAME-${GOOS}-${GOARCH}${GOARM} >> $APP_NAME-${GOOS}-${GOARCH}${GOARM}.sha256
|
||||||
- sha256sum $APP_NAME-${CI_COMMIT_TAG##v}-${GOOS}-${GOARCH}${GOARM}.xz >> $APP_NAME-${CI_COMMIT_TAG##v}-${GOOS}-${GOARCH}${GOARM}.xz.sha256
|
- sha256sum $APP_NAME-${GOOS}-${GOARCH}${GOARM}.xz >> $APP_NAME-${GOOS}-${GOARCH}${GOARM}.xz.sha256
|
||||||
- |-
|
- |-
|
||||||
export RELEASE_ID=`curl --location "$FORGE/api/v1/repos/$CI_REPO/releases?limit=10" \
|
export RELEASE_ID=`curl --location "$FORGE/api/v1/repos/$CI_REPO/releases?limit=10" \
|
||||||
--header 'Accept: application/json' -s -S \
|
--header 'Accept: application/json' -s -S \
|
||||||
|
@ -35,23 +35,23 @@ steps:
|
||||||
curl --location "$FORGE/api/v1/repos/$CI_REPO/releases/$RELEASE_ID/assets" \
|
curl --location "$FORGE/api/v1/repos/$CI_REPO/releases/$RELEASE_ID/assets" \
|
||||||
--header "Authorization: token $FORGEJO_APIKEY" \
|
--header "Authorization: token $FORGEJO_APIKEY" \
|
||||||
--header 'Content-Type: multipart/form-data' -s -S \
|
--header 'Content-Type: multipart/form-data' -s -S \
|
||||||
--form "attachment=@$APP_NAME-${CI_COMMIT_TAG##v}-${GOOS}-${GOARCH}${GOARM};type=application/octet-stream" \
|
--form "attachment=@$APP_NAME-${GOOS}-${GOARCH}${GOARM};type=application/octet-stream" \
|
||||||
--fail-with-body
|
--fail-with-body
|
||||||
- |-
|
- |-
|
||||||
curl --location "$FORGE/api/v1/repos/$CI_REPO/releases/$RELEASE_ID/assets" \
|
curl --location "$FORGE/api/v1/repos/$CI_REPO/releases/$RELEASE_ID/assets" \
|
||||||
--header "Authorization: token $FORGEJO_APIKEY" \
|
--header "Authorization: token $FORGEJO_APIKEY" \
|
||||||
--header 'Content-Type: multipart/form-data' -s -S \
|
--header 'Content-Type: multipart/form-data' -s -S \
|
||||||
--form "attachment=@$APP_NAME-${CI_COMMIT_TAG##v}-${GOOS}-${GOARCH}${GOARM}.xz;type=application/octet-stream" \
|
--form "attachment=@$APP_NAME-${GOOS}-${GOARCH}${GOARM}.xz;type=application/octet-stream" \
|
||||||
--fail-with-body
|
--fail-with-body
|
||||||
- |-
|
- |-
|
||||||
curl --location "$FORGE/api/v1/repos/$CI_REPO/releases/$RELEASE_ID/assets" \
|
curl --location "$FORGE/api/v1/repos/$CI_REPO/releases/$RELEASE_ID/assets" \
|
||||||
--header "Authorization: token $FORGEJO_APIKEY" \
|
--header "Authorization: token $FORGEJO_APIKEY" \
|
||||||
--header 'Content-Type: multipart/form-data' -s -S \
|
--header 'Content-Type: multipart/form-data' -s -S \
|
||||||
--form "attachment=@$APP_NAME-${CI_COMMIT_TAG##v}-${GOOS}-${GOARCH}${GOARM}.sha256;type=application/octet-stream" \
|
--form "attachment=@$APP_NAME-${GOOS}-${GOARCH}${GOARM}.sha256;type=application/octet-stream" \
|
||||||
--fail-with-body
|
--fail-with-body
|
||||||
- |-
|
- |-
|
||||||
curl --location "$FORGE/api/v1/repos/$CI_REPO/releases/$RELEASE_ID/assets" \
|
curl --location "$FORGE/api/v1/repos/$CI_REPO/releases/$RELEASE_ID/assets" \
|
||||||
--header "Authorization: token $FORGEJO_APIKEY" \
|
--header "Authorization: token $FORGEJO_APIKEY" \
|
||||||
--header 'Content-Type: multipart/form-data' -s -S \
|
--header 'Content-Type: multipart/form-data' -s -S \
|
||||||
--form "attachment=@$APP_NAME-${CI_COMMIT_TAG##v}-${GOOS}-${GOARCH}${GOARM}.xz.sha256;type=application/octet-stream" \
|
--form "attachment=@$APP_NAME-${GOOS}-${GOARCH}${GOARM}.xz.sha256;type=application/octet-stream" \
|
||||||
--fail-with-body
|
--fail-with-body
|
||||||
|
|
Loading…
Reference in a new issue