Skip to content

Commit

Permalink
Merge pull request #42 from safesoftware/rename-to-fmeflow
Browse files Browse the repository at this point in the history
Update FME Server to FME Flow.
  • Loading branch information
garnold54 authored May 25, 2023
2 parents b91d02d + 54922da commit c9bd5e8
Show file tree
Hide file tree
Showing 87 changed files with 525 additions and 525 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ jobs:
run: |
export GOOS=${{ matrix.os }}
export GOARCH=${{ matrix.arch }}
CGO_ENABLED=0 go build -o fmeserver${{ matrix.exe-ext }} -ldflags="-X \"github.com/safesoftware/fmeserver-cli/cmd.appVersion=${{ env.APP_VERSION }}\""
CGO_ENABLED=0 go build -o fmeflow${{ matrix.exe-ext }} -ldflags="-X \"github.com/safesoftware/fmeflow-cli/cmd.appVersion=${{ env.APP_VERSION }}\""
- name: Upload artifact for later steps
uses: actions/upload-artifact@v3
with:
name: fmeserver-${{ matrix.os }}-${{ matrix.arch }}
path: fmeserver${{ matrix.exe-ext }}
name: fmeflow-${{ matrix.os }}-${{ matrix.arch }}
path: fmeflow${{ matrix.exe-ext }}
if-no-files-found: error

build-docker:
Expand All @@ -67,7 +67,7 @@ jobs:
with:
context: .
push: true
tags: safesoftware/fmeserver-cli:${{ env.APP_VERSION }}, safesoftware/fmeserver-cli:latest
tags: safesoftware/fmeflow-cli:${{ env.APP_VERSION }}, safesoftware/fmeflow-cli:latest
platforms: linux/amd64,linux/arm64
build-args: |
APP_VERSION=${{ env.APP_VERSION }}
Expand All @@ -80,7 +80,7 @@ jobs:
- name: Download
uses: actions/download-artifact@v3
with:
name: fmeserver-windows-amd64
name: fmeflow-windows-amd64

- name: Sign
env:
Expand All @@ -91,13 +91,13 @@ jobs:
$buffer = [System.Convert]::FromBase64String($env:SIGNCERT)
# Create new certificate object from the buffer and the certificate pass
$certificate = [System.Security.Cryptography.X509Certificates.X509Certificate2]::New($buffer, $env:CERTPASS)
Set-AuthenticodeSignature -HashAlgorithm SHA256 -Certificate $certificate -TimestampServer http://timestamp.digicert.com -FilePath fmeserver.exe
Set-AuthenticodeSignature -HashAlgorithm SHA256 -Certificate $certificate -TimestampServer http://timestamp.digicert.com -FilePath fmeflow.exe
- name: Reupload artifact
uses: actions/upload-artifact@v3
with:
name: fmeserver-windows-amd64
path: fmeserver.exe
name: fmeflow-windows-amd64
path: fmeflow.exe

sign-macosx:
name: Sign Mac Binaries
Expand All @@ -112,7 +112,7 @@ jobs:
- name: Download
uses: actions/download-artifact@v3
with:
name: fmeserver-${{ matrix.os }}-${{ matrix.arch }}
name: fmeflow-${{ matrix.os }}-${{ matrix.arch }}

- name: Codesign binaries
# Extract the secrets
Expand All @@ -138,7 +138,7 @@ jobs:
# We finally codesign our app bundle, specifying the Hardened runtime option
/usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" --options runtime fmeserver -v
/usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" --options runtime fmeflow -v
- name: "Notarize executable"
# Extract the secrets we defined earlier as environment variables
Expand All @@ -158,7 +158,7 @@ jobs:
# notarization service
echo "Creating temp notarization archive"
ditto -c -k --keepParent "fmeserver" "notarization.zip"
ditto -c -k --keepParent "fmeflow" "notarization.zip"
# Here we send the notarization request to the Apple's Notarization service, waiting for the result.
# This typically takes a few seconds inside a CI environment, but it might take more depending on the App
Expand All @@ -171,8 +171,8 @@ jobs:
- name: Reupload artifact
uses: actions/upload-artifact@v3
with:
name: fmeserver-${{ matrix.os }}-${{ matrix.arch }}
path: fmeserver
name: fmeflow-${{ matrix.os }}-${{ matrix.arch }}
path: fmeflow

compress-files:
name: Compress binaries and release
Expand Down Expand Up @@ -204,7 +204,7 @@ jobs:
- name: Download
uses: actions/download-artifact@v3
with:
name: fmeserver-${{ matrix.os }}-${{ matrix.arch }}
name: fmeflow-${{ matrix.os }}-${{ matrix.arch }}
path: release

- name: Copy license files for inclusion in zip package
Expand All @@ -218,13 +218,13 @@ jobs:
with:
type: ${{ matrix.type }}
directory: release
filename: ../fmeserver-${{ matrix.os }}-${{ matrix.arch }}.${{ matrix.zip-ext }}
filename: ../fmeflow-${{ matrix.os }}-${{ matrix.arch }}.${{ matrix.zip-ext }}

- name: Calculate MD5 hash
run: |
MD5_SUM=$(md5sum fmeserver-${{ matrix.os }}-${{ matrix.arch }}.${{ matrix.zip-ext }} | cut -d ' ' -f 1)
echo ${MD5_SUM} >fmeserver-${{ matrix.os }}-${{ matrix.arch }}.${{ matrix.zip-ext }}.md5
cat fmeserver-${{ matrix.os }}-${{ matrix.arch }}.${{ matrix.zip-ext }}.md5
MD5_SUM=$(md5sum fmeflow-${{ matrix.os }}-${{ matrix.arch }}.${{ matrix.zip-ext }} | cut -d ' ' -f 1)
echo ${MD5_SUM} >fmeflow-${{ matrix.os }}-${{ matrix.arch }}.${{ matrix.zip-ext }}.md5
cat fmeflow-${{ matrix.os }}-${{ matrix.arch }}.${{ matrix.zip-ext }}.md5
# Add compressed files and md5 hashes to the release
- uses: AButler/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
go-version: 1.19

- name: Test build
run: CGO_ENABLED=0 go build -o fmeserver -ldflags="-X \"github.com/safesoftware/fmeserver-cli/cmd.appVersion=$(echo ${GITHUB_REF} | rev | cut -d'/' -f 1 | rev )\""
run: CGO_ENABLED=0 go build -o fmeflow -ldflags="-X \"github.com/safesoftware/fmeflow-cli/cmd.appVersion=$(echo ${GITHUB_REF} | rev | cut -d'/' -f 1 | rev )\""

- name: Run tests
run: go test ./...
10 changes: 5 additions & 5 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
"command": "go",
"args": [
"build",
"-ldflags=\\\"-X github.com/safesoftware/fmeserver-cli/cmd.appVersion=$(git rev-parse --short HEAD)\\\"",
"-ldflags=\\\"-X github.com/safesoftware/fmeflow-cli/cmd.appVersion=$(git rev-parse --short HEAD)\\\"",
"-o",
"fmeserver.exe"
"fmeflow.exe"
]
},
"linux": {
"command": "go",
"args": [
"build",
"-ldflags=\"-X github.com/safesoftware/fmeserver-cli/cmd.appVersion=$(git rev-parse --short HEAD)\"",
"-ldflags=\"-X github.com/safesoftware/fmeflow-cli/cmd.appVersion=$(git rev-parse --short HEAD)\"",
"-o",
"fmeserver"
"fmeflow"
]
},
"problemMatcher": [],
Expand All @@ -31,7 +31,7 @@
{
"label": "Build Docker Image",
"type": "shell",
"command": "docker build -t safesoftware/fmeserver-cli .",
"command": "docker build -t safesoftware/fmeflow-cli .",
"group": {
"kind": "build"
}
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WORKDIR /app
COPY . .

# Build the executable
RUN CGO_ENABLED=0 go build -o fmeserver -ldflags="-X \"github.com/safesoftware/fmeserver-cli/cmd.appVersion=${APP_VERSION}\""
RUN CGO_ENABLED=0 go build -o fmeflow -ldflags="-X \"github.com/safesoftware/fmeflow-cli/cmd.appVersion=${APP_VERSION}\""

# Use distroless for final image
FROM gcr.io/distroless/static:nonroot
Expand All @@ -17,7 +17,7 @@ FROM gcr.io/distroless/static:nonroot
USER nonroot:nonroot

# copy compiled app
COPY --from=build --chown=nonroot:nonroot /app/fmeserver /fmeserver
COPY --from=build --chown=nonroot:nonroot /app/fmeflow /fmeflow

# run
ENTRYPOINT ["/fmeserver"]
ENTRYPOINT ["/fmeflow"]
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ This is a command line interface that utilizes the FME Server REST API to intera

### Installing

* Simply download the binary for your system from the [releases](https://github.com/safesoftware/fmeserver-cli/releases) page and extract it.
* On Unix systems, you may need to give the file execute permissions (e.g. `chmod +x fmeserver`). You can move the executable to a desired location (e.g. `mv fmeserver /usr/local/bin/fmeserver`)
* Simply download the binary for your system from the [releases](https://github.com/safesoftware/fmeflow-cli/releases) page and extract it.
* On Unix systems, you may need to give the file execute permissions (e.g. `chmod +x fmeflow`). You can move the executable to a desired location (e.g. `mv fmeflow /usr/local/bin/fmeflow`)

### Executing program

* Execute the program to get a high level overview of each command
```
fmeserver
fmeflow
```
* Log in to an existing FME Server. It is recommended to generate an API token using the FME Server Web UI initially and use that to log in.
```
fmeserver login https://my-fmeserver.com --token my-token-here
fmeflow login https://my-fmeflow.com --token my-token-here
```
* Your token and URL will be saved to a config file located in $HOME/.fmeserver-cli.yaml. Config file location can be overridden with the `--config` flag
* Your token and URL will be saved to a config file located in $HOME/.fmeflow-cli.yaml. Config file location can be overridden with the `--config` flag
* Test your credentials work
```
fmeserver info
fmeflow info
```

For full documentation of all commands, see the [Documentation](docs/fmeserver.md).
For full documentation of all commands, see the [Documentation](docs/fmeflow.md).

## Supported Versions of FME Flow

Expand All @@ -43,7 +43,7 @@ go run main.go
```
* Build binary
```
go build -o fmeserver
go build -o fmeflow
```

A great resource for adding new structs to represent JSON returned from FME Server is this [JSON to Go converter](https://mholt.github.io/json-to-go/) which will create a Go struct for you from a JSON sample.
8 changes: 4 additions & 4 deletions cmd/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ func newBackupCmd() *cobra.Command {
},
Example: `
# back up to a local file
fmeserver backup -f my_local_backup.fsconfig
fmeflow backup -f my_local_backup.fsconfig
# back up to the "Backup" folder in the FME Server Shared Resources with the file name my_fme_backup.fsconfig
fmeserver backup --resource --export-package my_fme_backup.fsconfig`,
fmeflow backup --resource --export-package my_fme_backup.fsconfig`,
Args: NoArgs,
RunE: backupRun(&f),
}
Expand Down Expand Up @@ -84,7 +84,7 @@ func backupRun(f *backupFlags) func(cmd *cobra.Command, args []string) error {
"exportPackageName": {f.outputBackupFile},
}

request, err := buildFmeServerRequest("/fmerest/v3/migration/backup/download", "POST", strings.NewReader(data.Encode()))
request, err := buildFmeFlowRequest("/fmerest/v3/migration/backup/download", "POST", strings.NewReader(data.Encode()))
if err != nil {
return err
}
Expand Down Expand Up @@ -132,7 +132,7 @@ func backupRun(f *backupFlags) func(cmd *cobra.Command, args []string) error {
data.Add("failureTopic", f.backupFailureTopic)
}

request, err := buildFmeServerRequest("/fmerest/v3/migration/backup/resource", "POST", strings.NewReader(data.Encode()))
request, err := buildFmeFlowRequest("/fmerest/v3/migration/backup/resource", "POST", strings.NewReader(data.Encode()))
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func TestBackup(t *testing.T) {
okResponseV3 := `Random file contents`

// generate random file to back up to
f, err := os.CreateTemp("", "*fmeserver-backup.fsconfig")
f, err := os.CreateTemp("", "*fmeflow-backup.fsconfig")
require.NoError(t, err)
defer os.Remove(f.Name()) // clean up

Expand Down
10 changes: 5 additions & 5 deletions cmd/cancel.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func newCancelCmd() *cobra.Command {
Long: `Cancels the job and marks it as aborted in the completed jobs section, but does not remove it from the database.`,
Example: `
# Cancel a job with id 42
fmeserver cancel --id 42
fmeflow cancel --id 42
`,
Args: NoArgs,
RunE: runCancel(&f),
Expand All @@ -56,8 +56,8 @@ func runCancel(f *cancelFlags) func(cmd *cobra.Command, args []string) error {
// get build to decide if we should use v3 or v4
// FME Server 2022.0 and later can use v4. Otherwise fall back to v3
if f.apiVersion == "" {
fmeserverBuild := viper.GetInt("build")
if fmeserverBuild < cancelV4BuildThreshold {
fmeflowBuild := viper.GetInt("build")
if fmeflowBuild < cancelV4BuildThreshold {
f.apiVersion = apiVersionFlagV3
} else {
f.apiVersion = apiVersionFlagV4
Expand All @@ -67,7 +67,7 @@ func runCancel(f *cancelFlags) func(cmd *cobra.Command, args []string) error {
if f.apiVersion == "v4" {
endpoint := "/fmeapiv4/jobs/" + f.id + "/cancel"

request, err := buildFmeServerRequest(endpoint, "POST", nil)
request, err := buildFmeFlowRequest(endpoint, "POST", nil)
if err != nil {
return err
}
Expand Down Expand Up @@ -114,7 +114,7 @@ func runCancel(f *cancelFlags) func(cmd *cobra.Command, args []string) error {
} else if f.apiVersion == "v3" {

// call the status endpoint to see if it is finished
request, err := buildFmeServerRequest("/fmerest/v3/transformations/jobs/running/"+f.id, "DELETE", nil)
request, err := buildFmeFlowRequest("/fmerest/v3/transformations/jobs/running/"+f.id, "DELETE", nil)
if err != nil {
return err
}
Expand Down
8 changes: 4 additions & 4 deletions cmd/deploymentparameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ func newDeploymentParametersCmd() *cobra.Command {
Example: `
Examples:
# List all deployment parameters
fmeserver deploymentparameters
fmeflow deploymentparameters
# List a single deployment parameter
fmeserver deploymentparameters --name testParameter
fmeflow deploymentparameters --name testParameter
# Output all deploymentparameters in json format
fmeserver deploymentparameters --json`,
fmeflow deploymentparameters --json`,
Args: NoArgs,
RunE: deploymentParametersRun(&f),
}
Expand Down Expand Up @@ -84,7 +84,7 @@ func deploymentParametersRun(f *deploymentparametersFlags) func(cmd *cobra.Comma
// add the repository name to the request if specified
url = url + "/" + f.name
}
request, err := buildFmeServerRequest(url, "GET", nil)
request, err := buildFmeFlowRequest(url, "GET", nil)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/deploymentparameters_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func newDeploymentParameterCreateCmd() *cobra.Command {
Example: `
Examples:
# Create a deployment parameter with the name "myParam" and the value "myValue"
fmeserver deploymentparameters create --name myParam --value myValue
fmeflow deploymentparameters create --name myParam --value myValue
`,

Args: NoArgs,
Expand Down Expand Up @@ -64,7 +64,7 @@ func deploymentParametersCreateRun(f *deploymentParameterCreateFlags) func(cmd *
return err
}

request, err := buildFmeServerRequest("/fmeapiv4/deploymentparameters", "POST", bytes.NewBuffer(jsonData))
request, err := buildFmeFlowRequest("/fmeapiv4/deploymentparameters", "POST", bytes.NewBuffer(jsonData))
if err != nil {
return err
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/deploymentparameters_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ func newDeploymentParameterDeleteCmd() *cobra.Command {
Example: `
Examples:
# Delete adeployment parameter with the name "myParam"
fmeserver deploymentparameters delete --name myParam
fmeflow deploymentparameters delete --name myParam
# Delete a repository with the name "myRepository" and no confirmation
fmeserver deploymentparameters delete --name myParam --no-prompt
fmeflow deploymentparameters delete --name myParam --no-prompt
`,
Args: NoArgs,
RunE: deploymentParameterDeleteRun(&f),
Expand Down Expand Up @@ -58,7 +58,7 @@ func deploymentParameterDeleteRun(f *deploymentParameterDeleteFlags) func(cmd *c
}
}

request, err := buildFmeServerRequest("/fmeapiv4/deploymentparameters/"+f.name, "DELETE", nil)
request, err := buildFmeFlowRequest("/fmeapiv4/deploymentparameters/"+f.name, "DELETE", nil)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/deploymentparameters_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func newDeploymentParameterUpdateCmd() *cobra.Command {
Example: `
Examples:
# Update a deployment parameter with the name "myParam" and the value "myValue"
fmeserver deploymentparameters update --name myParam --value myValue
fmeflow deploymentparameters update --name myParam --value myValue
`,

Args: NoArgs,
Expand All @@ -56,7 +56,7 @@ func deploymentParametersUpdateRun(f *deploymentParameterUpdateFlags) func(cmd *
return err
}

request, err := buildFmeServerRequest("/fmeapiv4/deploymentparameters/"+f.name, "PUT", bytes.NewBuffer(jsonData))
request, err := buildFmeFlowRequest("/fmeapiv4/deploymentparameters/"+f.name, "PUT", bytes.NewBuffer(jsonData))
if err != nil {
return err
}
Expand Down
Loading

0 comments on commit c9bd5e8

Please sign in to comment.