-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from leopardslab/develop
Merge Release v1.2.3 to master
- Loading branch information
Showing
15 changed files
with
792 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,5 @@ coverage* | |
.idea/* | ||
|
||
snap.login | ||
|
||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,71 @@ | ||
language: go | ||
|
||
go: | ||
- 1.11.x | ||
- master | ||
|
||
services: | ||
- docker | ||
|
||
env: | ||
global: | ||
- DEP_VERSION="0.5.0" | ||
- PATH=/snap/bin:$PATH | ||
services: | ||
- docker | ||
|
||
addons: | ||
apt: | ||
update: true | ||
packages: | ||
- rpm | ||
- snapd | ||
|
||
before_install: | ||
- rpmbuild --version | ||
- openssl aes-256-cbc -K $encrypted_12c8071d2874_key -iv $encrypted_12c8071d2874_iv | ||
-in snap.login.enc -out snap.login -d | ||
- curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 | ||
-o $GOPATH/bin/dep | ||
- chmod +x $GOPATH/bin/dep | ||
|
||
install: | ||
- make setup | ||
- sudo snap install snapcraft --classic | ||
|
||
script: | ||
- make ci | ||
|
||
after_success: | ||
- bash <(curl -s https://codecov.io/bash) | ||
- test -n "$TRAVIS_TAG" && snapcraft login --with snap.login | ||
|
||
deploy: | ||
|
||
- provider: script | ||
skip_cleanup: true | ||
script: curl -sL https://git.io/goreleaser | bash -s -- --rm-dist | ||
verbose: true | ||
on: | ||
tags: true | ||
condition: "$TRAVIS_OS_NAME = linux" | ||
branch: master | ||
go: 1.11.x | ||
|
||
- provider: script | ||
skip_cleanup: true | ||
script: bash release/publish_rpm_to_bintray.sh | ||
verbose: true | ||
on: | ||
tags: true | ||
condition: "$TRAVIS_OS_NAME = linux" | ||
branch: master | ||
go: 1.11.x | ||
|
||
- provider: script | ||
skip_cleanup: true | ||
script: curl -sL https://git.io/goreleaser | bash | ||
script: bash release/publish_deb_to_bintray.sh | ||
verbose: true | ||
on: | ||
tags: true | ||
condition: "$TRAVIS_OS_NAME = linux" | ||
master: true | ||
branch: master | ||
go: 1.11.x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/leopardslab/dunner/internal/logger" | ||
"github.com/leopardslab/dunner/pkg/initialize" | ||
"github.com/spf13/cobra" | ||
"github.com/spf13/viper" | ||
) | ||
|
||
func init() { | ||
rootCmd.AddCommand(initCmd) | ||
} | ||
|
||
var initCmd = &cobra.Command{ | ||
Use: "init", | ||
Short: "Generates a dunner task file `.dunner.yaml`", | ||
Long: "You can initialize any project with dunner task file. It generates a default task file `.dunner.yaml`, you can customize it based on needs. You can override the name of task file using -t flag.", | ||
Run: Initialize, | ||
Args: cobra.NoArgs, | ||
Aliases: []string{"i"}, | ||
} | ||
|
||
// Initialize command invoked from command line generates a dunner task file with default template | ||
func Initialize(_ *cobra.Command, args []string) { | ||
var dunnerFile = viper.GetString("DunnerTaskFile") | ||
if err := initialize.InitProject(dunnerFile); err != nil { | ||
logger.Log.Fatalf("Failed to initialize project: %s", err.Error()) | ||
} | ||
logger.Log.Infof("Dunner task file `%s` created. Please make any required changes.", dunnerFile) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package internal | ||
|
||
// DefaultTaskFileContents is the default dunner taskfile contents, used when initialized with dunner | ||
const DefaultTaskFileContents = `# This is an example dunner task file. Please make any required changes. | ||
build: | ||
- name: setup | ||
# Image name that has to be pulled from a registry | ||
image: node:latest | ||
# List of commands that has to be run inside the container | ||
commands: | ||
- ["npm", "--version"] | ||
- ["npm", "install"] | ||
# (Optional) List of directories that are to be mounted on the container | ||
mounts: | ||
- /tmp:/tmp:w | ||
# (Optional) Set any environment variables to be exported in the container | ||
envs: | ||
- PERM=775 | ||
` | ||
|
||
// DefaultTaskFilePermission is the default file permission of dunner task file | ||
const DefaultTaskFilePermission = 0644 |
Oops, something went wrong.