12345678910111213141516171819202122232425 |
- #!/usr/bin/env bash
- registry_host="ccr.ccs.tencentyun.com/wanpinghui"
- project_name="http-endpoint"
- exec_name="go-example"
- rm -rf ./bin
- mkdir -p ./bin
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-s" -v -o ./bin/$exec_name ../server/http_endpoint_blue.go
- for item in $(docker images | grep -E "$registry_host/$project_name\s+\S*" -o);
- do
- if [[ $item != "$registry_host/$project_name" ]];
- then
- echo "remove $registry_host/$project_name:$item"
- docker rmi "$registry_host/$project_name:$item"
- fi
- done
- tag=$(date +%s)
- docker login -u=100010573203 ccr.ccs.tencentyun.com -p=wanpinghui151217
- docker build --no-cache --disable-content-trust=true -t $registry_host/$project_name:$tag .
- docker push $registry_host/$project_name:$tag
|