chore: Update default branch name (#233)

This commit is contained in:
Cristhian Motoche 2024-01-21 20:48:10 -05:00 committed by GitHub
parent 9eb8ded15d
commit f679be765f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 9 deletions

View File

@ -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-26-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
@ -46,7 +46,7 @@ host: user@myserver.com
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:
@ -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
...
```

View File

@ -1,6 +1,6 @@
deploy_path: "/tmp/hap-example"
repo: "https://github.com/stackbuilders/hapistrano.git"
revision: "origin/master"
revision: "origin/main"
host: vagrant@127.0.0.1
port: 2222
working_directory: example

View File

@ -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
@ -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 ()
@ -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 =