Skip to content

Commit

Permalink
Excavator: Render CircleCI file using template specified in .circleci…
Browse files Browse the repository at this point in the history
…/template.sh (#53)

###### _excavator_ is a bot for automating changes across repositories.

Changes produced by the excavator/manage-circleci-oss check.

To enable or disable this check, please contact the maintainers of Excavator.
  • Loading branch information
svc-excavator-bot authored and dansanduleac committed Jul 28, 2018
1 parent 6e1fe4b commit 36eb9da
Show file tree
Hide file tree
Showing 6 changed files with 148 additions and 75 deletions.
128 changes: 128 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# This file was generated by the excavator check 'excavator/manage-circleci' as specified in .circleci/template.sh.
# To request a modification to the general template, file an issue on Excavator.
# To manually manage the CircleCI configuration for this project, remove the .circleci/template.sh file.

working_dir: &working_dir
working_directory: /go/src/github.com/palantir/go-java-launcher

darwin-linux-no-cgo: &darwin-linux-no-cgo
<<: *working_dir
docker:
- image: nmiyake/go:go-darwin-linux-no-cgo-1.10.3-t130
environment:
CGO_ENABLED: 0

go-version: &go-version
run: go version

godel-cache-restore: &godel-cache-restore
restore_cache:
keys:
- godel-cache-{{ checksum "godelw" }}-v1

godel-version: &godel-version
run: ./godelw version

godel-cache-save: &godel-cache-save
save_cache:
key: godel-cache-{{ checksum "godelw" }}-v1
paths:
- ~/.godel

define-tests-dir: &define-tests-dir
run: echo 'export TESTS_DIR=/tmp/test-results' >> $BASH_ENV

mkdir-tests-dir: &mkdir-tests-dir
run: mkdir -p "${TESTS_DIR}"

godelw-verify: &godelw-verify
run: ./godelw verify --apply=false --junit-output="$TESTS_DIR/$CIRCLE_PROJECT_REPONAME-tests.xml"

store-test-results: &store-test-results
type: test-results-store
path: /tmp/test-results

store-artifacts: &store-artifacts
type: artifacts-store
path: /tmp/test-results
destination: test-results

version: 2
jobs:
verify:
<<: *darwin-linux-no-cgo
steps:
- checkout
- *go-version
- *godel-cache-restore
- *godel-version
- *godel-cache-save
- run: ./godelw verify --apply=false --skip-test
test:
<<: *darwin-linux-no-cgo
steps:
- checkout
- *go-version
- *godel-cache-restore
- *godel-version
- *godel-cache-save
- *define-tests-dir
- *mkdir-tests-dir
- run: ./godelw test --junit-output="$TESTS_DIR/$CIRCLE_PROJECT_REPONAME-tests.xml"
- *store-test-results
- *store-artifacts
dist:
<<: *darwin-linux-no-cgo
steps:
- checkout
- *go-version
- *godel-cache-restore
- *godel-version
- *godel-cache-save
- run: ./godelw dist
- save_cache:
key: dist-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ .Environment.CIRCLE_SHA1 }}-v1
paths:
- out
publish:
<<: *darwin-linux-no-cgo
steps:
- checkout
- *go-version
- *godel-cache-restore
- *godel-version
- restore_cache:
keys:
- dist-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ .Environment.CIRCLE_SHA1 }}-v1
# gödel cache only works if cached outputs are newer than source that generates it. CircleCI restore_cache restores
# the cache with the original modification dates, but the source's modification date in CI is the time of checkout.
# Manually touch all of the cache output to mark it as being generated after source was checked out.
- run: find out -exec touch {} \;
- run: ./godelw publish bintray --url https://api.bintray.com --subject palantir --repository releases --username "$BINTRAY_USERNAME" --password "$BINTRAY_PASSWORD" --publish --downloads-list

### Workflows ###
requires_products: &requires_products
- verify
- test
- dist

all-tags-filter: &all-tags-filter
filters: { tags: { only: /.*/ } }

workflows:
version: 2
build-publish:
jobs:
- verify:
<<: *all-tags-filter
- test:
<<: *all-tags-filter
- dist:
<<: *all-tags-filter
- publish:
requires: *requires_products
filters:
tags:
only: /^v?[0-9]+(\.[0-9]+)+(-rc[0-9]+)?(-alpha[0-9]+)?$/
branches:
ignore: /.*/
54 changes: 0 additions & 54 deletions circle.yml

This file was deleted.

14 changes: 14 additions & 0 deletions integration_test/go_java_launcher_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
package integration_test

import (
"log"
"os"
"os/exec"
"path/filepath"
"testing"

"github.com/palantir/godel/pkg/products/v2/products"
Expand Down Expand Up @@ -73,3 +75,15 @@ func runMainWithArgs(t *testing.T, staticConfigFile, customConfigFile string) (s
outputBytes, err := cmd.CombinedOutput()
return string(outputBytes), err
}

func TestMain(m *testing.M) {
jdkDir := "jdk"
javaHome, err := filepath.Abs(jdkDir)
if err != nil {
log.Fatalf("Failed to calculate absolute path of '%s': %v\n", jdkDir, err)
}
if err := os.Setenv("JAVA_HOME", javaHome); err != nil {
log.Fatalln("Failed to set a mock JAVA_HOME", err)
}
os.Exit(m.Run())
}
6 changes: 6 additions & 0 deletions integration_test/jdk/bin/java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

echo
echo "main method"

sleep 5
Binary file removed integration_test/testdata/Main.class
Binary file not shown.
21 changes: 0 additions & 21 deletions integration_test/testdata/Main.java

This file was deleted.

0 comments on commit 36eb9da

Please sign in to comment.