Skip to content

Circleci#4

Open
leighs-hammer wants to merge 6 commits intopixelcabin:masterfrom
leighs-hammer:circleci
Open

Circleci#4
leighs-hammer wants to merge 6 commits intopixelcabin:masterfrom
leighs-hammer:circleci

Conversation

@leighs-hammer
Copy link

@leighs-hammer leighs-hammer commented Sep 7, 2019

Pull request for: PivotalTracker

Description

Add a CircleCI config which uses env vars for the config / credentials

To make this work it has two scripts that are in the folder circle_scripts the largest one is the deployer
Which spools up an express webserver and attaches an ngrok instance programmatically.
The second one checks if the theme is ready to be interacted with.

This forgoes the need for the credentials file to be passed in via Travis or other measures, and uses env vars set to circle these variables are:

SHOPIFY_URL - Shopify url
SHOPIFY_API_KEY - Shopify private app
SHOPIFY_API_PASSWORD - Shopify private app
NGROK_TOKEN - nrgok access token ( from ngrok online )
CYPRESS_PROJECT_ID - This will be used for recording get this from cypress
CYPRESS_RUN_KEY - The cypress run key

Test artifacts and run log will be visible on: https://dashboard.cypress.io

circle_scripts/deploy.js writes both an audit log and also writes a revised cypress.json
This forgoes the need for overwriting the cy.visit() command.
It also adds a preview param which then is passed into the example test which would fix the multiple visits in a file error which would be found when the url was not forced by the overide.

Left two comments int he commands, when Cypress.env is being called but is not available so they are never read.

Screenshots / Testing URLs / Theme URLs

CircleWorkflow

CypressDashboard

Additional information (Optional)

This is opinionated and focused on granular build components, these are normally split out as workflow items set as dependents. This purely zips the theme, however the build steps could be added before that. This is a cut back example.

The build runs on the cypress orb which is boot strapped with cypress, as such potentially the bloat and load time of dependency installs could be forgone. At present they are pretty sluggish.

Leigh Barnes added 2 commits September 7, 2019 03:39
Outline approach

initital test - ngrok on circle

trigger ci

yes its circle ci

YML FFS
Adds a custom deployer to work with a circle config in an error handled
manner, changed from credentials to environment vars so as not to have
to commit details.

Does not use Grunt in this implmentation

Add some node

Adds the theme check pre build

Remove grunt

make self contained

remove pub folder

Copy caches

Indents

Deps & Folders

Add correct paths doofus

Add Throws, and change to use the ord exclusively

Test without pub

include unzip and yes flags

Worth a try

Support file config changes

Cleanup and test

Correctly throw

Build Number?

Correct preview handling

Remove trailing comma

Command comment
@leighs-hammer
Copy link
Author

leighs-hammer commented Sep 7, 2019

DONE: Need to add a teardown/theme delete task.

@leighs-hammer
Copy link
Author

Now includes a teardown for the theme once tests are complete and a few other error handlers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant