Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 124 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# This configuration was automatically generated from a CircleCI 1.0 config.
# It should include any build commands you had along with commands that CircleCI
# inferred from your project structure. We strongly recommend you read all the
# comments in this file to understand the structure of CircleCI 2.0, as the idiom
# for configuration has changed substantially in 2.0 to allow arbitrary jobs rather
# than the prescribed lifecycle of 1.0. In general, we recommend using this generated
# configuration as a reference rather than using it in production, though in most
# cases it should duplicate the execution of your original 1.0 config.
version: 2
jobs:
build:
working_directory: ~/docker/kitematic
parallelism: 1
shell: /bin/bash --login
# CircleCI 2.0 does not support environment variables that refer to each other the same way as 1.0 did.
# If any of these refer to each other, rewrite them so that they don't or see https://circleci.com/docs/2.0/env-vars/#interpolating-environment-variables-to-set-other-environment-variables .
environment:
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
# The `macos` block requests that builds will run on a machine running
# macOS with the specified version of Xcode installed
macos:
xcode: '8.3.3'
steps:
# Machine Setup
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
# The following `checkout` command checks out your code to your working directory. In 1.0 we did this implicitly. In 2.0 you can choose where in the course of a job your code should be checked out.
- checkout
# Prepare for artifact and test results collection equivalent to how it was done on 1.0.
# In many cases you can simplify this from what is generated here.
# 'See docs on artifact collection here https://circleci.com/docs/2.0/artifacts/'
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
# The following line was run implicitly in your 1.0 builds based on what CircleCI inferred about the structure of your project. In 2.0 you need to be explicit about which commands should be run. In some cases you can discard inferred commands if they are not relevant to your project.
- run:
working_directory: ~/docker/kitematic
command: xcodebuild -version
# Dependencies
# This would typically go in either a build or a build-and-test job when using workflows
# Restore the dependency cache
- restore_cache:
keys:
# This branch if available
- v1-dep-{{ .Branch }}-
# Default branch if not
- v1-dep-master-
# Any branch if there are none on the default branch - this should be unnecessary if you have your default branch configured correctly
- v1-dep-
# This is based on your 1.0 configuration file or project settings
- run: |-
# Mac OS X signing keys
echo $SIGNING_KEYCHAIN_HEX > signing_keychain.hex && xxd -p -r signing_keychain.hex ~/Library/Keychains/keychain.keychain && rm signing_keychain.hex

security list-keychains -s ~/Library/Keychains/keychain.keychain
security unlock-keychain -p "$SIGNING_PASSWORD" ~/Library/Keychains/keychain.keychain
security default-keychain -s keychain.keychain

echo "{\"mixpanel\": \"$MIXPANEL_TOKEN\", \"mixpanel-dev\": \"$MIXPANEL_DEV_TOKEN\", \"bugsnag\": \"$BUGSNAG_TOKEN\"}" > settings.json

# Windows signing keys
mkdir -p ~/keys
mkdir -p ~/tmp
echo $WINDOWS_SIGNING_CERT_HEX > ~/tmp/windows_signing_cert.hex && xxd -p -r ~/tmp/windows_signing_cert.hex ~/keys/cert.spc
echo $WINDOWS_SIGNING_KEY_HEX > ~/tmp/windows_signing_key.hex && xxd -p -r ~/tmp/windows_signing_key.hex ~/keys/key.pvk
rm -r ~/tmp
# This is based on your 1.0 configuration file or project settings
- run: brew update
- run: brew install node@8
- run: export PATH="/usr/local/opt/node@8/bin:$PATH"
- run: echo 'export PATH="/usr/local/opt/node@8/bin:$PATH"' >> ~/.bash_profile
- run: brew install --ignore-dependencies https://raw.githubusercontent.com/Homebrew/homebrew-core/7e34b4761ca203b8b03e88ee6c14aabbf83db82a/Formula/wine.rb
- run: brew install github-release
- run: brew install mono
- run: brew install fakeroot
- run: brew install dpkg
- run: brew cleanup -s
- run: npm install
# Save dependency cache
- save_cache:
key: v1-dep-{{ .Branch }}-{{ epoch }}
paths:
# This is a broad list of cache paths to include many possible development environments
# You can probably delete some of these entries
- vendor/bundle
- ~/virtualenvs
- ~/.m2
- ~/.ivy2
- ~/.bundle
- ~/.go_workspace
- ~/.gradle
- ~/.cache/bower
# These cache paths were specified in the 1.0 config
- node_modules
- ~/.electron
- ./node_modules
# Test
# This would typically be a build job when using workflows, possibly combined with build
# This is based on your 1.0 configuration file or project settings
- run: npm test
- run: npm run integration
# This is based on your 1.0 configuration file or project settings
- run:
command: make release
no_output_timeout: 12000s
- run: cp release/* $CIRCLE_ARTIFACTS/
- run: '# echo "$WINDOWS_SIGNING_PASSWORD" | signcode -spc ~/keys/cert.spc -v
~/keys/key.pvk -a sha1 -$ commercial -t http://timestamp.verisign.com/scripts/timstamp.dll
-tr 10 dist/Kitematic-install/Kitematic-Setup.exe'
# Deployment
# Your existing circle.yml file contains deployment steps.
# The config translation tool does not support translating deployment steps
# since deployment in CircleCI 2.0 are better handled through workflows.
# See the documentation for more information https://circleci.com/docs/2.0/workflows/
# Teardown
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
# The following line was run implicitly in your 1.0 builds based on what CircleCI inferred about the structure of your project. In 2.0 you need to be explicit about which commands should be run. In some cases you can discard inferred commands if they are not relevant to your project.
- run: find $HOME/Library/Developer/Xcode/DerivedData -name '*.xcactivitylog' -exec cp {} $CIRCLE_ARTIFACTS/xcactivitylog \; || true
# Save test results
- store_test_results:
path: /tmp/circleci-test-results
# Save artifacts
- store_artifacts:
path: /tmp/circleci-artifacts
- store_artifacts:
path: /tmp/circleci-test-results
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ rules:
no-unused-vars: [2, {vars: "all", args: "after-used"}]
no-use-before-define: 2
no-with: 2
quotes: [2, "single"]
quotes: [2, "double"]
radix: 2
semi: 2
semi-spacing: [2, {before: false, after: true}]
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sudo: false

language: node_js
node_js:
- "4.8.7"
- "8.9.4"

cache:
directories:
Expand Down
64 changes: 32 additions & 32 deletions __tests__/Util-test.js
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
jest.dontMock('../src/utils/Util').dontMock('console');
const util = require('../src/utils/Util');
jest.dontMock("../src/utils/Util").dontMock("console");
const util = require("../src/utils/Util");

describe('Util', () => {
describe('when removing sensitive data', () => {
it('filters ssh certificate data', () => {
describe("Util", () => {
describe("when removing sensitive data", () => {
it("filters ssh certificate data", () => {
var testdata = String.raw`time="2015-04-17T21:43:47-04:00" level="debug" msg="executing: ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectionAttempts=30 -o LogLevel=quiet -p 50483 -i /Users/johnappleseed/.docker/machine/machines/dev2/id_rsa docker@localhost sudo mkdir -p /var/lib/boot2docker" time="2015-04-17T21:43:47-04:00" level="debug" msg="executing: ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectionAttempts=30 -o LogLevel=quiet -p 50483 -i /Users/johnappleseed/.docker/machine/machines/dev2/id_rsa docker@localhost echo \"-----BEGIN CERTIFICATE-----\nMIIC+DCCAeKgAwIBAgIRANfIbsa2M94gDY+fBiBiQBkwCwYJKoZIhvcNAQELMBIx\nEDAOBgNVBAoTB2ptb3JnYW4wHhcNMTUwNDE4MDEzODAwWhcNMTgwNDAyMDEzODAw\nWjAPMQ0wCwYDVQQKEwRkZXYyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC\nAQEA1yamWT0bk0pRU7eiStjiXe2jkzdeI0SdJZo+bjczkl6kzNW/FmR/OkcP8gHX\nCO3fUCWkR/+rBgz3nuM1Sy0BIUo0EMQGfx17OqIJPXO+BrpCHsXlphHmbQl5bE2Y\nF+bAsGc6WCippw/caNnIHRsb6zAZVYX2AHLYY0fwIDAQABo1AwTjAOBgNVHQ8BAf8EBAMCAKAwHQYD\nVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMBMAwGA1UdEwEB/wQCMAAwDwYDVR0R\nBAgwBocEwKhjZTALBgkqhkiG9w0BAQsDggEBAKBdD86+kl4X1VMjgGlNYnc42tWa\nbo1iDl/frxiLkfPSc2McAOm3AqX1ao+ynjqq1XTlBLPTQByu/oNZgA724LRJDfdG\nCKGUV8latW7rB1yhf/SZSmyhNjufuWlgCtbkw7Q/oPddzYuSOdDW8tVok9gMC0vL\naqKCWfVKkCmvGH+8/wPrkYmro/f0uwJ8ee+yrbBPlBE/qE+Lqcfr0YcXEDaS8CmL\nDjWg7KNFpA6M+/tFNQhplbjwRsCt7C4bzQu0aBIG5XH1Jr2HrKlLjWdmluPHWUL6\nX5Vh1bslYJzsSdBNZFWSKShZ+gtRpjtV7NynANDJPQNIRhDxAf4uDY9hA2c=\n-----END CERTIFICATE-----\n\" | sudo tee /var/lib/boot2docker/server.pem"
time="2015-04-17T21:43:47-04:00" level="debug" msg="executing: /usr/bin/VBoxManage showvminfo dev2 --machinereadable"`;
expect(util.removeSensitiveData(testdata).indexOf('CERTIFICATE')).toEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf('nX5Vh1bslYJzsSdBNZFWSKShZ+gtRpjtV7NynANDJPQNIRhDxAf4uDY9hA2c')).toEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf('<redacted>')).toNotEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf("CERTIFICATE")).toEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf("nX5Vh1bslYJzsSdBNZFWSKShZ+gtRpjtV7NynANDJPQNIRhDxAf4uDY9hA2c")).toEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf("<redacted>")).not.toEqual(-1);
});

it('filters ssh private key data', () => {
it("filters ssh private key data", () => {
var testdata = String.raw`hZbuxglOtQv2AQqOp/luhZ3Y8kDs4cqRzoA1o+k+LAyjEb+Nk\nGA8=\n-----END CERTIFICATE-----\n\" | sudo tee /var/lib/boot2docker/ca.pem"
time="2015-04-17T21:43:47-04:00" level="debug" msg="executing: ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectionAttempts=30 -o LogLevel=quiet -p 50483 -i /Users/johnappleseed/.docker/machine/machines/dev2/id_rsa docker@localhost echo \"-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEA1yamWT0bk0pRU7eiStjiXe2jkzdeI0SdJZo+bjczkl6kzNW/\nFmR/OkcP8gHXCO3fUCWkR/+rBgz3nuM1Sy0BIUo0EMQGfx17OqIJPXO+BrpCHsXl\nphHmbQl5bE2YF+bAsGc6WCippczQIu5bPweeAkR1WdlkhD08tHD4o1ESe09fXx5G\nXcZFfd2xQWdvAJX3fTuGBk3IMEF2fye5b69zUyVDGbTylyjKDOi9Xxdlc4y9cOPw\nzcwQFCOJiCBYlxDO0fbinA+KigCs29Dd5U3oXbloLr3JQTE/SkxFh9W5rkX8ysY4\n2h3EnR7YIBWt/caNnIHRsb6zAZVYX2AHLYY0fwIDAQABAoIBAQDKF3TTh/G59WnU\n4D2iXnyqy8gFRVG4gP+3TV3s+w8HIr1b5j6akwVqwUs5//5zVbSYPPNF6eJESbPi\nW/s4ROq10VR8lxSfHBsfJQrW3TwWZ6gp7atbxZ6Stv6F+5CsisReLmiAXJmVsn+j\nAA9Xchk6egFcxzWCfV7jAuaZyVI53cclepm/xkGjPwrfXr+nA+UMvO6DllC6IcBF\no4+O0jVtzdMecZnQk6nWxNJjurodTTQakrNAqSMgBshn48wf3N35b+p8RtTzLJ8L\nYuHkv6OKMITIazcHadjsN8icGgIGf2BJ1CRje7j0Yzow8jwY+Pet3yxKSfXED89B\nD34AEXl5AoGBANi17og+yPFOWURUrksO/QyzlOtXcQdQu8SmkUj4ACoqF0gegQIb\nC/DNMcYxJAsPPgw/t5Ws/af8DuatYguGukmekYREVjc7DS/hPWDZzeavPd95cOw0\nuMPgJE76HJ3BSYcp1f8WKcN+xDket9CF6Qz+VX5aQSUEc333V5h7D/nzAoGBAP4o\nVCvQu5eKYmDhMFSOA0+Qm3EECRqMLoH6kpEcbMjM8+kOeI0fUuE3CX8nzs7P4py/\n0IFj2Yxl578NHJOjCpbB1UKtxLkmDH42wXXzrWJXRaWXC93dh1sl0aB6qE25FtSD\nzjYh4y1DA/t6y95YRrIqC2WhIU7eigIoujmtOFJFAoGABSKiiWX7ewRhRyY+jxbG\n1lM3FzCWRBccq/dKgBEoZ9dhf9sBMZyUdttV751gfkaZMM8duZVE2YM2ky7OoPlL\nVs1EI38/D8X9dQIAY1gl8e57J92H2IETU8ju81Qn83EOHf7WzFmpGbHaUoQw1Ocn\nc6BfREQ9QPRPDFAdKkbYRRMCgYEAl44k4xvNQUhb8blWwJUOlFt+1Z26cAI3mXp5\n+94fYH4W1Fq0uDJ9kZ7oItLyF5EPaLlY9E8+YuJBl0OSTtdicROUv/Yu4Nk3ievM\n4TE1qvavqVaw1NRM6qVao3+A7Rf57S/Lv6vldBAKR+OpviSVw5gew7OZ0RYS5caz\nhcEtXKECgYAJb7t67nococm0PsRe8Xv1SQOQjetrhzwzD1PLOSC9TrzwA22/ZktZ\neu/qfvYgOPT4LkDGVCzn8J+TAcUVnIvAnJRQTsBu55uiL8YC5jZQ8E1hBf7kskMq\nh16WD19Djv3WhfBNXBxvnagDDWw5DxmiiKzSf0k3QDDoX7wjDAV1dQ==\n-----END RSA PRIVATE KEY-----\n\" | sudo tee /var/lib/boot2docker/server-key.pem"
time="2015-04-17T21:43:47-04:00" level="debug" msg="executing: ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectionAttempts=30 -o LogLevel=quiet -p 50483 -i /Users/johnappleseed/.docker/machine/machines/dev2/id_rsa docker@localhost echo \"-----BEGIN CERTIFICATE-----\nMIIC+DCCAeKgAwIBAgIRANfIbsa2M94gDY+fBiBiQBkwCwYJKoZIhvcNAQELMBIx\nEDAOBg`;
expect(util.removeSensitiveData(testdata).indexOf('PRIVATE')).toEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf('94fYH4W1Fq0uDJ9kZ7oItLyF5EPaLlY9E8+YuJBl0OSTtdicROUv')).toEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf('<redacted>')).toNotEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf("PRIVATE")).toEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf("94fYH4W1Fq0uDJ9kZ7oItLyF5EPaLlY9E8+YuJBl0OSTtdicROUv")).toEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf("<redacted>")).not.toEqual(-1);
});

it('filters username data', () => {
it("filters username data", () => {
var testdata = String.raw`/Users/johnappleseed/.docker/machine/machines/dev2/id_rsa docker@localhost echo`;
expect(util.removeSensitiveData(testdata).indexOf('/Users/johnappleseed/')).toEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf('/Users/<redacted>/')).toNotEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf("/Users/johnappleseed/")).toEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf("/Users/<redacted>/")).not.toEqual(-1);

testdata = String.raw`/Users/some.wei-rdUsername/.docker/machine/machines/dev2/id_rsa docker@localhost echo`;
expect(util.removeSensitiveData(testdata).indexOf('/Users/some.wei-rdUsername/.docker')).toEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf('/Users/<redacted>/.docker')).toNotEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf("/Users/some.wei-rdUsername/.docker")).toEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf("/Users/<redacted>/.docker")).not.toEqual(-1);
});

it('filters Windows username data', () => {
it("filters Windows username data", () => {
var testdata = String.raw`C:\\Users\\johnappleseed\\.docker\\machine`;
expect(util.removeSensitiveData(testdata).indexOf('johnappleseed')).toEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf('<redacted>')).toNotEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf("johnappleseed")).toEqual(-1);
expect(util.removeSensitiveData(testdata).indexOf("<redacted>")).not.toEqual(-1);
});

it ('returns input if empty or not a string', () => {
expect(util.removeSensitiveData('')).toBe('');
it ("returns input if empty or not a string", () => {
expect(util.removeSensitiveData("")).toBe("");
expect(util.removeSensitiveData(1)).toBe(1);
expect(util.removeSensitiveData(undefined)).toBe(undefined);
});
});

describe('when verifying that a repo is official', () => {
it('accepts official repo', () => {
expect(util.isOfficialRepo('redis')).toBe(true);
describe("when verifying that a repo is official", () => {
it("accepts official repo", () => {
expect(util.isOfficialRepo("redis")).toBe(true);
});

it('rejects falsy value as official repo', () => {
it("rejects falsy value as official repo", () => {
expect(util.isOfficialRepo(undefined)).toBe(false);
});

it('rejects empty repo name', () => {
expect(util.isOfficialRepo('')).toBe(false);
it("rejects empty repo name", () => {
expect(util.isOfficialRepo("")).toBe(false);
});

it('rejects repo with non official namespace', () => {
expect(util.isOfficialRepo('kitematic/html')).toBe(false);
it("rejects repo with non official namespace", () => {
expect(util.isOfficialRepo("kitematic/html")).toBe(false);
});

it('rejects repo with a different registry address', () => {
expect(util.isOfficialRepo('www.myregistry.com/kitematic/html')).toBe(false);
it("rejects repo with a different registry address", () => {
expect(util.isOfficialRepo("www.myregistry.com/kitematic/html")).toBe(false);
});
});
});
38 changes: 0 additions & 38 deletions circle.yml

This file was deleted.

4 changes: 2 additions & 2 deletions jest-unit.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"scriptPreprocessor": "<rootDir>/node_modules/babel-jest",
"setupEnvScriptFile": "<rootDir>/util/testenv.js",
"transform": {".*": "<rootDir>/node_modules/babel-jest"},
"setupFiles": ["<rootDir>/util/testenv.js"],
"setupTestFrameworkScriptFile": "<rootDir>/util/prepare.js",
"unmockedModulePathPatterns": [
"alt",
Expand Down
Loading