Skip to content

Commit

Permalink
Step 1743 - Update Expo deploy workflow (#229)
Browse files Browse the repository at this point in the history
* Update expo config and defaultConfig funcs

* Update expo project options and defaultOptions funcs

* Update expo project detection

* Log rn project type

* Update expo project detection and remove unused consts

* Update default workflow input

* Update default options input

* Update tests

* Move input configuration to steps package and update expo project dir input

* Update deploy workflow description
  • Loading branch information
godrei authored Feb 10, 2022
1 parent 4b7636b commit 656d93f
Show file tree
Hide file tree
Showing 10 changed files with 206 additions and 1,255 deletions.
299 changes: 21 additions & 278 deletions _tests/integration/manual_config_test.go

Large diffs are not rendered by default.

575 changes: 41 additions & 534 deletions _tests/integration/reactnative_expo_test.go

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions scanners/cordova/cordova.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import (
"path/filepath"
"strings"

yaml "gopkg.in/yaml.v2"
envmanModels "github.com/bitrise-io/envman/models"

"github.com/bitrise-io/bitrise-init/models"
"github.com/bitrise-io/bitrise-init/scanners/android"
"github.com/bitrise-io/bitrise-init/scanners/ios"
"github.com/bitrise-io/bitrise-init/steps"
"github.com/bitrise-io/bitrise-init/utility"
envmanModels "github.com/bitrise-io/envman/models"
"github.com/bitrise-io/go-utils/log"
"github.com/bitrise-io/go-utils/pathutil"
"gopkg.in/yaml.v2"
)

// ScannerName ...
Expand Down Expand Up @@ -287,12 +287,14 @@ func (scanner *Scanner) Configs(_ bool) (models.BitriseConfigMap, error) {
configBuilder.AppendStepListItemsTo(models.PrimaryWorkflowID, steps.DefaultPrepareStepList(false)...)

workdirEnvList := []envmanModels.EnvironmentItemModel{}
workdir := ""
if scanner.relCordovaConfigDir != "" {
workdirEnvList = append(workdirEnvList, envmanModels.EnvironmentItemModel{workDirInputKey: "$" + workDirInputEnvKey})
workdir = "$" + workDirInputEnvKey
workdirEnvList = append(workdirEnvList, envmanModels.EnvironmentItemModel{workDirInputKey: workdir})
}

if scanner.hasJasmineTest || scanner.hasKarmaJasmineTest {
configBuilder.AppendStepListItemsTo(models.PrimaryWorkflowID, steps.NpmStepListItem(append(workdirEnvList, envmanModels.EnvironmentItemModel{"command": "install"})...))
configBuilder.AppendStepListItemsTo(models.PrimaryWorkflowID, steps.NpmStepListItem("install", workdir))

// CI
if scanner.hasKarmaJasmineTest {
Expand All @@ -306,7 +308,7 @@ func (scanner *Scanner) Configs(_ bool) (models.BitriseConfigMap, error) {
configBuilder.AppendStepListItemsTo(models.DeployWorkflowID, steps.DefaultPrepareStepList(false)...)
configBuilder.AppendStepListItemsTo(models.DeployWorkflowID, steps.CertificateAndProfileInstallerStepListItem())

configBuilder.AppendStepListItemsTo(models.DeployWorkflowID, steps.NpmStepListItem(append(workdirEnvList, envmanModels.EnvironmentItemModel{"command": "install"})...))
configBuilder.AppendStepListItemsTo(models.DeployWorkflowID, steps.NpmStepListItem("install", workdir))

if scanner.hasKarmaJasmineTest {
configBuilder.AppendStepListItemsTo(models.DeployWorkflowID, steps.KarmaJasmineTestRunnerStepListItem(workdirEnvList...))
Expand Down Expand Up @@ -342,7 +344,7 @@ func (scanner *Scanner) Configs(_ bool) (models.BitriseConfigMap, error) {
}

configBuilder.AppendStepListItemsTo(models.PrimaryWorkflowID, steps.CertificateAndProfileInstallerStepListItem())
configBuilder.AppendStepListItemsTo(models.PrimaryWorkflowID, steps.NpmStepListItem(append(workdirEnvList, envmanModels.EnvironmentItemModel{"command": "install"})...))
configBuilder.AppendStepListItemsTo(models.PrimaryWorkflowID, steps.NpmStepListItem("install", workdir))

configBuilder.AppendStepListItemsTo(models.PrimaryWorkflowID, steps.GenerateCordovaBuildConfigStepListItem())

Expand Down Expand Up @@ -378,9 +380,7 @@ func (*Scanner) DefaultConfigs() (models.BitriseConfigMap, error) {

configBuilder.AppendStepListItemsTo(models.PrimaryWorkflowID, steps.CertificateAndProfileInstallerStepListItem())

configBuilder.AppendStepListItemsTo(models.PrimaryWorkflowID, steps.NpmStepListItem(
envmanModels.EnvironmentItemModel{"command": "install"},
envmanModels.EnvironmentItemModel{workDirInputKey: "$" + workDirInputEnvKey}))
configBuilder.AppendStepListItemsTo(models.PrimaryWorkflowID, steps.NpmStepListItem("install", "$"+workDirInputEnvKey))

configBuilder.AppendStepListItemsTo(models.PrimaryWorkflowID, steps.GenerateCordovaBuildConfigStepListItem())

Expand Down
14 changes: 7 additions & 7 deletions scanners/ionic/ionic.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,14 @@ func (scanner *Scanner) Configs(_ bool) (models.BitriseConfigMap, error) {
configBuilder.AppendStepListItemsTo(models.PrimaryWorkflowID, steps.DefaultPrepareStepList(false)...)

workdirEnvList := []envmanModels.EnvironmentItemModel{}
workdir := ""
if scanner.relCordovaConfigDir != "" {
workdirEnvList = append(workdirEnvList, envmanModels.EnvironmentItemModel{workDirInputKey: "$" + workDirInputEnvKey})
workdir = "$" + workDirInputEnvKey
workdirEnvList = append(workdirEnvList, envmanModels.EnvironmentItemModel{workDirInputKey: workdir})
}

if scanner.hasJasmineTest || scanner.hasKarmaJasmineTest {
configBuilder.AppendStepListItemsTo(models.PrimaryWorkflowID, steps.NpmStepListItem(append(workdirEnvList, envmanModels.EnvironmentItemModel{"command": "install"})...))
configBuilder.AppendStepListItemsTo(models.PrimaryWorkflowID, steps.NpmStepListItem("install", workdir))

// CI
if scanner.hasKarmaJasmineTest {
Expand All @@ -300,7 +302,7 @@ func (scanner *Scanner) Configs(_ bool) (models.BitriseConfigMap, error) {
configBuilder.AppendStepListItemsTo(models.DeployWorkflowID, steps.DefaultPrepareStepList(false)...)
configBuilder.AppendStepListItemsTo(models.DeployWorkflowID, steps.CertificateAndProfileInstallerStepListItem())

configBuilder.AppendStepListItemsTo(models.DeployWorkflowID, steps.NpmStepListItem(append(workdirEnvList, envmanModels.EnvironmentItemModel{"command": "install"})...))
configBuilder.AppendStepListItemsTo(models.DeployWorkflowID, steps.NpmStepListItem("install", workdir))

if scanner.hasKarmaJasmineTest {
configBuilder.AppendStepListItemsTo(models.DeployWorkflowID, steps.KarmaJasmineTestRunnerStepListItem(workdirEnvList...))
Expand Down Expand Up @@ -336,7 +338,7 @@ func (scanner *Scanner) Configs(_ bool) (models.BitriseConfigMap, error) {
}

configBuilder.AppendStepListItemsTo(models.PrimaryWorkflowID, steps.CertificateAndProfileInstallerStepListItem())
configBuilder.AppendStepListItemsTo(models.PrimaryWorkflowID, steps.NpmStepListItem(append(workdirEnvList, envmanModels.EnvironmentItemModel{"command": "install"})...))
configBuilder.AppendStepListItemsTo(models.PrimaryWorkflowID, steps.NpmStepListItem("install", workdir))

configBuilder.AppendStepListItemsTo(models.PrimaryWorkflowID, steps.GenerateCordovaBuildConfigStepListItem())

Expand Down Expand Up @@ -372,9 +374,7 @@ func (Scanner) DefaultConfigs() (models.BitriseConfigMap, error) {

configBuilder.AppendStepListItemsTo(models.PrimaryWorkflowID, steps.CertificateAndProfileInstallerStepListItem())

configBuilder.AppendStepListItemsTo(models.PrimaryWorkflowID, steps.NpmStepListItem(
envmanModels.EnvironmentItemModel{"command": "install"},
envmanModels.EnvironmentItemModel{workDirInputKey: "$" + workDirInputEnvKey}))
configBuilder.AppendStepListItemsTo(models.PrimaryWorkflowID, steps.NpmStepListItem("install", "$"+workDirInputEnvKey))

configBuilder.AppendStepListItemsTo(models.PrimaryWorkflowID, steps.GenerateCordovaBuildConfigStepListItem())
configBuilder.AppendStepListItemsTo(models.PrimaryWorkflowID, steps.IonicArchiveStepListItem(
Expand Down
19 changes: 16 additions & 3 deletions scanners/reactnative/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,32 @@ Next steps:
- Add tests to your project and configure the workflow to run them.
- Check out [Getting started with React Native apps](https://devcenter.bitrise.io/en/getting-started/getting-started-with-react-native-apps.html).
`
deployExpoWorkflowDescription = `Tests, builds and deploys the app.
)

const (
expoDeployWorkflowDescription = `Tests the app and runs a build on Expo Application Services (EAS).
Next steps:
- Configure the ` + "`Run Expo Application Services (EAS) build`" + ` Step's ` + "`Access Token`" + ` input.
- Check out [Getting started with Expo apps](https://devcenter.bitrise.io/en/getting-started/getting-started-with-expo-apps.html).
- For an alternative deploy workflow checkout the [(React Native) Expo: Build using Turtle CLI recipe](https://github.com/bitrise-io/workflow-recipes/blob/main/recipes/rn-expo-turtle-build.md).
`

expoDeployWorkflowNoTestsDescription = `Runs a build on Expo Application Services (EAS).
Next steps:
- Configure the ` + "`Run Expo Application Services (EAS) build`" + ` Step's ` + "`Access Token`" + ` input.
- Check out [Getting started with Expo apps](https://devcenter.bitrise.io/en/getting-started/getting-started-with-expo-apps.html).
- For an alternative deploy workflow checkout the [(React Native) Expo: Build using Turtle CLI recipe](https://github.com/bitrise-io/workflow-recipes/blob/main/recipes/rn-expo-turtle-build.md).
`

primaryExpoWorkflowDescription = `Runs tests.
expoPrimaryWorkflowDescription = `Runs tests.
Next steps:
- Check out [Getting started with Expo apps](https://devcenter.bitrise.io/en/getting-started/getting-started-with-expo-apps.html).
`

primaryExpoWorkflowNoTestsDescription = `Installs dependencies.
expoPrimaryWorkflowNoTestsDescription = `Installs dependencies.
Next steps:
- Add tests to your project and configure the workflow to run them.
Expand Down
Loading

0 comments on commit 656d93f

Please sign in to comment.