-
Notifications
You must be signed in to change notification settings - Fork 0
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 #2 from fluent-ci-templates/feat/aws-azure-circleci
feat: add yaml generators for circleci, aws, azure and gitlab
- Loading branch information
Showing
17 changed files
with
309 additions
and
23 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,12 +1,28 @@ | ||
# Do not edit this file directly. It is generated by Fluent GitLab CI | ||
|
||
codecov: | ||
.docker: | ||
image: denoland/deno:alpine | ||
services: | ||
- docker:${DOCKER_VERSION}-dind | ||
variables: | ||
DOCKER_HOST: tcp://docker:2376 | ||
DOCKER_TLS_VERIFY: "1" | ||
DOCKER_TLS_CERTDIR: /certs | ||
DOCKER_CERT_PATH: /certs/client | ||
DOCKER_DRIVER: overlay2 | ||
DOCKER_VERSION: 20.10.16 | ||
|
||
.dagger: | ||
extends: .docker | ||
before_script: | ||
- | | ||
deno install -A -r https://cli.fluentci.io -n fluentci | ||
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh | ||
sudo mv bin/dagger /usr/local/bin | ||
dagger version | ||
- apk add docker-cli curl unzip | ||
- deno install -A -r https://cli.fluentci.io -n fluentci | ||
- curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh | ||
- mv bin/dagger /usr/local/bin | ||
- dagger version | ||
|
||
codecov: | ||
extends: .dagger | ||
script: | ||
- dagger run fluentci codecov_pipeline | ||
|
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 @@ | ||
# Do not edit this file directly. It is generated by https://deno.land/x/fluent_azure_pipelines | ||
|
||
trigger: | ||
- master | ||
pool: | ||
name: Default | ||
vmImage: ubuntu-latest | ||
steps: | ||
- script: | | ||
curl -fsSL https://deno.land/x/install/install.sh | sh | ||
export DENO_INSTALL="$HOME/.deno" | ||
export PATH="$DENO_INSTALL/bin:$PATH" | ||
displayName: Install Deno | ||
- script: deno install -A -r https://cli.fluentci.io -n fluentci | ||
displayName: Setup Fluent CI CLI | ||
- script: | | ||
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh | ||
sudo mv bin/dagger /usr/local/bin | ||
dagger version | ||
displayName: Setup Dagger | ||
- script: dagger run fluentci codecov_pipeline | ||
displayName: Upload Coverage |
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,19 @@ | ||
# Do not edit this file directly. It is generated by https://deno.land/x/fluent_aws_codepipeline | ||
|
||
version: 0.2 | ||
phases: | ||
install: | ||
commands: | ||
- curl -fsSL https://deno.land/x/install/install.sh | sh | ||
- export DENO_INSTALL="$HOME/.deno" | ||
- export PATH="$DENO_INSTALL/bin:$PATH" | ||
- deno install -A -r https://cli.fluentci.io -n fluentci | ||
- curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh | ||
- mv bin/dagger /usr/local/bin | ||
- dagger version | ||
build: | ||
commands: | ||
- dagger run fluentci codecov_pipeline | ||
post_build: | ||
commands: | ||
- echo Build completed on `date` |
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,26 @@ | ||
# Do not edit this file directly. It is generated by https://deno.land/x/fluent_circleci | ||
|
||
version: 2.1 | ||
jobs: | ||
codecov: | ||
steps: | ||
- checkout | ||
- run: sudo apt-get update && sudo apt-get install -y curl unzip | ||
- run: | | ||
curl -fsSL https://deno.land/x/install/install.sh | sh | ||
export DENO_INSTALL="$HOME/.deno" | ||
export PATH="$DENO_INSTALL/bin:$PATH" | ||
- run: deno install -A -r https://cli.fluentci.io -n fluentci | ||
- run: | | ||
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh | ||
sudo mv bin/dagger /usr/local/bin | ||
dagger version | ||
- run: | ||
name: Upload Coverage | ||
command: dagger run fluentci codecov_pipeline | ||
machine: | ||
image: ubuntu-2004:2023.07.1 | ||
workflows: | ||
dagger: | ||
jobs: | ||
- codecov |
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,24 @@ | ||
import { BuildSpec } from "fluent_aws_codepipeline"; | ||
|
||
export function generateYaml(): BuildSpec { | ||
const buildspec = new BuildSpec(); | ||
buildspec | ||
.phase("install", { | ||
commands: [ | ||
"curl -fsSL https://deno.land/x/install/install.sh | sh", | ||
'export DENO_INSTALL="$HOME/.deno"', | ||
'export PATH="$DENO_INSTALL/bin:$PATH"', | ||
"deno install -A -r https://cli.fluentci.io -n fluentci", | ||
"curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh", | ||
"mv bin/dagger /usr/local/bin", | ||
"dagger version", | ||
], | ||
}) | ||
.phase("build", { | ||
commands: ["dagger run fluentci codecov_pipeline"], | ||
}) | ||
.phase("post_build", { | ||
commands: ["echo Build completed on `date`"], | ||
}); | ||
return buildspec; | ||
} |
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,9 @@ | ||
import { assertEquals } from "https://deno.land/std@0.191.0/testing/asserts.ts"; | ||
import { generateYaml } from "./config.ts"; | ||
|
||
Deno.test(function generateAWSCodePipelineTest() { | ||
const buildspec = generateYaml(); | ||
const actual = buildspec.toString(); | ||
const expected = Deno.readTextFileSync("./fixtures/buildspec.yml"); | ||
assertEquals(actual, expected); | ||
}); |
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,3 @@ | ||
import { generateYaml } from "./config.ts"; | ||
|
||
generateYaml().save("buildspec.yml"); |
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,41 @@ | ||
import { AzurePipeline } from "fluent_azure_pipelines"; | ||
|
||
export function generateYaml(): AzurePipeline { | ||
const azurePipeline = new AzurePipeline(); | ||
|
||
const installDeno = `\ | ||
curl -fsSL https://deno.land/x/install/install.sh | sh | ||
export DENO_INSTALL="$HOME/.deno" | ||
export PATH="$DENO_INSTALL/bin:$PATH" | ||
`; | ||
|
||
const setupDagger = `\ | ||
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh | ||
sudo mv bin/dagger /usr/local/bin | ||
dagger version | ||
`; | ||
|
||
azurePipeline | ||
.trigger(["master"]) | ||
.pool({ | ||
name: "Default", | ||
vmImage: "ubuntu-latest", | ||
}) | ||
.step({ | ||
script: installDeno, | ||
displayName: "Install Deno", | ||
}) | ||
.step({ | ||
script: "deno install -A -r https://cli.fluentci.io -n fluentci", | ||
displayName: "Setup Fluent CI CLI", | ||
}) | ||
.step({ | ||
script: setupDagger, | ||
displayName: "Setup Dagger", | ||
}) | ||
.step({ | ||
script: "dagger run fluentci codecov_pipeline", | ||
displayName: "Upload Coverage", | ||
}); | ||
return azurePipeline; | ||
} |
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,9 @@ | ||
import { assertEquals } from "https://deno.land/std@0.191.0/testing/asserts.ts"; | ||
import { generateYaml } from "./config.ts"; | ||
|
||
Deno.test(function generateAzurePipelinesTest() { | ||
const azurepipelines = generateYaml(); | ||
const actual = azurepipelines.toString(); | ||
const expected = Deno.readTextFileSync("./fixtures/azure-pipelines.yml"); | ||
assertEquals(actual, expected); | ||
}); |
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,3 @@ | ||
import { generateYaml } from "./config.ts"; | ||
|
||
generateYaml().save("azure-pipeline.yml"); |
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,37 @@ | ||
import { CircleCI, Job } from "fluent_circleci"; | ||
|
||
export function generateYaml(): CircleCI { | ||
const circleci = new CircleCI(); | ||
|
||
const codecov = new Job().machine({ image: "ubuntu-2004:2023.07.1" }).steps([ | ||
"checkout", | ||
{ | ||
run: "sudo apt-get update && sudo apt-get install -y curl unzip", | ||
}, | ||
{ | ||
run: `\ | ||
curl -fsSL https://deno.land/x/install/install.sh | sh | ||
export DENO_INSTALL="$HOME/.deno" | ||
export PATH="$DENO_INSTALL/bin:$PATH"`, | ||
}, | ||
{ | ||
run: "deno install -A -r https://cli.fluentci.io -n fluentci", | ||
}, | ||
{ | ||
run: `\ | ||
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh | ||
sudo mv bin/dagger /usr/local/bin | ||
dagger version`, | ||
}, | ||
{ | ||
run: { | ||
name: "Upload Coverage", | ||
command: "dagger run fluentci codecov_pipeline", | ||
}, | ||
}, | ||
]); | ||
|
||
circleci.jobs({ codecov }).workflow("dagger", ["codecov"]); | ||
|
||
return circleci; | ||
} |
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,9 @@ | ||
import { assertEquals } from "https://deno.land/std@0.191.0/testing/asserts.ts"; | ||
import { generateYaml } from "./config.ts"; | ||
|
||
Deno.test(function generateCircleCITest() { | ||
const circleci = generateYaml(); | ||
const actual = circleci.toString(); | ||
const expected = Deno.readTextFileSync("./fixtures/config.yml"); | ||
assertEquals(actual, expected); | ||
}); |
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,3 @@ | ||
import { generateYaml } from "./config.ts"; | ||
|
||
generateYaml().save(".circleci/config.yml"); |
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,17 +1,34 @@ | ||
import { GitlabCI, Job } from "fluent_gitlab_ci"; | ||
|
||
export function generateYaml(): GitlabCI { | ||
const setupDagger = ` | ||
deno install -A -r https://cli.fluentci.io -n fluentci | ||
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh | ||
sudo mv bin/dagger /usr/local/bin | ||
dagger version`; | ||
const docker = new Job() | ||
.image("denoland/deno:alpine") | ||
.services(["docker:${DOCKER_VERSION}-dind"]) | ||
.variables({ | ||
DOCKER_HOST: "tcp://docker:2376", | ||
DOCKER_TLS_VERIFY: "1", | ||
DOCKER_TLS_CERTDIR: "/certs", | ||
DOCKER_CERT_PATH: "/certs/client", | ||
DOCKER_DRIVER: "overlay2", | ||
DOCKER_VERSION: "20.10.16", | ||
}); | ||
|
||
const dagger = new Job().extends(".docker").beforeScript( | ||
` | ||
apk add docker-cli curl unzip | ||
deno install -A -r https://cli.fluentci.io -n fluentci | ||
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh | ||
mv bin/dagger /usr/local/bin | ||
dagger version | ||
` | ||
); | ||
|
||
const codecov = new Job() | ||
.beforeScript(setupDagger, { | ||
multiline: true, | ||
}) | ||
.extends(".dagger") | ||
.script("dagger run fluentci codecov_pipeline"); | ||
|
||
return new GitlabCI().addJob("codecov", codecov); | ||
return new GitlabCI() | ||
.addJob(".docker", docker) | ||
.addJob(".dagger", dagger) | ||
.addJob("codecov", codecov); | ||
} |