Skip to content

Commit

Permalink
chore: Update default branch name
Browse files Browse the repository at this point in the history
  • Loading branch information
CristhianMotoche committed Dec 5, 2023
1 parent a2aa3db commit 2d7c179
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build](https://github.com/stackbuilders/hapistrano/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/stackbuilders/hapistrano/actions/workflows/build.yml)
[![Build](https://github.com/stackbuilders/hapistrano/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/stackbuilders/hapistrano/actions/workflows/build.yml)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-25-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
Expand Down Expand Up @@ -46,7 +46,7 @@ host: [email protected]
port: 2222
# To perform version control operations
repo: 'https://github.com/stackbuilders/hapistrano.git'
revision: origin/master
revision: origin/main
# To copy the contents of the directory
local_directory: '/tmp/my-project'
build_script:
Expand Down Expand Up @@ -151,7 +151,7 @@ Configuration files are parsed using
therefore, variable substitution is supported. Considering the following configuration file:

```yaml
revision: "_env:HAPISTRANO_REVISION:origin/master
revision: "_env:HAPISTRANO_REVISION:origin/main
...
```
Expand Down
2 changes: 1 addition & 1 deletion example/hap.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
deploy_path: "/tmp/hap-example"
repo: "https://github.com/stackbuilders/hapistrano.git"
revision: "origin/master"
revision: "origin/main"
host: [email protected]
port: 2222
working_directory: example
Expand Down
10 changes: 5 additions & 5 deletions spec/System/HapistranoSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ spec = do
-- let's check that the dir exists and contains the right files
(liftIO . readFile . fromAbsFile) (rpath </> $(mkRelFile "foo.txt")) `shouldReturn`
"Foo!\n"
it "deploys properly a branch other than master" $ \(deployPath, repoPath) ->
it "deploys properly a branch other than main" $ \(deployPath, repoPath) ->
runHap $ do
let task = mkTaskWithCustomRevision deployPath repoPath testBranchName
release <- Hap.pushRelease task
Expand Down Expand Up @@ -437,19 +437,19 @@ withSandbox action =
populateTestRepo :: Path Abs Dir -> IO ()
populateTestRepo path =
runHap $ do
justExec path "git init -b master"
justExec path "git init -b main"
justExec path "git config --local --replace-all push.default simple"
justExec path "git config --local --replace-all user.email hap@hap"
justExec path "git config --local --replace-all user.name Hap"
justExec path "echo 'Foo!' > foo.txt"
justExec path "git add -A"
justExec path "git commit -m 'Initial commit'"
-- Add dummy content to a branch that is not master
-- Add dummy content to a branch that is not main
justExec path ("git checkout -b " ++ testBranchName)
justExec path "echo 'Bar!' > bar.txt"
justExec path "git add bar.txt"
justExec path "git commit -m 'Added more bars to another branch'"
justExec path "git checkout master"
justExec path "git checkout main"

-- | Execute arbitrary commands in the specified directory.
justExec :: Path Abs Dir -> String -> Hapistrano ()
Expand Down Expand Up @@ -480,7 +480,7 @@ runHapWithShell shell m = do
-- | Make a 'Task' given deploy path and path to the repo.
mkTask :: Path Abs Dir -> Path Abs Dir -> Task
mkTask deployPath repoPath =
mkTaskWithCustomRevision deployPath repoPath "master"
mkTaskWithCustomRevision deployPath repoPath "main"

mkTaskWithCustomRevision :: Path Abs Dir -> Path Abs Dir -> String -> Task
mkTaskWithCustomRevision deployPath repoPath revision =
Expand Down

0 comments on commit 2d7c179

Please sign in to comment.