diff --git a/.gitignore b/.gitignore index 955b842b4..694d8c3c8 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ drone/drone *.txt *.out /.env +cmd/drone-server/.env extras/ release/ cli/release/ diff --git a/cmd/drone-server/main_test.go b/cmd/drone-server/main_test.go index c053a7e0f..82628bb1a 100644 --- a/cmd/drone-server/main_test.go +++ b/cmd/drone-server/main_test.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build manual - package main import ( @@ -21,27 +19,17 @@ import ( "os" "testing" + "github.com/joho/godotenv" _ "github.com/joho/godotenv/autoload" "github.com/laszlocph/drone-oss-08/version" "github.com/urfave/cli" ) func Test_main(t *testing.T) { - os.Setenv("KUBECONFIG", "/home/laszlo/go/src/github.com/laszlocph/drone-oss-08/kubeconfig.yaml") - os.Setenv("DRONE_HOST", "xxx") - os.Setenv("DRONE_GITHUB", "true") - // os.Setenv("DATABASE_CONFIG", "/var/lib/drone/drone.sqlite") - os.Setenv("DATABASE_DRIVER", "sqlite3") - os.Setenv("DRONE_DEBUG", "true") - os.Setenv("DRONE_KUBERNETES", "true") - os.Setenv("DRONE_KUBERNETES_NAMESPACE", "default") - os.Setenv("DRONE_KUBERNETES_STORAGECLASS", "example-nfs") - os.Setenv("DRONE_KUBERNETES_VOLUME_SIZE", "100Mi") - - os.Setenv("DRONE_ADMIN", "laszlocph") - os.Setenv("DRONE_OPEN", "true") - os.Setenv("DRONE_GITHUB_CLIENT", "xxx") - os.Setenv("DRONE_GITHUB_SECRET", "xxx") + err := godotenv.Load() + if err != nil { + fmt.Println("Error loading .env file") + } app := cli.NewApp() app.Name = "drone-server" diff --git a/docker-compose.k3s.yml b/docker-compose.k3s.yml index 332e3739c..058cd4bb2 100644 --- a/docker-compose.k3s.yml +++ b/docker-compose.k3s.yml @@ -1,7 +1,7 @@ version: '3' services: server: - image: rancher/k3s:v0.4.0 + image: rancher/k3s:v0.7.0-rc2 command: server --disable-agent environment: - K3S_CLUSTER_SECRET=somethingtotallyrandom @@ -15,7 +15,7 @@ services: - 6443:6443 node: - image: rancher/k3s:v0.4.0 + image: rancher/k3s:v0.7.0-rc2 tmpfs: - /run - /var/run