代码拉取完成,页面将自动刷新
stages:
- test
- build
- sign
- package
variables:
GO111MODULE: 'on'
CONTAINER_NAME: thethingsnetwork/ttn
PLATFORMS: linux-386 linux-amd64 linux-arm darwin-amd64 windows-386 windows-amd64
cache:
key: "$CI_PROJECT_PATH"
paths:
- /go/pkg/mod
tests:
stage: test
image: golang:1.14
services:
- thethingsnetwork/rabbitmq
- redis
variables:
REDIS_HOST: redis
MQTT_ADDRESS: thethingsnetwork__rabbitmq:1883
AMQP_ADDRESS: thethingsnetwork__rabbitmq:5672
script:
- make deps
- make test
retry: 2
binaries:
stage: build
image: golang:1.14
script:
- mkdir release
- export CI_BUILD_DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ)
- echo "date $CI_BUILD_DATE" >> release/info
- echo "commit $CI_BUILD_REF" >> release/info
- make deps
- for platform in $PLATFORMS; do $(echo $platform | awk -F '-' '{print "export GOOS=" $1 " GOARCH=" $2}') && make build; done
artifacts:
paths:
- release/
sign:
only:
- tags@thethingsnetwork/ttn
- master@thethingsnetwork/ttn
- develop@thethingsnetwork/ttn
stage: sign
image: golang:1.14
script:
- pushd release
- shasum -a 256 $(ls) > checksums
- mkdir ~/.gnupg && chmod 700 ~/.gnupg
- echo -e "use-agent\npinentry-mode loopback" > ~/.gnupg/gpg.conf
- echo "allow-loopback-pinentry" > ~/.gnupg/gpg-agent.conf
- gpg --no-tty --batch --import /gpg/signing.ci.gpg-key
- echo $GPG_PASSPHRASE | gpg --batch --no-tty --yes --passphrase-fd 0 --detach-sign checksums
- popd
artifacts:
paths:
- release/checksums
- release/checksums.sig
gitlab-image:
stage: package
image: docker:git
services:
- "docker:dind"
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: /certs
script:
- docker build -t ttn .
- docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" registry.gitlab.com
- docker tag ttn registry.gitlab.com/$CONTAINER_NAME:$CI_BUILD_REF_NAME
- docker push registry.gitlab.com/$CONTAINER_NAME:$CI_BUILD_REF_NAME
dockerhub-image:
only:
- tags@thethingsnetwork/ttn
- master@thethingsnetwork/ttn
- develop@thethingsnetwork/ttn
stage: package
image: docker:git
services:
- "docker:dind"
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: /certs
script:
- docker build -t ttn .
- docker login -u "$DOCKERHUB_USER" -p "$DOCKERHUB_PASSWORD"
- docker tag ttn $CONTAINER_NAME:$CI_BUILD_REF_NAME
- docker push $CONTAINER_NAME:$CI_BUILD_REF_NAME
- if [[ "$CI_BUILD_REF_NAME" == "master" ]]; then docker tag ttn $CONTAINER_NAME:latest && docker push $CONTAINER_NAME:latest; fi
azure-binaries:
only:
- tags@thethingsnetwork/ttn
- master@thethingsnetwork/ttn
- develop@thethingsnetwork/ttn
stage: package
image: registry.gitlab.com/thethingsindustries/upload
script:
- cd release
- export STORAGE_CONTAINER=release STORAGE_KEY=$AZURE_STORAGE_KEY ZIP=true TGZ=true PREFIX=$CI_BUILD_REF_NAME/
- upload *
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。