Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract check that latest master commit has been deployed to CI step #692

Open
solidgoldpig opened this issue Jul 23, 2020 · 0 comments
Open

Comments

@solidgoldpig
Copy link
Contributor

const checkCircleSha = async () => {
const { CIRCLECI, CIRCLE_BRANCH, CIRCLE_SHA1 } = process.env
if (E2E_BASE_URL && CIRCLECI && CIRCLE_BRANCH === 'master') {
const sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms))
let checkPing = true
const pingUrl = `${E2E_BASE_URL}/healthcheck/ping`
process.stdout.write(
`Checking ${pingUrl} for correct commit sha ${CIRCLE_SHA1}`
)
while (checkPing) {
try {
const { data } = await axios.get(pingUrl)
if (data.commit_id === CIRCLE_SHA1) {
checkPing = false
process.stdout.write(`${E2E_BASE_URL} returned correct commit sha`)
}
} catch (error) {
process.stdout.write('.')
await sleep(2000)
}
}
}
}

This would be better as a step in our CI task. It should probably be rolled up together with the get-review-app script

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

No branches or pull requests

1 participant