Skip to content

Commit

Permalink
Revert "Buildkite Migration (wix#3222)"
Browse files Browse the repository at this point in the history
This reverts commit 675fe40.
  • Loading branch information
d4vidi committed Mar 1, 2022
1 parent 2c417ef commit 1ba84c1
Show file tree
Hide file tree
Showing 21 changed files with 49 additions and 266 deletions.
12 changes: 0 additions & 12 deletions .buildkite/jobs/pipeline.android_demo_app_rn_64.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .buildkite/jobs/pipeline.android_rn_64.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .buildkite/jobs/pipeline.android_rn_66.yml

This file was deleted.

10 changes: 0 additions & 10 deletions .buildkite/jobs/pipeline.ios_rn_64.yml

This file was deleted.

10 changes: 0 additions & 10 deletions .buildkite/jobs/pipeline.ios_rn_66.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .buildkite/pipeline.debug.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .buildkite/pipeline.release.fast.yml

This file was deleted.

58 changes: 0 additions & 58 deletions .buildkite/pipeline.release.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .buildkite/pipeline.sh

This file was deleted.

9 changes: 0 additions & 9 deletions .buildkite/pipeline_common.sh

This file was deleted.

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/erbium
12.22.1
4 changes: 2 additions & 2 deletions detox/test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"packager": "react-native start",
"detox-server": "detox run-server",
"e2e:ios": "detox test -c ios.sim.release",
"e2e:ios-ci": "npm run e2e:ios -- --workers 2 --retries 1 --jest-report-specs -l verbose",
"e2e:ios-ci": "npm run e2e:ios -- --workers 4 --retries 1 --jest-report-specs -l verbose",
"e2e:android": "detox test -c android.emu.release",
"e2e:android-ci-genycloud": "detox test -c android.genycloud.release --workers 5 --retries 1 --jest-report-specs --loglevel verbose",
"e2e:android-ci-google": "detox test -c android.emu.release --workers 3 --retries 1 --jest-report-specs --loglevel verbose --headless --gpu off",
"e2e:android-ci-google": "detox test -c android.emu.release --workers 3 --retries 1 --jest-report-specs --loglevel verbose --headless",
"e2e:android-debug": "detox test -c android.emu.debug",
"integration": "jest --clearCache && jest unit --config integration/config.js -w 1 .",
"integration-update-snapshots": "npm run integration -- -u",
Expand Down
2 changes: 1 addition & 1 deletion examples/demo-react-native-jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"test:ios-release": "detox test --configuration ios.sim.release -l verbose",
"test:ios-release-ci": "detox test --configuration ios.sim.release -l verbose --workers 2",
"test:android-release": "detox test --configuration android.emu.release",
"test:android-release-ci": "detox test --configuration android.emu.release -l verbose --workers 2 --headless --gpu off --record-logs all --take-screenshots all",
"test:android-release-ci": "detox test --configuration android.emu.release -l verbose --workers 2 --headless --record-logs all --take-screenshots all",
"test:android-genycloud-release": "detox test --configuration android.genycloud.release",
"test:android-genycloud-release-ci": "detox test --configuration android.genycloud.release -l verbose --workers 2 --record-logs all --take-screenshots all"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/demo-react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"test:ios-release": "detox test --configuration ios.sim.release",
"test:android-debug": "detox test --configuration android.emu.debug",
"test:android-release": "detox test --configuration android.emu.release",
"test:android-release-ci": "detox test --configuration android.emu.release -l verbose --headless --gpu off --record-logs all --take-screenshots all",
"test:android-release-ci": "detox test --configuration android.emu.release -l verbose --headless --record-logs all --take-screenshots all",
"e2e:ios": "npm run build:ios && npm run test:ios",
"e2e:android-debug": "npm run build:android-debug && npm run test:android-debug",
"e2e:android-release": "npm run build:android-release && npm run test:android-release",
Expand Down
8 changes: 3 additions & 5 deletions scripts/ci.android-release.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const exec = require('shell-utils').exec;
const {log, logSection, getVersionSafe, releaseNpmTag, getReleaseVersionType} = require('./ci.common');
const {log, logSection, getVersionSafe, releaseNpmTag} = require('./ci.common');

function run() {
logSection('Initializing');
exec.execSync('lerna bootstrap --no-ci');

const versionType = getReleaseVersionType();
const versionType = process.env.RELEASE_VERSION_TYPE;
logSection(`Pre-calculating future version... (versionType=${versionType})`);

const npmTag = releaseNpmTag();
Expand All @@ -20,9 +20,7 @@ function run() {
exec.execSync(`yes | ${process.env.ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --licenses`);
process.chdir('detox/android');
exec.execSync(`./gradlew clean detox:publish -Dversion=${futureVersion}`);
process.chdir('../Detox-android/');
exec.execSync(`tar -zcf ARCHIVE_${futureVersion}.tgz *`);
process.chdir(`../../`);
process.chdir('../..');
}

run();
43 changes: 5 additions & 38 deletions scripts/ci.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,10 @@
const semver = require('semver');
const fs = require('fs');
const chalk = require('chalk');
const cp = require('child_process');

const log = (...args) => console.log('[RELEASE]', ...args);
const logSection = (message) => console.log(chalk.blue(`[RELEASE] ${message}`));

// Export buildkite variables for Release build
// We cast toString() because 'buildkite-agent meta-data get' function returns 'object'
const BRANCH = process.env.BUILDKITE_BRANCH
const isRelease = process.env.BUILDKITE_MESSAGE.match(/^release$/i);
let RELEASE_VERSION_TYPE, RELEASE_NPM_TAG, RELEASE_DRY_RUN, RELEASE_SKIP_NPM;
if (isRelease) {
RELEASE_VERSION_TYPE = cp.execSync(`buildkite-agent meta-data get release-version-type`).toString();
RELEASE_SKIP_NPM = cp.execSync(`buildkite-agent meta-data get release-skip-npm`).toString();
RELEASE_DRY_RUN = cp.execSync(`buildkite-agent meta-data get release-dry-run`).toString();
RELEASE_NPM_TAG = cp.execSync(`buildkite-agent meta-data get release-npm-tag`).toString();
}

function getIsRelease() {
return isRelease;
}

function getReleaseVersionType() {
return RELEASE_VERSION_TYPE;
}

function getSkipNpm() {
return RELEASE_SKIP_NPM;
}

function getDryRun() {
return RELEASE_DRY_RUN;
}

function getPackageJsonPath() {
return `${process.cwd()}/detox/package.json`;
}
Expand All @@ -52,22 +23,18 @@ function getVersionSafe() {
}

function releaseNpmTag() {
if (RELEASE_NPM_TAG !== 'null') {
return RELEASE_NPM_TAG;
} else if (BRANCH === 'master') {
if (process.env.RELEASE_NPM_TAG) {
return process.env.RELEASE_NPM_TAG;
} else if (process.env.BRANCH === 'master') {
return 'latest';
} else {
return BRANCH;
return process.env.BRANCH;
}
}

module.exports = {
log,
logSection,
getVersionSafe,
releaseNpmTag,
getReleaseVersionType,
getIsRelease,
getDryRun,
getSkipNpm
releaseNpmTag
};
1 change: 1 addition & 0 deletions scripts/ci.ios.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash -ex

source $(dirname "$0")/ci.sh

mkdir -p coverage

pushd detox/test
Expand Down
12 changes: 6 additions & 6 deletions scripts/ci.publish.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* tslint:disable: no-console */
const exec = require('shell-utils').exec;

const {log, logSection, getReleaseVersionType, getDryRun, getSkipNpm} = require('./ci.common');
const {log, logSection} = require('./ci.common');

function publishNewVersion(npmTag) {
function publishNewVersion(packageVersion, npmTag) {
validatePrerequisites();
projectSetup();
publishToNpm(npmTag);
Expand All @@ -18,16 +18,16 @@ function validatePrerequisites() {

function projectSetup() {
logSection('Project setup');
exec.execSync(`git checkout ${process.env.BUILDKITE_BRANCH}`);
exec.execSync(`git checkout ${process.env.BRANCH}`);
// exec.execSync(`lerna bootstrap --no-ci --loglevel verebose`);
}

function publishToNpm(npmTag) {
logSection('Lerna publish');

const versionType = getReleaseVersionType();
const dryRun = getDryRun() === "true";
const skipNpm = getSkipNpm() === "true";
const versionType = process.env.RELEASE_VERSION_TYPE;
const dryRun = process.env.RELEASE_DRY_RUN === "true";
const skipNpm = process.env.RELEASE_SKIP_NPM === "true";
if (dryRun) {
log('DRY RUN: Lerna-publishing without publishing to NPM');
}
Expand Down
Loading

0 comments on commit 1ba84c1

Please sign in to comment.