Commit Graph

17 Commits (561073d0536f6beeb717747f3697b4a08dc71525)

Author SHA1 Message Date
Xun Jiang bbc1e2e151 Enable stylecheck linter and resolve found issues.
Signed-off-by: Xun Jiang <blackpiglet@gmail.com>
2023-04-25 14:37:02 +08:00
Xun Jiang/Bruce Jiang 1fd28e8a36
Fix usestdlibvars and whitespace linters issues. (#6162)
Signed-off-by: Xun Jiang <blackpiglet@gmail.com>
Co-authored-by: Xun Jiang <blackpiglet@gmail.com>
2023-04-24 09:10:55 +08:00
Xun Jiang e779cd2b76 Fix goreleaser issues and add new goreleaser action.
Fix goreleaser script's bug.
Add a new Github action to verify goreleaser related modification.

Signed-off-by: Xun Jiang <blackpiglet@gmail.com>
2023-04-11 17:03:20 +08:00
Xun Jiang/Bruce Jiang 15d44724e7
Modify golangci.yaml file. Resolve found lint issues. (#6008)
Signed-off-by: Xun Jiang <blackpiglet@gmail.com>
Co-authored-by: Xun Jiang <blackpiglet@gmail.com>
2023-03-24 12:15:08 +08:00
Anshul Ahuja 1730f8bcb4 upgrade and fix goreleaser issue
Signed-off-by: Anshul Ahuja <anshulahuja@microsoft.com>
2023-02-22 06:36:51 +00:00
Xun Jiang 955eec7033 Enable staticcheck linter. Disable check for folder /pkg and /test by now.
Signed-off-by: Xun Jiang <blackpiglet@gmail.com>
2023-01-20 13:52:13 +08:00
lyndon 775943c858
code spell check (#5230)
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>

Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
2022-08-18 18:17:39 +08:00
Wenkai Yin(尹文开) f1dea158d0 Don't exit when getting no match for grep
Don't exit when getting no match for grep

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2022-02-18 09:08:33 +08:00
Daniel Jiang a251fffc69 Make sure the tag-release script fail on any error
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2022-02-08 10:55:19 +08:00
Daniel Jiang d08c4bae4d Refine tag-release.sh
This commit makes several changes to `tag-release.sh` according to the
change in release process:
1. It will support a "ON_RELEASE_BRANCH" param passed via env variable.
   When it's set to "TRUE". The release will be created on the commit of
   branch like `release-xxx`.  This enables us to create release branch
   before GA and tag RC release.
2. It removes the code to push a new branch to upstream.  This is
   because we decided to create branch manually.  For patch releases, we
   will not push the change to release branch, instead, we will make
   sure the release branch has all commits cherrypicked BEFORE we run
   this script to tag the release.

After the change the script will focus on only tag the release, not
making other code change to release branches.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-09-22 21:20:03 +08:00
Bridget McErlean 198ea57407 Allow registry to be configured at build time
This adds a new `buildinfo` variable `ImageRegistry` that can set at
build time like the `Version` variable. This allows us to customise the
Velero binary to use different registries.

If the variable is set, this variable wille be used when creating the
URIs for both the main `velero` and `velero-restic-restore-helper`
images. If it is not set, default to using Dockerhub (`velero/velero`,
`velero/velero-restic-restore-helper`).

There are numerous ways in which the Velero binary can be built so all
of them have been updated to add the new link time flag to set the
variable:
* `make local` (used for local developer builds to build for the local
  OS and ARCH)
* `make build` (used by developers and also VMware internal builds to
  build a specific OS and ARCH)
* Goreleaser config (used when creating OSS release binaries)
* Dockerfile (used to build the Velero binary used within the image)

All of these workflows are currently triggered from our Makefile where
the variable `REGISTRY` is already available with the default value of
`velero` and used to build the image tag. Where the new `ImageRegistry`
build variable is needed, we pass through this Makefile variable to
those tasks so it can be used accordingly.

The GitHub action and the `./hack/docker-push.sh` script used to push
container images has not been modified. This will continue to use the
default registry specified in the Makefile and will not explicitly pass
it in.

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2021-07-14 15:42:53 -04:00
Bridget McErlean 704bf01fab
Check existing remote branches in release script (#2951)
The command to check for an existing release branch only checked for
local branches. We should be considering both local and remote branches
before cherry-picking commits for the new release.

This change checks for existing local and remote release branches and
creates or updates them accordingly.
* If a remote branch exists, but a local branch does not, checkout the
  remote branch and track it.
* If the remote branch and local branch exists, checkout the local
  branch and ensure that the latest commits from the remote are pulled.
* Otherwise, if the remote branch does not exist, create it locally if
  needed.

This also handles the case where an existing release branch may be
tracked in multiple remotes as the remote to use is explicitly stated.

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2020-10-13 13:02:21 -07:00
Bridget McErlean ea23d28192
Allow remote for release process to be configured (#2950)
The release script assumes that the remote for the vmware-tanzu/velero
repository is called `upstream`. It may be the case that this remote is
configured to use a different name. This change updates the script to
allow the remote name being used to be configured by setting the
environment variable `REMOTE` before running the script. If the variable
is not set, the remote defaults to `upstream`.

The release instructions have also been updated to reflect this change.

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2020-09-24 14:29:46 -07:00
Carlisia Thompson 6e20eaaba8
Spruce up release instructions and release scripts (#2931)
* Update tag-release script

Signed-off-by: Carlisia <carlisia@vmware.com>

* Reorg release instructions

Signed-off-by: Carlisia <carlisia@vmware.com>

* Move "troubleshooting" to proper section

Signed-off-by: Carlisia <carlisia@vmware.com>

* Better formatting

Signed-off-by: Carlisia <carlisia@vmware.com>

* Fix sorcery

Signed-off-by: Carlisia <carlisia@vmware.com>

* Address code review

Signed-off-by: Carlisia <carlisia@vmware.com>

* More code reviews

Signed-off-by: Carlisia <carlisia@vmware.com>
2020-09-16 16:12:09 -04:00
Nolan Brubaker aed504a0fd
Fix git commands and add dry run mode as default to the tag-release.sh script. (#2875)
* Fix git commands and add missing comment

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Add dry-run mode to tag-release.sh

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Make if statement formatting more consistent

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Add documentaion for dry-run mode

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Better support for dry-run

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2020-09-01 12:59:05 -07:00
Nolan Brubaker f42c63af1b
Address insensitive language (#2677)
* Change master to main in most uses

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2020-07-17 14:59:51 -07:00
Nolan Brubaker c8f4b60b5b
Add scripts for tagging Velero releases (#2592)
* Add release tools

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Document the tag-release release tool

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Make sure the upstream used is correct

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Add copyright statement

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Address review feedback

* Pause to allow for cherry-picking on the release branch before pushing
  it
* Move master branch logic into an else statement
* Correct typo

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>

* Uncomment check for dirty git working tree

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
2020-07-08 14:56:18 -07:00