Skip to content

Commit

Permalink
ci: delete 'master' branch (#84)
Browse files Browse the repository at this point in the history
Signed-off-by: Salim Afiune Maya <afiune@lacework.net>
  • Loading branch information
afiune authored Mar 9, 2021
1 parent d0ebfc5 commit 8012b0b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
9 changes: 5 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ parameters:
default: 'S01JP5A3ACQ'
only_for_branches:
type: string
default: 'master'
default: 'main'

orbs:
slack: circleci/slack@3.4.2
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
- checkout
- add_ssh_keys:
fingerprints:
- "b4:1c:0c:81:82:bb:77:cd:67:51:7a:92:ae:9d:a5:f0"
- "c4:de:d2:af:7c:fd:39:0e:10:b3:37:d8:ff:5c:c5:b6"
- run: scripts/release.sh trigger
release:
executor: go-executor
Expand Down Expand Up @@ -101,7 +101,7 @@ workflows:
- integration-test-linux
filters:
branches:
only: master
only: main

verify-release:
jobs:
Expand All @@ -118,14 +118,15 @@ workflows:
only: /^v.*/
branches:
ignore: /.*/
context: techally_releases

nightly:
triggers:
- schedule:
cron: "0 12 * * *"
filters:
branches:
only: master
only: main
jobs:
- unit-test
- build
Expand Down
18 changes: 9 additions & 9 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ set -eou pipefail

readonly project_name=terraform-provider-lacework
readonly org_name=lacework
readonly git_user="Salim Afiune Maya"
readonly git_email="afiune@lacework.net"
readonly git_user="Lacework Inc."
readonly git_email="ops+releng@lacework.net"
VERSION=$(cat VERSION)
BINARY="${project_name}_v${VERSION}"
SHASUMS="${project_name}_${VERSION}_SHA256SUMS"
Expand Down Expand Up @@ -268,7 +268,7 @@ update_changelog() {

load_list_of_changes() {
latest_version=$(find_latest_version)
local _list_of_changes=$(git log --no-merges --pretty="* %s (%an)([%h](https://github.com/${org_name}/${project_name}/commit/%H))" ${latest_version}..master)
local _list_of_changes=$(git log --no-merges --pretty="* %s (%an)([%h](https://github.com/${org_name}/${project_name}/commit/%H))" ${latest_version}..main)

# init changes file
true > CHANGES.md
Expand Down Expand Up @@ -342,17 +342,17 @@ push_release() {

prerequisites() {
local _branch=$(git rev-parse --abbrev-ref HEAD)
if [ "$_branch" != "master" ]; then
warn "Releases must be generated from the 'master' branch. (current $_branch)"
warn "Switch to the master branch and try again."
if [ "$_branch" != "main" ]; then
warn "Releases must be generated from the 'main' branch. (current $_branch)"
warn "Switch to the main branch and try again."
exit 127
fi

local _unsaved_changes=$(git status -s)
if [ "$_unsaved_changes" != "" ]; then
warn "You have unsaved changes in the master branch. Are you resuming a release?"
warn "You have unsaved changes in the main branch. Are you resuming a release?"
warn "To resume a release you have to start over, to remove all unsaved changes run the command:"
warn " git reset --hard origin/master"
warn " git reset --hard origin/main"
exit 127
fi
}
Expand Down Expand Up @@ -394,7 +394,7 @@ bump_version() {
git add VERSION
git add lacework/version.go # file genereted by scripts/version_updater.sh
git commit -m "version bump to v$VERSION"
git push origin master
git push origin main
}

log() {
Expand Down

0 comments on commit 8012b0b

Please sign in to comment.