Skip to content

Commit

Permalink
Gearing up for namespace change (#361)
Browse files Browse the repository at this point in the history
* Gearing up for namespace change
* gofmt diff compliance checks
* clean up build tags
* Adjust build tags
* remove drupal8 example test
* first attempt at fixing drupal tests
* more ci changes
* remove drupal9 elastic test - it broken
* adjust lando test
* adjust lando url reference
* also prune volumes

Signed-off-by: Karl Hepworth <karl.hepworth@gmail.com>
  • Loading branch information
fubarhouse committed Jan 7, 2022
1 parent 0c0d099 commit 93af147
Show file tree
Hide file tree
Showing 46 changed files with 157 additions and 127 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ name: goreleaser
on:
push:
branches:
- 'main'
- main
tags:
- 'v*'
pull_request:
branches:
- main

jobs:
goreleaser:
Expand Down
66 changes: 38 additions & 28 deletions .github/workflows/pygmy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ name: pygmy

on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types:
- created
schedule:
- cron: "0 0 * * *"

jobs:
basic:
Expand Down Expand Up @@ -133,20 +142,6 @@ jobs:
- name: Clone the official examples
run: |
git clone --recurse-submodules https://github.com/uselagoon/lagoon-examples.git
git clone -b 9.x https://github.com/amazeeio/drupal-example-simple.git lagoon-examples/drupal9-lagoon-simple-lando
- name: Drupal 8 Simple
run: |
cd lagoon-examples/drupal8-simple;
docker-compose -p drupal8-example-simple up -d;
docker-compose -p drupal8-example-simple exec -T cli composer install;
sleep 5;
curl --HEAD http://drupal8-example-simple.docker.amazee.io;
curl --HEAD http://drupal8-example-simple.docker.amazee.io | grep "X-LAGOON";
../../pygmy-go-linux-amd64 --config ../../examples/pygmy.basic.yml status | grep '\- http://drupal8-example-simple.docker.amazee.io';
docker-compose -p drupal8-example-simple down;
docker-compose -p drupal8-example-simple rm;
cd ../../;
- name: Drupal 9 Advanced
run: |
Expand All @@ -161,17 +156,30 @@ jobs:
docker-compose -p drupal9-advanced rm;
cd ../../;
- name: Drupal 9 Simple
- name: Drupal 9 Base
run: |
cd lagoon-examples/drupal9-base;
docker-compose -p drupal-base up -d;
docker-compose -p drupal-base exec -T cli composer install;
sleep 5;
curl --HEAD http://drupal9-base.docker.amazee.io;
curl --HEAD http://drupal9-base.docker.amazee.io | grep "X-LAGOON";
../../pygmy-go-linux-amd64 --config ../../examples/pygmy.basic.yml status | grep '\- http://drupal9-base.docker.amazee.io';
docker-compose -p drupal-base down;
docker-compose -p drupal-base rm;
cd ../../;
- name: Drupal 9 Postgres
run: |
cd lagoon-examples/drupal9-simple;
docker-compose -p drupal-example-simple up -d;
docker-compose -p drupal-example-simple exec -T cli composer install;
cd lagoon-examples/drupal9-postgres;
docker-compose -p drupal-postgres up -d;
docker-compose -p drupal-postgres exec -T cli composer install;
sleep 5;
curl --HEAD http://drupal9-example-simple.docker.amazee.io;
curl --HEAD http://drupal9-example-simple.docker.amazee.io | grep "X-LAGOON";
../../pygmy-go-linux-amd64 --config ../../examples/pygmy.basic.yml status | grep '\- http://drupal9-example-simple.docker.amazee.io';
docker-compose -p drupal-example-simple down;
docker-compose -p drupal-example-simple rm;
curl --HEAD http://drupal9-postgres.docker.amazee.io;
curl --HEAD http://drupal9-postgres.docker.amazee.io | grep "X-LAGOON";
../../pygmy-go-linux-amd64 --config ../../examples/pygmy.basic.yml status | grep '\- http://drupal9-postgres.docker.amazee.io';
docker-compose -p drupal-postgres down;
docker-compose -p drupal-postgres rm;
cd ../../;
- name: Node
Expand Down Expand Up @@ -226,15 +234,15 @@ jobs:
- name: Lando test - running Pygmy along-side Lando
run: |
cd lagoon-examples/drupal9-lagoon-simple-lando;
cd lagoon-examples/drupal9-base;
lando start || true;
sleep 5;
curl --HEAD http://drupal9-example-simple.lndo.site:8000;
curl --HEAD http://drupal9-example-simple.lndo.site:8000 | grep "X-Lagoon";
curl --HEAD http://drupal9-base.lndo.site:8000;
curl --HEAD http://drupal9-base.lndo.site:8000 | grep "X-Lagoon";
lando destroy -y;
cd ../../;
- name: Test the down commandWordpress
- name: Test the down command
run: |
./pygmy-go-linux-amd64 --config examples/pygmy.basic.yml down | grep 'Successfully stopped amazeeio';
./pygmy-go-linux-amd64 --config examples/pygmy.basic.yml status | grep '\[ \] amazeeio-' | grep 'is not running';
Expand All @@ -249,4 +257,6 @@ jobs:
run: ./pygmy-go-linux-amd64 clean;

- name: Cleanup after tests.
run: docker system prune --all --force
run: |
docker system prune --all --force
docker volume prune --force
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
builds/*
dist/*
vendor/*
vendor/*
.idea/*
6 changes: 3 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ brews:
- ids:
- pygmy-go
tap:
owner: fubarhouse
name: homebrew-pygmy-go
owner: pygmystack
name: homebrew-pygmy
folder: Formula
homepage: "https://github.com/fubarhouse/pygmy-go"
homepage: "https://github.com/pygmystack/pygmy"
description: "amazee.io's local development helper tool"
skip_upload: false
test: system "#{bin}/pygmy-go version"
Expand Down
34 changes: 17 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM golang:alpine as builder
LABEL stage=builder
COPY main.go /go/src/github.com/fubarhouse/pygmy-go/
COPY go.sum /go/src/github.com/fubarhouse/pygmy-go/
COPY go.mod /go/src/github.com/fubarhouse/pygmy-go/
COPY cmd/ /go/src/github.com/fubarhouse/pygmy-go/cmd/
COPY service/ /go/src/github.com/fubarhouse/pygmy-go/service/
COPY main.go /go/src/github.com/pygmystack/pygmy/
COPY go.sum /go/src/github.com/pygmystack/pygmy/
COPY go.mod /go/src/github.com/pygmystack/pygmy/
COPY cmd/ /go/src/github.com/pygmystack/pygmy/cmd/
COPY service/ /go/src/github.com/pygmystack/pygmy/service/

WORKDIR /go/src/github.com/fubarhouse/pygmy-go/
WORKDIR /go/src/github.com/pygmystack/pygmy/
RUN GO111MODULE=on go mod verify
RUN GO111MODULE=on GOOS=linux GOARCH=386 go build -o pygmy-go-linux-386 .
RUN GO111MODULE=on GOOS=linux GOARCH=386 CGO_ENABLED=0 go build -a -ldflags '-extldflags "-static"' -o pygmy-go-linux-386-static .
Expand All @@ -22,14 +22,14 @@ RUN GO111MODULE=on GOOS=windows GOARCH=amd64 go build -o pygmy-go.exe .

FROM alpine
WORKDIR /app
COPY --from=builder /go/src/github.com/fubarhouse/pygmy-go/pygmy-go-linux-386 .
COPY --from=builder /go/src/github.com/fubarhouse/pygmy-go/pygmy-go-linux-386-static .
COPY --from=builder /go/src/github.com/fubarhouse/pygmy-go/pygmy-go-linux-arm .
COPY --from=builder /go/src/github.com/fubarhouse/pygmy-go/pygmy-go-linux-arm-static .
COPY --from=builder /go/src/github.com/fubarhouse/pygmy-go/pygmy-go-linux-arm64 .
COPY --from=builder /go/src/github.com/fubarhouse/pygmy-go/pygmy-go-linux-arm64-static .
COPY --from=builder /go/src/github.com/fubarhouse/pygmy-go/pygmy-go-linux-amd64 .
COPY --from=builder /go/src/github.com/fubarhouse/pygmy-go/pygmy-go-linux-amd64-static .
COPY --from=builder /go/src/github.com/fubarhouse/pygmy-go/pygmy-go-darwin-amd64 .
COPY --from=builder /go/src/github.com/fubarhouse/pygmy-go/pygmy-go-darwin-arm64 .
COPY --from=builder /go/src/github.com/fubarhouse/pygmy-go/pygmy-go.exe .
COPY --from=builder /go/src/github.com/pygmystack/pygmy/pygmy-go-linux-386 .
COPY --from=builder /go/src/github.com/pygmystack/pygmy/pygmy-go-linux-386-static .
COPY --from=builder /go/src/github.com/pygmystack/pygmy/pygmy-go-linux-arm .
COPY --from=builder /go/src/github.com/pygmystack/pygmy/pygmy-go-linux-arm-static .
COPY --from=builder /go/src/github.com/pygmystack/pygmy/pygmy-go-linux-arm64 .
COPY --from=builder /go/src/github.com/pygmystack/pygmy/pygmy-go-linux-arm64-static .
COPY --from=builder /go/src/github.com/pygmystack/pygmy/pygmy-go-linux-amd64 .
COPY --from=builder /go/src/github.com/pygmystack/pygmy/pygmy-go-linux-amd64-static .
COPY --from=builder /go/src/github.com/pygmystack/pygmy/pygmy-go-darwin-amd64 .
COPY --from=builder /go/src/github.com/pygmystack/pygmy/pygmy-go-darwin-arm64 .
COPY --from=builder /go/src/github.com/pygmystack/pygmy/pygmy-go.exe .
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Pygmy

[![Stability](https://img.shields.io/badge/stability-stable-green.svg)]()
[![Travis CI](https://travis-ci.com/fubarhouse/pygmy-go.svg?branch=main)](https://travis-ci.com/fubarhouse/pygmy-go)
![goreleaser](https://github.com/fubarhouse/pygmy-go/workflows/goreleaser/badge.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/fubarhouse/pygmy-go)](https://goreportcard.com/report/github.com/fubarhouse/pygmy-go)
[![GoDoc](https://godoc.org/github.com/fubarhouse/pygmy-go?status.svg)](https://godoc.org/github.com/fubarhouse/pygmy-go)
![goreleaser](https://github.com/pygmystack/pygmy/workflows/goreleaser/badge.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/pygmystack/pygmy)](https://goreportcard.com/report/github.com/pygmystack/pygmy)
[![GoDoc](https://godoc.org/github.com/pygmystack/pygmy?status.svg)](https://godoc.org/github.com/pygmystack/pygmy)

This is an application written in Go which is a proposed replacement for [Pygmy](https://pygmy.readthedocs.io/en/master/)
currently written in Ruby. The goal is to provide a better cross-platform experience
Expand Down Expand Up @@ -44,7 +43,7 @@ configuration to switch out the `haproxy` image for a compatible one if you'd li
**Works for**: Linux, MacOS & Windows

```shell
git clone https://github.com/fubarhouse/pygmy-go.git && cd pygmy-go;
git clone https://github.com/pygmystack/pygmy.git && cd pygmy-go;
make build;
cp ./builds/pygmy-go-darwin /usr/local/bin/pygmy-go;
chmod +x /usr/local/bin/pygmy-go;
Expand All @@ -58,8 +57,8 @@ as `pygmy`. Now start Pygmy and use the new `status` command.
**Works for**: Linux & MacOS

```shell
brew tap fubarhouse/pygmy-go;
brew install pygmy-go;
brew tap pygmystack/pygmy;
brew install pygmy;
```

### Using the AUR
Expand Down Expand Up @@ -122,7 +121,7 @@ It will use `dind` and your local daemon to walk through several tests which sho

1. First clone the project:
```
git clone https://github.com/fubarhouse/pygmy-go.git pygmy-go && cd pygmy-go
git clone https://github.com/pygmystack/pygmy.git pygmy-go && cd pygmy-go
```
2. Perform any updates as required.
3. Clean the environment.
Expand Down
4 changes: 2 additions & 2 deletions cmd/addkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"fmt"
"os"

"github.com/fubarhouse/pygmy-go/service/interface/docker"
"github.com/fubarhouse/pygmy-go/service/library"
"github.com/pygmystack/pygmy/service/interface/docker"
"github.com/pygmystack/pygmy/service/library"
"github.com/spf13/cobra"
)

Expand Down
3 changes: 2 additions & 1 deletion cmd/clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
package cmd

import (
"github.com/fubarhouse/pygmy-go/service/library"
"github.com/spf13/cobra"

"github.com/pygmystack/pygmy/service/library"
)

// stopCmd represents the stop command
Expand Down
2 changes: 1 addition & 1 deletion cmd/down.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
package cmd

import (
"github.com/fubarhouse/pygmy-go/service/library"
"github.com/pygmystack/pygmy/service/library"
"github.com/spf13/cobra"
)

Expand Down
6 changes: 4 additions & 2 deletions cmd/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ package cmd

import (
"fmt"
"github.com/fubarhouse/pygmy-go/service/library"
"os"

"github.com/mitchellh/go-homedir"
"github.com/spf13/cobra"
"os"

"github.com/pygmystack/pygmy/service/library"
)

var exportPath string
Expand Down
2 changes: 1 addition & 1 deletion cmd/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
package cmd

import (
"github.com/fubarhouse/pygmy-go/service/library"
"github.com/pygmystack/pygmy/service/library"
"github.com/spf13/cobra"
)

Expand Down
3 changes: 2 additions & 1 deletion cmd/restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ import (
"fmt"
"os"

"github.com/fubarhouse/pygmy-go/service/library"
"github.com/mitchellh/go-homedir"
"github.com/spf13/cobra"

"github.com/pygmystack/pygmy/service/library"
)

// restartCmd represents the restart command
Expand Down
3 changes: 2 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ import (
"runtime"
"strings"

"github.com/fubarhouse/pygmy-go/service/library"
"github.com/mitchellh/go-homedir"
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/pygmystack/pygmy/service/library"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
package cmd

import (
"github.com/fubarhouse/pygmy-go/service/library"
"github.com/pygmystack/pygmy/service/library"
"github.com/spf13/cobra"
)

Expand Down
3 changes: 2 additions & 1 deletion cmd/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ import (
"fmt"
"os"

"github.com/fubarhouse/pygmy-go/service/library"
"github.com/mitchellh/go-homedir"
"github.com/spf13/cobra"

"github.com/pygmystack/pygmy/service/library"
)

// upCmd represents the up command
Expand Down
2 changes: 1 addition & 1 deletion cmd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
package cmd

import (
"github.com/fubarhouse/pygmy-go/service/library"
"github.com/pygmystack/pygmy/service/library"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
package cmd

import (
"github.com/fubarhouse/pygmy-go/service/library"
"github.com/pygmystack/pygmy/service/library"
"github.com/spf13/cobra"
)

Expand Down
6 changes: 3 additions & 3 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ Make sure you have the following dependencies installed:

### Installing from a precompiled binary

Releases on GitHub accompany binaries [available for download](https://github.com/fubarhouse/pygmy-go/releases).
Releases on GitHub accompany binaries [available for download](https://github.com/pygmystack/pygmy/releases).

To install it, put the binary into your system's `$PATH` environment variable and make it executable.

The following is an example of how you would do this, note the URL and location may change depending on your needs.
```console
$ wget https://github.com/fubarhouse/pygmy-go/releases/download/v0.1.0/pygmy-go-darwin
$ wget https://github.com/pygmystack/pygmy/releases/download/v0.1.0/pygmy-go-darwin
$ mv ./pygmy-go-darwin /usr/local/bin/pygmy
$ chmod u+x /usr/local/bin/pygmy
```
Expand All @@ -32,5 +32,5 @@ From here you can follow the guidance to install the relevant executable in the
The installation of `pygmy` is fairly simple and can be accomplished via the go toolchain

```console
$ go get github.com/fubarhouse/pygmy
$ go get github.com/pygmystack/pygmy
```
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/fubarhouse/pygmy-go
module github.com/pygmystack/pygmy

go 1.16

Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2019 NAME HERE <EMAIL ADDRESS>
// Copyright © 2019 Amazee.io <hello@amazee.io>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -21,7 +21,7 @@
package main

import (
"github.com/fubarhouse/pygmy-go/cmd"
"github.com/pygmystack/pygmy/cmd"
)

func main() {
Expand Down
Loading

0 comments on commit 93af147

Please sign in to comment.