From 8e5113f0714c61635d4de631aa078fa7212d2279 Mon Sep 17 00:00:00 2001 From: Fabian Kramm Date: Fri, 7 Sep 2018 10:38:35 +0200 Subject: [PATCH 1/7] Use travis cache to store dependencies --- .travis.yml | 3 +++ cmd/status_sync.go | 22 +++++++++++++++++++++- pkg/devspace/sync/sync_config.go | 20 ++++++++++++++++---- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index c776d3b1f7..53548b707f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,9 @@ jobs: - npm install -g codeclimate-test-reporter os: linux go: 1.10.3 + cache: + directories: + - $HOME/gopath/src/github.com/$TRAVIS_REPO_SLUG/vendor script: - ./scripts/coverage.bash after_success: diff --git a/cmd/status_sync.go b/cmd/status_sync.go index 8b948465f8..a01516a943 100644 --- a/cmd/status_sync.go +++ b/cmd/status_sync.go @@ -1,10 +1,30 @@ package cmd import ( + "io/ioutil" + "os" + "path" + "strings" + + "github.com/covexo/devspace/pkg/util/log" "github.com/spf13/cobra" ) // RunStatusSync executes the devspace status sync commad logic func (cmd *StatusCmd) RunStatusSync(cobraCmd *cobra.Command, args []string) { - //TODO + // config := configutil.GetConfig(false) + + // Read syncLog + cwd, err := os.Getwd() + if err != nil { + log.Fatal(err) + } + + syncLogPath := path.Join(cwd, ".devspace", "logs", "syncLog.log") + data, err := ioutil.ReadFile(syncLogPath) + if err != nil { + log.Fatalf("Couldn't read %s. Do you have a sync path configured?", syncLogPath) + } + + _ = strings.Split(string(data), "\n") } diff --git a/pkg/devspace/sync/sync_config.go b/pkg/devspace/sync/sync_config.go index d18a49fa44..c5cf1045ba 100644 --- a/pkg/devspace/sync/sync_config.go +++ b/pkg/devspace/sync/sync_config.go @@ -57,20 +57,32 @@ type SyncConfig struct { // Logf prints the given information to the synclog with context data func (s *SyncConfig) Logf(format string, args ...interface{}) { if s.silent == false { - syncLog.WithKey("local", s.WatchPath).WithKey("container", s.DestPath).WithKey("excluded", s.ExcludePaths).Infof(format, args...) + if s.Pod != nil { + syncLog.WithKey("pod", s.Pod.Name).WithKey("local", s.WatchPath).WithKey("container", s.DestPath).Infof(format, args...) + } else { + syncLog.WithKey("local", s.WatchPath).WithKey("container", s.DestPath).Infof(format, args...) + } } } // Logln prints the given information to the synclog with context data func (s *SyncConfig) Logln(line interface{}) { if s.silent == false { - syncLog.WithKey("local", s.WatchPath).WithKey("container", s.DestPath).WithKey("excluded", s.ExcludePaths).Info(line) + if s.Pod != nil { + syncLog.WithKey("pod", s.Pod.Name).WithKey("local", s.WatchPath).WithKey("container", s.DestPath).Info(line) + } else { + syncLog.WithKey("local", s.WatchPath).WithKey("container", s.DestPath).Info(line) + } } } // Error handles a sync error with context func (s *SyncConfig) Error(err error) { - syncLog.WithKey("local", s.WatchPath).WithKey("container", s.DestPath).WithKey("excluded", s.ExcludePaths).Errorf("Error: %v, Stack: %v", err, errors.ErrorStack(err)) + if s.Pod != nil { + syncLog.WithKey("pod", s.Pod.Name).WithKey("local", s.WatchPath).WithKey("container", s.DestPath).Errorf("Error: %v, Stack: %v", err, errors.ErrorStack(err)) + } else { + syncLog.WithKey("local", s.WatchPath).WithKey("container", s.DestPath).Errorf("Error: %v, Stack: %v", err, errors.ErrorStack(err)) + } if s.errorChan != nil { s.errorChan <- err @@ -175,7 +187,7 @@ func (s *SyncConfig) initIgnoreParsers() error { } func (s *SyncConfig) mainLoop() { - s.Logf("[Sync] Start syncing\n") + s.Logf("[Sync] Start syncing") err := s.initialSync() if err != nil { From 564f8079b6cb3afd08ca5e4edabb612d2e5ed2bf Mon Sep 17 00:00:00 2001 From: Fabian Kramm Date: Fri, 7 Sep 2018 10:41:13 +0200 Subject: [PATCH 2/7] Change directory path --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 53548b707f..c098b3e1a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ jobs: go: 1.10.3 cache: directories: - - $HOME/gopath/src/github.com/$TRAVIS_REPO_SLUG/vendor + - ./vendor script: - ./scripts/coverage.bash after_success: From 1ccf2c584d41a96394d88a5bdd4257fbaec41fe5 Mon Sep 17 00:00:00 2001 From: Fabian Kramm Date: Fri, 7 Sep 2018 10:52:32 +0200 Subject: [PATCH 3/7] Cache build directory --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index c098b3e1a5..0125537396 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ jobs: cache: directories: - ./vendor + - /home/travis/.cache/go-build script: - ./scripts/coverage.bash after_success: From 9b6ef01e402fb52796163d4058085d3a75f96675 Mon Sep 17 00:00:00 2001 From: Fabian Kramm Date: Fri, 7 Sep 2018 10:53:01 +0200 Subject: [PATCH 4/7] Cache build directory --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0125537396..0cf8e9598f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ jobs: cache: directories: - ./vendor - - /home/travis/.cache/go-build + - $HOME/.cache/go-build script: - ./scripts/coverage.bash after_success: From 3510288e106a10da90f27fbbc4fca5b813d4913b Mon Sep 17 00:00:00 2001 From: Fabian Kramm Date: Fri, 7 Sep 2018 11:26:18 +0200 Subject: [PATCH 5/7] Make build more reproducible --- Gopkg.lock | 49 ++++++++++++++++++++++++------------------------- Gopkg.toml | 40 ++++++++++++++++++++-------------------- 2 files changed, 44 insertions(+), 45 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 4d61048187..8c75d2eb11 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -99,7 +99,6 @@ version = "v1.1.1" [[projects]] - branch = "master" digest = "1:e921c3d4324ffdcb4fd39d5f47a832f2112d44731a5f21d8ae0ccfe82e608711" name = "github.com/daviddengcn/go-colortext" packages = ["."] @@ -349,6 +348,14 @@ pruneopts = "UT" revision = "24818f796faf91cd76ec7bddd72458fbced7a6c1" +[[projects]] + digest = "1:3a26588bc48b96825977c1b3df964f8fd842cd6860cc26370588d3563433cf11" + name = "github.com/google/uuid" + packages = ["."] + pruneopts = "UT" + revision = "d460ce9f8df2e77fb1ba55ca87fafed96c607494" + version = "v1.0.0" + [[projects]] digest = "1:65c4414eeb350c47b8de71110150d0ea8a281835b1f386eacaa3ad7325929c21" name = "github.com/googleapis/gnostic" @@ -455,7 +462,6 @@ version = "v1.1.5" [[projects]] - branch = "master" digest = "1:1261ccace00babbf02bb702e71c85c8e81f65bad7bdb98c12c7a409c14de1d86" name = "github.com/juju/errors" packages = ["."] @@ -507,12 +513,12 @@ version = "v1.0.1" [[projects]] - branch = "master" digest = "1:78bbb1ba5b7c3f2ed0ea1eab57bdd3859aec7e177811563edc41198a760b06af" name = "github.com/mitchellh/go-homedir" packages = ["."] pruneopts = "UT" revision = "ae18d6b8b3205b561c79e8e5f69bff09736185f4" + version = "v1.0.0" [[projects]] branch = "master" @@ -582,7 +588,6 @@ version = "v1.0.1" [[projects]] - branch = "master" digest = "1:c1072f27d5b8be1032af14ed7776f475bc58d35723a753c4b92c953d92e3eb33" name = "github.com/otiai10/copy" packages = ["."] @@ -590,12 +595,12 @@ revision = "7e9a647135a142c2669943d4a4d29be015ce9392" [[projects]] - digest = "1:361de06aa7ae272616cbe71c3994a654cc6316324e30998e650f7765b20c5b33" + digest = "1:e5d0bd87abc2781d14e274807a470acd180f0499f8bf5bb18606e9ec22ad9de9" name = "github.com/pborman/uuid" packages = ["."] pruneopts = "UT" - revision = "e790cca94e6cc75c7064b1332e63811d4aae1a53" - version = "v1.1" + revision = "adf5a7427709b9deb95d29d3fa8a2bf9cfd388f1" + version = "v1.2" [[projects]] digest = "1:b2ee62e09bec113cf086d2ce0769efcc7bf79481aba8373fd8f7884e94df3462" @@ -671,7 +676,6 @@ revision = "05ee40e3a273f7245e8777337fc7b46e533a9a92" [[projects]] - branch = "master" digest = "1:16e6fde687529deaefbeff14841b694cb6d67dfc31884bac6214313e96e107bc" name = "github.com/rhysd/go-github-selfupdate" packages = ["selfupdate"] @@ -695,12 +699,12 @@ version = "v1.5.1" [[projects]] - branch = "master" digest = "1:7d9e2efc92185089bb2e3fe50459624b7f9914165c01cc1e8497fd4c5f77e325" name = "github.com/sabhiram/go-gitignore" packages = ["."] pruneopts = "UT" revision = "d3107576ba9425fc1c85f4b3569c4631b805a02e" + version = "1.0.2" [[projects]] digest = "1:d917313f309bda80d27274d53985bc65651f81a5b66b820749ac7f8ef061fd04" @@ -821,7 +825,7 @@ [[projects]] branch = "master" - digest = "1:0a07445b15a3c2d313bfedd00ba73168e0961ba2ab577b9be717d105b88e6649" + digest = "1:6837b1b3f95bc64af7eb0cd1efa4d2c004e0974537b80f550994d1818db622fa" name = "golang.org/x/crypto" packages = [ "bcrypt", @@ -847,7 +851,7 @@ "ssh/terminal", ] pruneopts = "UT" - revision = "182538f80094b6a8efaade63a8fd8e0d9d5843dd" + revision = "0709b304e793a5edb4a2c0145f281ecdc20838a4" [[projects]] branch = "master" @@ -864,7 +868,7 @@ "trace", ] pruneopts = "UT" - revision = "8a410e7b638dca158bf9e766925842f6651ff828" + revision = "161cd47e91fd58ac17490ef4d742dc98bb4cf60e" [[projects]] branch = "master" @@ -879,7 +883,7 @@ [[projects]] branch = "master" - digest = "1:682170f2fb1b37fd9a04c88a2adfeeda767e3b2af60a7e0b96e663ec1886500e" + digest = "1:176d0fe4b5f9c58705c3781e6aa8555fa14fe6ff4383db75d0cbc476bd7c90fd" name = "golang.org/x/sys" packages = [ "unix", @@ -887,7 +891,7 @@ "windows/registry", ] pruneopts = "UT" - revision = "2b024373dcd9800f0cae693839fac6ede8d64a8c" + revision = "8cf3aee429924738c56c34bb819c4ea8273fc434" [[projects]] digest = "1:28756bf526c1af662d24519f2fa7abca7237bebb06e3e02941b2b6e5b6ceb7b9" @@ -1036,7 +1040,7 @@ version = "v4.2.1" [[projects]] - digest = "1:d4e888e99d4b99e8e6432dd2deb3ec83e10b866fddc35e853eb5ad7b9d928029" + digest = "1:336779a462e14e1802fef62517172dee311db2224f62391167f969cea6637a7d" name = "gopkg.in/src-d/go-git.v4" packages = [ ".", @@ -1081,8 +1085,8 @@ "utils/merkletrie/noder", ] pruneopts = "UT" - revision = "7b6c1266556f59ac436fada3fa6106d4a84f9b56" - version = "v4.6.0" + revision = "d3cec13ac0b195bfb897ed038a08b5130ab9969e" + version = "v4.7.0" [[projects]] digest = "1:98e121dbd49eb03c58bd8ef3b76322b2fdc3676cf11fa0084bb17ff01b2aa704" @@ -1109,7 +1113,6 @@ version = "v2.2.1" [[projects]] - branch = "release-1.10" digest = "1:ca518bd58ed357c00d753fef7e945ef672b9f75c66cbf7db23f3baa8ba5daa92" name = "k8s.io/api" packages = [ @@ -1148,7 +1151,6 @@ revision = "12444147eb1150aa5c80d2aae532cbc5b7be73d0" [[projects]] - branch = "release-1.10" digest = "1:b46a162d7c7e9117ae2dd9a73ee4dc2181ad9ea9d505fd7c5eb63c96211dc9dd" name = "k8s.io/apiextensions-apiserver" packages = ["pkg/features"] @@ -1156,7 +1158,6 @@ revision = "f584b16eb23bd2a3fd292a027d698d95db427c5d" [[projects]] - branch = "release-1.10" digest = "1:cb45c67c3a3f178d8323d3ffce14cddf39b8806f070af47380450d2aed06ae03" name = "k8s.io/apimachinery" packages = [ @@ -1219,7 +1220,6 @@ revision = "e386b2658ed20923da8cc9250e552f082899a1ee" [[projects]] - branch = "release-1.10" digest = "1:cc8a650c845795c9ab43c314a2ecb6a15c918b67456fcc130343950e234059d0" name = "k8s.io/apiserver" packages = [ @@ -1379,7 +1379,7 @@ version = "kubernetes-1.10.0" [[projects]] - digest = "1:71a6663e87278aaabcbe47b8be5b04cc31299f77ad65598dc033144b55e7860e" + digest = "1:7ae7497bb0f95b9f0d3d5876cb4140645773697c4f7ec12621da7ddc369d784f" name = "k8s.io/helm" packages = [ "cmd/helm/installer", @@ -1408,8 +1408,8 @@ "pkg/version", ] pruneopts = "UT" - revision = "20adb27c7c5868466912eebdf6664e7390ebe710" - version = "v2.9.1" + revision = "9ad53aac42165a5fadc6c87be0dea6b115f93090" + version = "v2.10.0" [[projects]] branch = "master" @@ -1423,7 +1423,6 @@ revision = "e3762e86a74c878ffed47484592986685639c2cd" [[projects]] - branch = "release-1.10" digest = "1:a93d65b059d465cd84ba089b8daf6fbacf3beeb0e78fa1a4cf0585398795b37c" name = "k8s.io/kubernetes" packages = [ diff --git a/Gopkg.toml b/Gopkg.toml index b8733a264d..81313b2450 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -1,6 +1,14 @@ +[[constraint]] + name = "github.com/covexo/yamlq" + revision = "ee51b09a773c7e7e4e32168cbec4d47a014161b4" + +[[constraint]] + name = "github.com/imdario/mergo" + version = "v0.3.6" + [[constraint]] name = "github.com/juju/errors" - branch = "master" + revision = "22422dad46e14561a0854ad42497a75af9b61909" [[constraint]] name = "github.com/docker/docker" @@ -9,23 +17,23 @@ [[constraint]] name = "github.com/rhysd/go-github-selfupdate" - branch = "master" + revision = "41c1bbb0804a2994dae69502a8c76e7c456ad45e" [[constraint]] name = "github.com/sabhiram/go-gitignore" - branch = "master" + version = "1.0.2" [[constraint]] name = "github.com/daviddengcn/go-colortext" - branch = "master" + revision = "186a3d44e9200d7eb331356ca4864f52708e1399" [[constraint]] - branch = "master" name = "github.com/mitchellh/go-homedir" + version = "v1.0.0" [[constraint]] - branch = "master" name = "github.com/otiai10/copy" + revision = "7e9a647135a142c2669943d4a4d29be015ce9392" [[constraint]] name = "github.com/rjeczalik/notify" @@ -53,7 +61,7 @@ [[constraint]] name = "k8s.io/helm" - version = "~v2.9.0" + version = "v2.9.1" [[constraint]] name = "github.com/foomo/htpasswd" @@ -73,23 +81,23 @@ [[override]] name = "k8s.io/kubernetes" - branch = "release-1.10" + revision = "ba92f7aebfda56086efd08a6b231c6b60a297d2d" [[override]] name = "k8s.io/api" - branch = "release-1.10" + revision = "12444147eb1150aa5c80d2aae532cbc5b7be73d0" [[override]] name = "k8s.io/apimachinery" - branch = "release-1.10" + revision = "e386b2658ed20923da8cc9250e552f082899a1ee" [[override]] name = "k8s.io/apiserver" - branch = "release-1.10" + revision = "2a84596e9aad63b1c1d47491d506a64465b5e2fc" [[override]] name = "k8s.io/apiextensions-apiserver" - branch = "release-1.10" + revision = "f584b16eb23bd2a3fd292a027d698d95db427c5d" [[override]] name = "github.com/russross/blackfriday" @@ -106,11 +114,3 @@ [prune] go-tests = true unused-packages = true - -[[constraint]] - revision = "ee51b09a773c7e7e4e32168cbec4d47a014161b4" - name = "github.com/covexo/yamlq" - -[[constraint]] - name = "github.com/imdario/mergo" - version = "v0.3.6" From bd5aad5129121dc91e504bb6a39b4b5d368d333f Mon Sep 17 00:00:00 2001 From: Fabian Kramm Date: Fri, 7 Sep 2018 11:36:25 +0200 Subject: [PATCH 6/7] Test build speed --- cmd/status_sync.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/status_sync.go b/cmd/status_sync.go index a01516a943..722aaa29bb 100644 --- a/cmd/status_sync.go +++ b/cmd/status_sync.go @@ -15,7 +15,7 @@ func (cmd *StatusCmd) RunStatusSync(cobraCmd *cobra.Command, args []string) { // config := configutil.GetConfig(false) // Read syncLog - cwd, err := os.Getwd() + /*cwd, err := os.Getwd() if err != nil { log.Fatal(err) } @@ -26,5 +26,5 @@ func (cmd *StatusCmd) RunStatusSync(cobraCmd *cobra.Command, args []string) { log.Fatalf("Couldn't read %s. Do you have a sync path configured?", syncLogPath) } - _ = strings.Split(string(data), "\n") + _ = strings.Split(string(data), "\n")*/ } From b4ae7a2f69ba7170252f424a67e1f06c1097bfc8 Mon Sep 17 00:00:00 2001 From: Fabian Kramm Date: Fri, 7 Sep 2018 11:38:20 +0200 Subject: [PATCH 7/7] Test Build speed --- cmd/status_sync.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cmd/status_sync.go b/cmd/status_sync.go index 722aaa29bb..55fdd15a83 100644 --- a/cmd/status_sync.go +++ b/cmd/status_sync.go @@ -1,12 +1,6 @@ package cmd import ( - "io/ioutil" - "os" - "path" - "strings" - - "github.com/covexo/devspace/pkg/util/log" "github.com/spf13/cobra" )