Merge branch 'main' into main

This commit is contained in:
Ruud Senden
2021-09-17 12:38:42 +02:00
committed by GitHub
54 changed files with 165 additions and 122 deletions
+27
View File
@@ -0,0 +1,27 @@
name: Makefile CI
on:
push:
branches: [ $default-branch ]
pull_request:
branches: [ $default-branch ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: configure
run: ./configure
- name: Install dependencies
run: make
- name: Run check
run: make check
- name: Run distcheck
run: make distcheck
View File
View File
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Ada", "name": "Ada",
"description": "Build Ada project with GPRbuild.", "description": "Build Ada project with GPRbuild.",
"iconName": "ada", "iconName": "ada",
"categories": ["Ada"] "categories": ["Continuous integration", "Ada"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Android CI", "name": "Android CI",
"description": "Build an Android project with Gradle.", "description": "Build an Android project with Gradle.",
"iconName": "android", "iconName": "android",
"categories": ["Java", "Mobile"] "categories": ["Continuous integration", "Java", "Mobile"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Java with Ant", "name": "Java with Ant",
"description": "Build and test a Java project with Apache Ant.", "description": "Build and test a Java project with Apache Ant.",
"iconName": "ant", "iconName": "ant",
"categories": ["Ant", "Java"] "categories": ["Continuous integration", "Ant", "Java"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "C/C++ with Make", "name": "C/C++ with Make",
"description": "Build and test a C/C++ project using Make.", "description": "Build and test a C/C++ project using Make.",
"iconName": "c-cpp", "iconName": "c-cpp",
"categories": ["C", "C++"] "categories": ["Continuous integration", "C", "C++"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Clojure", "name": "Clojure",
"description": "Build and test a Clojure project with Leiningen.", "description": "Build and test a Clojure project with Leiningen.",
"iconName": "clojure", "iconName": "clojure",
"categories": ["Clojure", "Java"] "categories": ["Continuous integration", "Clojure", "Java"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "CMake based projects", "name": "CMake based projects",
"description": "Build and test a CMake based project.", "description": "Build and test a CMake based project.",
"iconName": "cmake", "iconName": "cmake",
"categories": ["C", "C++"] "categories": ["Continuous integration", "C", "C++"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Crystal", "name": "Crystal",
"description": "Build and test a Crystal project.", "description": "Build and test a Crystal project.",
"iconName": "crystal", "iconName": "crystal",
"categories": ["Crystal"] "categories": ["Continuous integration", "Crystal"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "D", "name": "D",
"description": "Build and test a D project with dub.", "description": "Build and test a D project with dub.",
"iconName": "d", "iconName": "d",
"categories": [ "D" ] "categories": ["Continuous integration", "D"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Dart", "name": "Dart",
"description": "Build and test a Dart project with Pub.", "description": "Build and test a Dart project with Pub.",
"iconName": "dart", "iconName": "dart",
"categories": ["Dart"] "categories": ["Continuous integration", "Dart"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Deno", "name": "Deno",
"description": "Test your Deno project", "description": "Test your Deno project",
"iconName": "deno", "iconName": "deno",
"categories": ["JavaScript", "TypeScript", "Deno"] "categories": ["Continuous integration", "JavaScript", "TypeScript", "Deno"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Django", "name": "Django",
"description": "Build and Test a Django Project", "description": "Build and Test a Django Project",
"iconName": "django", "iconName": "django",
"categories": ["Python", "Django"] "categories": ["Continuous integration", "Python", "Django"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Docker image", "name": "Docker image",
"description": "Build a Docker image to deploy, run, or push to a registry.", "description": "Build a Docker image to deploy, run, or push to a registry.",
"iconName": "docker", "iconName": "docker",
"categories": ["Dockerfile"] "categories": ["Continuous integration", "Dockerfile"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Publish Docker Container", "name": "Publish Docker Container",
"description": "Build, test and push Docker image to GitHub Packages.", "description": "Build, test and push Docker image to GitHub Packages.",
"iconName": "docker", "iconName": "docker",
"categories": ["Dockerfile"] "categories": ["Continuous integration", "Dockerfile"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": ".NET Desktop", "name": ".NET Desktop",
"description": "Build, test, sign and publish a desktop application built on .NET.", "description": "Build, test, sign and publish a desktop application built on .NET.",
"iconName": "dotnet", "iconName": "dotnet",
"categories": ["C#", "Visual Basic", "WPF", ".NET"] "categories": ["Continuous integration", "C#", "Visual Basic", "WPF", ".NET"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": ".NET", "name": ".NET",
"description": "Build and test a .NET or ASP.NET Core project.", "description": "Build and test a .NET or ASP.NET Core project.",
"iconName": "dotnet", "iconName": "dotnet",
"categories": ["C#", "F#", "Visual Basic", "ASP", "ASP.NET", ".NET"] "categories": ["Continuous integration", "C#", "F#", "Visual Basic", "ASP", "ASP.NET", ".NET", "AspNetCore", "DotNetConsole"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Elixir", "name": "Elixir",
"description": "Build and test an Elixir project with Mix.", "description": "Build and test an Elixir project with Mix.",
"iconName": "elixir", "iconName": "elixir",
"categories": ["Elixir", "Erlang"] "categories": ["Continuous integration", "Elixir", "Erlang"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Erlang", "name": "Erlang",
"description": "Build and test an Erlang project with rebar.", "description": "Build and test an Erlang project with rebar.",
"iconName": "erlang", "iconName": "erlang",
"categories": ["Erlang"] "categories": ["Continuous integration", "Erlang"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Ruby Gem", "name": "Ruby Gem",
"description": "Pushes a Ruby Gem to RubyGems and GitHub Package Registry.", "description": "Pushes a Ruby Gem to RubyGems and GitHub Package Registry.",
"iconName": "ruby-gems", "iconName": "ruby-gems",
"categories": ["Ruby"] "categories": ["Continuous integration", "Ruby"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Go", "name": "Go",
"description": "Build a Go project.", "description": "Build a Go project.",
"iconName": "go", "iconName": "go",
"categories": ["Go"] "categories": ["Continuous integration", "Go"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Publish Java Package with Gradle", "name": "Publish Java Package with Gradle",
"description": "Build a Java Package using Gradle and publish to GitHub Packages.", "description": "Build a Java Package using Gradle and publish to GitHub Packages.",
"iconName": "gradle", "iconName": "gradle",
"categories": ["Java", "Gradle", "Spring", "JSF"] "categories": ["Continuous integration", "Java", "Gradle", "Spring", "JSF"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Java with Gradle", "name": "Java with Gradle",
"description": "Build and test a Java project using a Gradle wrapper script.", "description": "Build and test a Java project using a Gradle wrapper script.",
"iconName": "gradle", "iconName": "gradle",
"categories": ["Java", "Gradle", "Spring", "JSF"] "categories": ["Continuous integration", "Java", "Gradle", "Spring", "JSF"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Haskell", "name": "Haskell",
"description": "Build and test a Haskell project with Cabal.", "description": "Build and test a Haskell project with Cabal.",
"iconName": "haskell", "iconName": "haskell",
"categories": ["Haskell"] "categories": ["Continuous integration", "Haskell"]
} }
+1
View File
@@ -3,6 +3,7 @@
"description": "Build and test an iOS application using xcodebuild and any available iPhone simulator.", "description": "Build and test an iOS application using xcodebuild and any available iPhone simulator.",
"iconName": "xcode", "iconName": "xcode",
"categories": [ "categories": [
"Continuous integration",
"iOS", "iOS",
"Xcode" "Xcode"
] ]
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Jekyll", "name": "Jekyll",
"description": "Package a Jekyll site using the jekyll/builder Docker image.", "description": "Package a Jekyll site using the jekyll/builder Docker image.",
"iconName": "jekyll", "iconName": "jekyll",
"categories": ["HTML"] "categories": ["Continuous integration", "HTML"]
} }
+1
View File
@@ -3,6 +3,7 @@
"description": "Test a Laravel project.", "description": "Test a Laravel project.",
"iconName": "php", "iconName": "php",
"categories": [ "categories": [
"Continuous integration",
"PHP", "PHP",
"Laravel" "Laravel"
] ]
+6
View File
@@ -0,0 +1,6 @@
{
"name": "Build projects with Make",
"description": "Build and test a project using Make.",
"iconName": "makefile",
"categories": ["Continuous integration", "Makefile"]
}
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Publish Java Package with Maven", "name": "Publish Java Package with Maven",
"description": "Build a Java Package using Maven and publish to GitHub Packages.", "description": "Build a Java Package using Maven and publish to GitHub Packages.",
"iconName": "maven", "iconName": "maven",
"categories": ["Java", "Maven", "Spring", "JSF"] "categories": ["Continuous integration", "Java", "Maven", "Spring", "JSF"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Java with Maven", "name": "Java with Maven",
"description": "Build and test a Java project with Apache Maven.", "description": "Build and test a Java project with Apache Maven.",
"iconName": "maven", "iconName": "maven",
"categories": ["Java", "Maven", "Spring", "JSF"] "categories": ["Continuous integration", "Java", "Maven", "Spring", "JSF"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "MSBuild based projects", "name": "MSBuild based projects",
"description": "Build a MSBuild based project.", "description": "Build a MSBuild based project.",
"iconName": "c-cpp", "iconName": "c-cpp",
"categories": ["C", "C++"] "categories": ["Continuous integration", "C", "C++"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Node.js", "name": "Node.js",
"description": "Build and test a Node.js project with npm.", "description": "Build and test a Node.js project with npm.",
"iconName": "nodejs", "iconName": "nodejs",
"categories": ["JavaScript", "npm", "React", "Angular"] "categories": ["Continuous integration", "JavaScript", "npm", "React", "Angular"]
} }
@@ -2,5 +2,5 @@
"name": "Grunt", "name": "Grunt",
"description": "Build a NodeJS project with npm and grunt.", "description": "Build a NodeJS project with npm and grunt.",
"iconName": "grunt", "iconName": "grunt",
"categories": ["JavaScript", "TypeScript", "npm", "Grunt"] "categories": ["Continuous integration", "JavaScript", "TypeScript", "npm", "Grunt"]
} }
@@ -2,5 +2,5 @@
"name": "Gulp", "name": "Gulp",
"description": "Build a NodeJS project with npm and gulp.", "description": "Build a NodeJS project with npm and gulp.",
"iconName": "gulp", "iconName": "gulp",
"categories": ["JavaScript", "TypeScript", "npm", "Gulp"] "categories": ["Continuous integration", "JavaScript", "TypeScript", "npm", "Gulp"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Publish Node.js Package", "name": "Publish Node.js Package",
"description": "Publishes a Node.js package to npm and GitHub Packages.", "description": "Publishes a Node.js package to npm and GitHub Packages.",
"iconName": "node-package-transparent", "iconName": "node-package-transparent",
"categories": ["JavaScript", "npm"] "categories": ["Continuous integration", "JavaScript", "npm"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "PHP", "name": "PHP",
"description": "Build and test a PHP application using Composer", "description": "Build and test a PHP application using Composer",
"iconName": "php", "iconName": "php",
"categories": ["PHP", "Composer"] "categories": ["Continuous integration", "PHP", "Composer"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Pylint", "name": "Pylint",
"description": "Lint a Python application with pylint.", "description": "Lint a Python application with pylint.",
"iconName": "python", "iconName": "python",
"categories": ["Python"] "categories": ["Continuous integration", "Python", "Bottle", "Flask"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Python application", "name": "Python application",
"description": "Create and test a Python application.", "description": "Create and test a Python application.",
"iconName": "python", "iconName": "python",
"categories": ["Python"] "categories": ["Continuous integration", "Python", "Bottle", "Flask"]
} }
@@ -2,5 +2,5 @@
"name": "Python Package using Anaconda", "name": "Python Package using Anaconda",
"description": "Create and test a Python package on multiple Python versions using Anaconda for package management.", "description": "Create and test a Python package on multiple Python versions using Anaconda for package management.",
"iconName": "python", "iconName": "python",
"categories": ["Python"] "categories": ["Continuous integration", "Python"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Python package", "name": "Python package",
"description": "Create and test a Python package on multiple Python versions.", "description": "Create and test a Python package on multiple Python versions.",
"iconName": "python", "iconName": "python",
"categories": ["Python"] "categories": ["Continuous integration", "Python", "Bottle", "Flask"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Publish Python Package", "name": "Publish Python Package",
"description": "Publish a Python Package to PyPI on release.", "description": "Publish a Python Package to PyPI on release.",
"iconName": "python", "iconName": "python",
"categories": ["Python"] "categories": ["Continuous integration", "Python"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "R package", "name": "R package",
"description": "Create and test an R package on multiple R versions.", "description": "Create and test an R package on multiple R versions.",
"iconName": "r", "iconName": "r",
"categories": ["R"] "categories": ["Continuous integration", "R"]
} }
-6
View File
@@ -1,6 +0,0 @@
{
"name": "Rails - Build and Run Linters",
"description": "Build Rails application and run linters",
"iconName": "ruby",
"categories": ["Ruby", "Rails"]
}
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Ruby", "name": "Ruby",
"description": "Build and test a Ruby project with Rake.", "description": "Build and test a Ruby project with Rake.",
"iconName": "ruby", "iconName": "ruby",
"categories": ["Ruby"] "categories": ["Continuous integration", "Ruby"]
} }
@@ -0,0 +1,6 @@
{
"name": "Rails - Install Dependencies and Run Linters",
"description": "Install dependencies and run linters on Rails application",
"iconName": "ruby",
"categories": ["Continuous integration", "Ruby", "Rails"]
}
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Rust", "name": "Rust",
"description": "Build and test a Rust project with Cargo.", "description": "Build and test a Rust project with Cargo.",
"iconName": "rust", "iconName": "rust",
"categories": ["Rust"] "categories": ["Continuous integration", "Rust"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Scala", "name": "Scala",
"description": "Build and test a Scala project with SBT.", "description": "Build and test a Scala project with SBT.",
"iconName": "scala", "iconName": "scala",
"categories": ["Scala", "Java"] "categories": ["Continuous integration", "Scala", "Java"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Swift", "name": "Swift",
"description": "Build and test a Swift Package.", "description": "Build and test a Swift Package.",
"iconName": "swift", "iconName": "swift",
"categories": ["Swift"] "categories": ["Continuous integration", "Swift"]
} }
+1 -1
View File
@@ -2,5 +2,5 @@
"name": "Webpack", "name": "Webpack",
"description": "Build a NodeJS project with npm and webpack.", "description": "Build a NodeJS project with npm and webpack.",
"iconName": "webpack", "iconName": "webpack",
"categories": ["JavaScript", "TypeScript", "npm", "Webpack"] "categories": ["Continuous integration", "JavaScript", "TypeScript", "npm", "Webpack"]
} }
@@ -3,7 +3,7 @@
# separate terms of service, privacy policy, and support # separate terms of service, privacy policy, and support
# documentation. # documentation.
# This workflow will download a prebuilt Ruby version, install dependencies, and run linters # This workflow will download a prebuilt Ruby version, install dependencies, and run linters
name: Build Rails and run linters name: Rails - Install dependencies and run linters
on: on:
push: push:
@@ -18,7 +18,7 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Setup Ruby and install gems - name: Setup Ruby and install gems
uses: ruby/setup-ruby@v1 uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
with: with:
bundler-cache: true bundler-cache: true
# Add or Replace any other security checks here # Add or Replace any other security checks here
+78 -71
View File
@@ -3,61 +3,57 @@
# separate terms of service, privacy policy, and support # separate terms of service, privacy policy, and support
# documentation. # documentation.
### The OpenShift Starter workflow will: # 💁 The OpenShift Starter workflow will:
# - Checkout your repository # - Checkout your repository
# - Perform a Docker build # - Perform a container image build
# - Push the built image to an image registry # - Push the built image to the GitHub Container Registry (GHCR)
# - Log in to your OpenShift cluster # - Log in to your OpenShift cluster
# - Create an OpenShift app from the image and expose it to the internet. # - Create an OpenShift app from the image and expose it to the internet
### Before you begin: # ️ Configure your repository and the workflow with the following steps:
# - Have write access to a container image registry such as quay.io or Dockerhub. # 1. Have access to an OpenShift cluster. Refer to https://www.openshift.com/try
# - Have access to an OpenShift cluster. # 2. Create the OPENSHIFT_SERVER and OPENSHIFT_TOKEN repository secrets. Refer to:
# - For instructions to get started with OpenShift see https://www.openshift.com/try # - https://github.com/redhat-actions/oc-login#readme
# - The project you wish to add this workflow to should have a Dockerfile. # - https://docs.github.com/en/actions/reference/encrypted-secrets
# - If you don't have a Dockerfile at the repository root, see the buildah-build step. # - https://cli.github.com/manual/gh_secret_set
# - Builds from scratch are also available, but require more configuration. # 3. (Optional) Edit the top-level 'env' section as marked with '🖊️' if the defaults are not suitable for your project.
# 4. (Optional) Edit the build-image step to build your project.
# The default build type is by using a Dockerfile at the root of the repository,
# but can be replaced with a different file, a source-to-image build, or a step-by-step buildah build.
# 5. Commit and push the workflow file to your default branch to trigger a workflow run.
### To get the workflow running: # 👋 Visit our GitHub organization at https://github.com/redhat-actions/ to see our actions and provide feedback.
# 1. Add this workflow to your repository.
# 2. Edit the top-level 'env' section, which contains a list of environment variables that must be configured.
# 3. Create the secrets referenced in the 'env' section under your repository Settings.
# 4. Edit the 'branches' in the 'on' section to trigger the workflow on a push to your branch.
# 5. Commit and push your changes.
# For a more sophisticated example, see https://github.com/redhat-actions/spring-petclinic/blob/main/.github/workflows/petclinic-sample.yaml
# Also see our GitHub organization, https://github.com/redhat-actions/
# ▶️ See a video of how to set up this workflow at https://www.youtube.com/watch?v=6hgBO-1pKho
name: OpenShift name: OpenShift
# ⬇️ Modify the fields marked with ⬇️ to fit your project, and create any secrets that are referenced.
# https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets
env: env:
# EDIT with your registry and registry path. # 🖊 EDIT your repository secrets to log into your OpenShift cluster and set up the context.
REGISTRY: quay.io/<username>
# ⬇️ EDIT with your registry username.
REGISTRY_USER: <username>
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
# ⬇️ EDIT to log into your OpenShift cluster and set up the context.
# See https://github.com/redhat-actions/oc-login#readme for how to retrieve these values. # See https://github.com/redhat-actions/oc-login#readme for how to retrieve these values.
# To get a permanent token, refer to https://github.com/redhat-actions/oc-login/wiki/Using-a-Service-Account-for-GitHub-Actions
OPENSHIFT_SERVER: ${{ secrets.OPENSHIFT_SERVER }} OPENSHIFT_SERVER: ${{ secrets.OPENSHIFT_SERVER }}
OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_TOKEN }} OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_TOKEN }}
# 🖊️ EDIT to set the kube context's namespace after login. Leave blank to use your user's default namespace.
# ⬇️ EDIT with any additional port your application should expose.
# By default, oc new-app action creates a service to the image's lowest numeric exposed port.
APP_PORT: ""
# ⬇️ EDIT if you wish to set the kube context's namespace after login. Leave blank to use the default namespace.
OPENSHIFT_NAMESPACE: "" OPENSHIFT_NAMESPACE: ""
# If you wish to manually provide the APP_NAME and TAG, set them here, otherwise they will be auto-detected. # 🖊️ EDIT to set a name for your OpenShift app, or a default one will be generated below.
APP_NAME: "" APP_NAME: ""
TAG: ""
# 🖊️ EDIT with the port your application should be accessible on.
# If the container image exposes *exactly one* port, this can be left blank.
# Refer to the 'port' input of https://github.com/redhat-actions/oc-new-app
APP_PORT: ""
# 🖊️ EDIT to change the image registry settings.
# Registries such as GHCR, Quay.io, and Docker Hub are supported.
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
IMAGE_REGISTRY_USER: ${{ github.actor }}
IMAGE_REGISTRY_PASSWORD: ${{ github.token }}
# 🖊️ EDIT to specify custom tags for the container image, or default tags will be generated below.
IMAGE_TAGS: ""
on: on:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows # https://docs.github.com/en/actions/reference/events-that-trigger-workflows
push: push:
# Edit to the branch(es) you want to build and deploy on each push. # Edit to the branch(es) you want to build and deploy on each push.
branches: [ $default-branch ] branches: [ $default-branch ]
@@ -65,32 +61,40 @@ on:
jobs: jobs:
openshift-ci-cd: openshift-ci-cd:
name: Build and deploy to OpenShift name: Build and deploy to OpenShift
# ubuntu-20.04 can also be used.
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
environment: production environment: production
outputs: outputs:
ROUTE: ${{ steps.deploy-and-expose.outputs.route }} ROUTE: ${{ steps.deploy-and-expose.outputs.route }}
SELECTOR: ${{ steps.deploy-and-expose.outputs.selector }} SELECTOR: ${{ steps.deploy-and-expose.outputs.selector }}
steps: steps:
- name: Check if secrets exists - name: Check for required secrets
uses: actions/github-script@v3 uses: actions/github-script@v4
with: with:
script: | script: |
const secrets = { const secrets = {
REGISTRY_PASSWORD: `${{ secrets.REGISTRY_PASSWORD }}`,
OPENSHIFT_SERVER: `${{ secrets.OPENSHIFT_SERVER }}`, OPENSHIFT_SERVER: `${{ secrets.OPENSHIFT_SERVER }}`,
OPENSHIFT_TOKEN: `${{ secrets.OPENSHIFT_TOKEN }}`, OPENSHIFT_TOKEN: `${{ secrets.OPENSHIFT_TOKEN }}`,
}; };
const GHCR = "ghcr.io";
if (`${{ env.IMAGE_REGISTRY }}`.startsWith(GHCR)) {
core.info(`Image registry is ${GHCR} - no registry password required`);
}
else {
core.info("A registry password is required");
secrets["IMAGE_REGISTRY_PASSWORD"] = `${{ secrets.IMAGE_REGISTRY_PASSWORD }}`;
}
const missingSecrets = Object.entries(secrets).filter(([ name, value ]) => { const missingSecrets = Object.entries(secrets).filter(([ name, value ]) => {
if (value.length === 0) { if (value.length === 0) {
core.warning(`Secret "${name}" is not set`); core.error(`Secret "${name}" is not set`);
return true; return true;
} }
core.info(`✔️ Secret "${name}" is set`); core.info(`✔️ Secret "${name}" is set`);
return false; return false;
}); });
if (missingSecrets.length > 0) { if (missingSecrets.length > 0) {
@@ -104,48 +108,50 @@ jobs:
core.info(`✅ All the required secrets are set`); core.info(`✅ All the required secrets are set`);
} }
- uses: actions/checkout@v2 - name: Check out repository
uses: actions/checkout@v2
- name: Determine app name - name: Determine app name
if: env.APP_NAME == '' if: env.APP_NAME == ''
run: | run: |
echo "APP_NAME=$(basename $PWD)" | tee -a $GITHUB_ENV echo "APP_NAME=$(basename $PWD)" | tee -a $GITHUB_ENV
- name: Determine tag - name: Determine image tags
if: env.TAG == '' if: env.IMAGE_TAGS == ''
run: | run: |
echo "TAG=${GITHUB_SHA::7}" | tee -a $GITHUB_ENV echo "IMAGE_TAGS=latest ${GITHUB_SHA::12}" | tee -a $GITHUB_ENV
# https://github.com/redhat-actions/buildah-build#readme # https://github.com/redhat-actions/buildah-build#readme
- name: Build from Dockerfile - name: Build from Dockerfile
id: image-build id: build-image
uses: redhat-actions/buildah-build@v2 uses: redhat-actions/buildah-build@v2
with: with:
image: ${{ env.APP_NAME }} image: ${{ env.APP_NAME }}
tags: ${{ env.TAG }} tags: ${{ env.IMAGE_TAGS }}
# If you don't have a dockerfile, see:
# https://github.com/redhat-actions/buildah-build#scratch-build-inputs # If you don't have a Dockerfile/Containerfile, refer to https://github.com/redhat-actions/buildah-build#scratch-build-inputs
# Otherwise, point this to your Dockerfile relative to the repository root. # Or, perform a source-to-image build using https://github.com/redhat-actions/s2i-build
# Otherwise, point this to your Dockerfile/Containerfile relative to the repository root.
dockerfiles: | dockerfiles: |
./Dockerfile ./Dockerfile
# https://github.com/redhat-actions/push-to-registry#readme # https://github.com/redhat-actions/push-to-registry#readme
- name: Push to registry - name: Push to registry
id: push-to-registry id: push-image
uses: redhat-actions/push-to-registry@v2 uses: redhat-actions/push-to-registry@v2
with: with:
image: ${{ steps.image-build.outputs.image }} image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.image-build.outputs.tags }} tags: ${{ steps.build-image.outputs.tags }}
registry: ${{ env.REGISTRY }} registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ env.REGISTRY_USER }} username: ${{ env.IMAGE_REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }} password: ${{ env.IMAGE_REGISTRY_PASSWORD }}
# The path the image was pushed to is now stored in ${{ steps.push-to-registry.outputs.registry-path }} # The path the image was pushed to is now stored in ${{ steps.push-image.outputs.registry-path }}
# oc-login works on all platforms, but oc must be installed first. - name: Install oc
# The GitHub Ubuntu runner already includes oc. uses: redhat-actions/openshift-tools-installer@v1
# Otherwise, https://github.com/redhat-actions/openshift-tools-installer can be used to install oc, with:
# as well as many other tools. oc: 4
# https://github.com/redhat-actions/oc-login#readme # https://github.com/redhat-actions/oc-login#readme
- name: Log in to OpenShift - name: Log in to OpenShift
@@ -163,18 +169,19 @@ jobs:
uses: redhat-actions/oc-new-app@v1 uses: redhat-actions/oc-new-app@v1
with: with:
app_name: ${{ env.APP_NAME }} app_name: ${{ env.APP_NAME }}
image: ${{ steps.push-to-registry.outputs.registry-path }} image: ${{ steps.push-image.outputs.registry-path }}
namespace: ${{ env.OPENSHIFT_NAMESPACE }} namespace: ${{ env.OPENSHIFT_NAMESPACE }}
port: ${{ env.APP_PORT }} port: ${{ env.APP_PORT }}
- name: View application route - name: Print application URL
env:
ROUTE: ${{ steps.deploy-and-expose.outputs.route }}
SELECTOR: ${{ steps.deploy-and-expose.outputs.selector }}
run: | run: |
[[ -n ${{ env.ROUTE }} ]] || (echo "Determining application route failed in previous step"; exit 1) [[ -n ${{ env.ROUTE }} ]] || (echo "Determining application route failed in previous step"; exit 1)
echo
echo "======================== Your application is available at: ========================" echo "======================== Your application is available at: ========================"
echo ${{ env.ROUTE }} echo ${{ env.ROUTE }}
echo "===================================================================================" echo "==================================================================================="
echo echo
echo "Your app can be taken down with: \"oc delete all --selector='${{ env.SELECTOR }}'\"" echo "Your app can be taken down with: \"oc delete all --selector='${{ env.SELECTOR }}'\""
env:
ROUTE: ${{ steps.deploy-and-expose.outputs.route }}
SELECTOR: ${{ steps.deploy-and-expose.outputs.selector }}
@@ -3,5 +3,5 @@
"description": "Build a Docker-based project and deploy it to OpenShift.", "description": "Build a Docker-based project and deploy it to OpenShift.",
"creator": "Red Hat", "creator": "Red Hat",
"iconName": "openshift", "iconName": "openshift",
"categories": ["Dockerfile","Deployment" ] "categories": ["Deployment", "Dockerfile"]
} }
+1
View File
@@ -0,0 +1 @@
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3.403 2.47a2.06 2.06 0 0 0-2.06 2.06v12.364a2.06 2.06 0 0 0 2.06 2.06h7.983l1.758 1.654a.31.31 0 0 0 .399.02l1.27-1.024c.388.148.768.227 1.166.266l.687 1.489a.305.305 0 0 0 .362.157l2.334-.704a.308.308 0 0 0 .215-.335l-.245-1.62c.151-.125.296-.255.434-.402.138-.147.262-.307.387-.475l1.62.157a.31.31 0 0 0 .321-.235l.554-2.374a.3.3 0 0 0-.18-.353l-1.525-.595a4.416 4.416 0 0 0-.342-1.141l.942-1.334a.31.31 0 0 0-.046-.397l-1.61-1.509V4.531a2.06 2.06 0 0 0-2.06-2.06zm0 4.121h14.423v4.383c-.31-.1-.62-.168-.94-.204l-.69-1.483a.301.301 0 0 0-.364-.156l-2.334.704a.301.301 0 0 0-.215.334l.26 1.606c-.16.134-.312.27-.45.416a4.743 4.743 0 0 0-.374.46l-1.631-.142a.3.3 0 0 0-.32.235l-.556 2.375a.306.306 0 0 0 .18.352l1.529.59c.046.285.123.56.221.833H3.403zm12.991 6.596a2.136 2.136 0 0 1 1.497.578 2.136 2.136 0 0 1 .097 3.02 2.136 2.136 0 0 1-3.018.094 2.136 2.136 0 0 1-.097-3.018 2.136 2.136 0 0 1 1.521-.674z" style="fill:#ef5350;stroke-width:1.0302"/></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB