专属域名
文档搜索
轩辕助手
Run助手
邀请有礼
返回顶部
快速返回页面顶部
收起
收起工具栏
轩辕镜像 官方专业版
轩辕镜像 官方专业版轩辕镜像 官方专业版官方专业版
首页个人中心搜索镜像

交易
充值流量我的订单
工具
提交工单镜像收录一键安装
Npm 源Pip 源Homebrew 源
帮助
常见问题
其他
关于我们网站地图

官方QQ群: 1072982923

emeraldsquad/cf-flyway-resource Docker 镜像 - 轩辕镜像

cf-flyway-resource
emeraldsquad/cf-flyway-resource
emeraldsquad
Concourse-CI resource : Flyway migrations on Cloud Foundry database services.
0 次下载
🙃 代码没问题,结果发布失败在拉镜像
镜像简介版本下载
🙃 代码没问题,结果发布失败在拉镜像

Version control for your database so you can migrate it with ease and confidence to Cloud Foundry database services with concourse-ci and Flyway.

Features:

  • Seamless connection to Cloud Foundry database services.
  • Support all flyway cli commands.
  • Support flyway configuration file.
  • Support Community and Pro Edition
  • Output database service metadata.

![emeraldsquad/cf-flyway-resource]([***]

resource_types

The image cf-flyway-resource is built from ubuntu:22.04.

yml
- name: cf-flyway-resource
  type: docker-image
  source:
    repository: emeraldsquad/cf-flyway-resource
    tag: 5.0.0

resources

yml
- name: cf-flyway
  type: cf-flyway-resource
  source:
    api: ((pcf-api))   
    username: ((product-name))-ciuser
    password: ((pcf-ciuser-passwd))
    organization: ((product-name))-org
    space: ((pcf-space))
    service: ((database-service-name))
source
  • api : required the api endpoint of the Cloud Foundry Cloud Controller
  • username: required username to authenticate
  • password: required password to authenticate
  • organization : required the name of the organization to push to
  • space : required the name of the space to push to
  • service : required the name of the database service instance to push to
yml
- name: cf-flyway
  type: cf-flyway-resource
  source:
    api: cf-api-endpoint
    username: cf-user
    password: cf-user-password
    organization: organization-name
    space: space-name
    service: service-instance-name

check

version

The check script always returns the current version number, or generate an initial version if none was received.

Version is expressed as datetime (utc).

in

version

The in script always returns the current version number. Therefore, the resources cannot be used as an input trigger.

metadata

Read service information from the cf api to produce metadata.

yml
cf_api : [***]
cf_org : organization-name
cf_space : space-name
dashboard_url : https://{hostname}/service-instances/53rv1c30-1n5t-aNc3-Gu1d-000000000000/
metadata_url : /v2/service_instances/53rv1c30-1n5t-aNc3-Gu1d-000000000000
service_instance : cf-db-service-instance-name
service_label : cf-db-service-name
service_plan : cf-db-service-plan

out

migration

Migrate database schemas to CloudFoundry database service.

The out script creates a service-key on the Cloud Foundry database service. It then reads the credentials of the service-key and generate a flyway.conf file containing the Cloud Foundry database service-key url, username and password.

The generated flyway.conf file will also have flyway.cleanDisabled=true set by default.

Any other flyway configuration provided by the user is also appended to the generated flyway.conf file. Note that the out script will always override the following config:

conf
flyway.url={service-key jdbc:driver//url/database}  # Overwritten by Cloud Foundry service-key credentials
flyway.user={service-key username}                  # Overwritten by Cloud Foundry service-key credentials
flyway.password={service-key password}              # Overwritten by Cloud Foundry service-key credentials
flyway.locations={params.locations}                 # Overwritten by locations parameter (required)
flyway.cleanDisabled=true                           # Overwritten by clean_disabled parameter (optional, default=true)

The out script then execute flyway commands. If a command list parameters is set, they will be executed sequentialy. If no command list parameters are set, the script defaults to the following commands.

  • flyway info
  • flyway migrate
  • flyway info

The service-key can be automatically deleted by setting the delete_service_key flag to true.

Database supported
  • Azure SQL Database (Cloud Service Broker)
  • Azure SQL Database (Microsoft Azure Service Broker)
  • a9s PostgreSQL
  • Crunchy PostgreSQL
  • MySQL for PCF
run_task (optional)

Alternatively, the out script can push an lightweight flyway application and bind it to the Cloud Foundry database service. It then reads the credentials of the service-binding and generate a flyway.conf file containing the Cloud Foundry database service-key url, username and password.

The out script then execute flyway commands trough Cloud Foundry run-task command.

The application can be automatically unbinded and deleted by setting the delete_application flag to true.

This option is especially usefull when you Cloud Foundry platform has access to a database service while your Concourse instance does not.

manifest

The pushed flyway application uses the following manifest.

yml
applications:
- name: {service-instance-name}-flyway
  buildpacks: [binary_buildpack]
  health-check-type: process
  no-route: true
  instances: 0                            # faster staging time
  disk_quota: 256M
  memory: 256M
  command: sleep 3600                     # ensure the app will stop after 1h.
ssh

To open an ssh connection to the flyway application, first scale the application to one instance before starting it. Once the application is started you will be able to open an ssh connection.

bash
cf scale {service-instance-name}-flyway -i 1
bash
cf start {service-instance-name}-flyway
bash
cf ssh {service-instance-name}-flyway

The flyway_cli inside the application container is already configured to connect to the Cloud Foundry database service.

bash
vcap@xxxxxxxx-xxxx-xxxx-xxxx-xxxx:~$ cd app

vcap@xxxxxxxx-xxxx-xxxx-xxxx-xxxx:~/app$ ./flyway info
Flyway Community Edition 9.4.0 by Redgate
Database: {database connection information}
Schema version: << Empty Schema >>

+-----------+---------+---------------------+------+--------------+---------+
| Category  | Version | Description         | Type | Installed On | State   |
+-----------+---------+---------------------+------+--------------+---------+
| Versioned | 1.0     | migration initial   | SQL  |              | Success |
+-----------+---------+---------------------+------+--------------+---------+

Remember to stop the application when finished

bash
cf stop {service-instance-name}-flyway
params
  • locations required
    • One of:
      • Comma-separated list of locations to scan recursively for migrations.
      • YAML list of locations to scan recursively for migrations.
    • The location type is determined by its prefix.
    • Unprefixed locations or locations starting with classpath: point to a package on the classpath and may contain both SQL and Java-based migrations.
    • Locations starting with filesystem: point to a directory on the filesystem, may only contain SQL migrations and are only scanned recursively down non-hidden directories.
  • commands optional
    • List of commands to execute. (default: [info, migrate, info])
    • Available commands are:
      • migrate : Migrates the database
      • clean : Drops all objects in the configured schemas
      • info : Prints the information about applied, current and pending migrations
      • validate : Validates the applied migrations against the ones on the classpath
      • undo : [pro] Undoes the most recently applied versioned migration
      • baseline : Baselines an existing database at the baselineVersion
      • repair : Repairs the schema history table
  • clean_disabled optional
    • Whether to disabled clean. (default: true)
    • This is especially useful for production environments where running clean can be quite a career limiting move.
  • delete_service_key optional
    • Whether to delete the service-key on the Cloud Foundry database service when done. (default: false)
    • This is especially useful for on-demand qa environment.
  • flyway_conf optional
    • One of:
      • path to an existing flyway.conf file.
      • inline flyway configuration.
    • The following configuration will be overwritten by the out script
      • flyway.url
      • flyway.user
      • flyway.password
      • flyway.locations
      • flyway.cleanDisabled
  • jdbc_builder optional
    • Use this feature to connect to unrecognized database services.
    • One of:
      • path to an executable shell script.
      • inline shell script.
    • Script receives the CloundFoundry service-key json credentials has positional parameter $1.
    • Script output CloundFoundry database jdbc url.
  • run_task optional
    • true (default): The resource will :
      • Create an application in Cloud Foundry and bind it to your database service.
      • Generate a flyway.conf file.
      • Package the flyway_cli along with the generated flyway.conf and your migration files.
      • Push the application to Cloud Foundry.
      • Execute flyway commands trough Cloud Foundry run-task command.
    • false : The resource will :
      • Create a service-key on your database service.
      • Generate a flyway.conf file.
      • Execute flyway commands inside the container runned by a concourse worker.
  • delete_application optional
    • Whether to unbind and delete the application pushed to Cloud Foundry when done when using run_task: true. (default: false)
    • This is especially useful for on-demand qa environment.
  • memory optional
    • Specify the memory limit for the task when using run_task: true. (default: 1024M)
    • This attribute requires a unit of measurement: B, K, KB, M, MB, G, GB, T, or TB in upper case or lower case.
  • disk_quota optional
    • Specify the disk limit for the task when using run_task: true. (default: 1024M)
    • This attribute requires a unit of measurement: B, K, KB, M, MB, G, GB, T, or TB in upper case or lower case.
  • cf_logs_wait_time optional
    • Specify the delay in seconds before retrieving cf task logs execution when using run_task: true (default: 15)
  • cf_logs_max_retry_count optional
    • Specify the maximum count of retries to get the cf task logs execution when using run_task: true (default: 3)
Exemples

1. Only use the required locations parameter

yml
jobs:
- name: deploy
  plan:
  - get: my-app-package
  - put: cf-flyway
    params:
      locations: filesystem:my-app-package/DB/Schema

2. Add a flyway configuration file

yml
jobs:
- name: deploy
  plan:
  - get: my-app-package
  - put: cf-flyway
    params:
      locations: filesystem:my-app-package/DB/Schema
      flyway_conf: my-app-package/DB/flyway.config

3. Add inline flyway configuration

yml
jobs:
- name: deploy
  plan:
  - get: my-app-package
  - put: cf-flyway
    params:
      locations: filesystem:my-app-package/DB/Schema
      flyway_conf: |
        flyway.schemas=dbo
        flyway.connectRetries=2

4. Use a command sequence

yml
jobs:
- name: deploy
  plan:
  - get: my-app-package
  - put: cf-flyway
    params:
      locations: filesystem:my-app-package/DB/Schema
      commands: [info, validate]

5. Use Flyway Pro feature

yml
jobs:
- name: deploy
  plan:
  - get: my-app-package
  - put: cf-flyway
    params:
      locations: filesystem:my-app-package/DB/Schema
      commands: [info, undo, info]
      flyway_conf: |
        flyway.licenseKey=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

6. Use jdbc_builder

yml
jobs:
- name: deploy
  plan:
  - get: my-app-package
  - put: cf-flyway
    params:
      locations: filesystem:my-app-package/DB/Schema
      jdbc_builder: |
        echo jdbc:postgresql://$(echo $1 | jq -r '.uri' | grep -Poh '(?<=@).*')

7. Use run_task and delete application when migration is complete

yml
jobs:
- name: deploy
  plan:
  - get: my-app-package
  - put: cf-flyway
    params:
      run_task: true
      delete_application: true
      locations: filesystem:my-app-package/DB/Schema

8. Use memory and disk_quota when migration is done on a PCF app

yml
jobs:
- name: deploy
  plan:
  - get: my-app-package
  - put: cf-flyway
    params:
      run_task: true
      locations: filesystem:my-app-package/DB/Schema
      memory: 256M
      disk_quota: 256M
version

The out script always returns a new version number.

metadata

Read service information from the cf api to produce metadata.

yml
cf_api : [***]
cf_org : organization-name
cf_space : space-name
dashboard_url : https://{hostname}/service-instances/53rv1c30-1n5t-aNc3-Gu1d-000000000000/
metadata_url : /v2/service_instances/53rv1c30-1n5t-aNc3-Gu1d-000000000000
service_instance : cf-db-service-instance-name
service_label : cf-db-service-name
service_plan : cf-db-service-plan
查看更多 cf-flyway-resource 相关镜像 →
concourse/git-resource logo
concourse/git-resource
concourse
跟踪Git仓库中的提交,用于CI/CD流程中监控代码提交记录的Concourse资源镜像。
5100M+ pulls
上次更新:3 天前
concourse/s3-resource logo
concourse/s3-resource
concourse
S3资源镜像通过文件名模式匹配识别版本号,实现S3桶中对象的版本控制。
1100M+ pulls
上次更新:3 天前
concourse/time-resource logo
concourse/time-resource
concourse
Concourse CI的时间资源,用于按配置的时间间隔报告新版本,支持设置任意长的时间间隔。
110M+ pulls
上次更新:3 天前
concourse/pool-resource logo
concourse/pool-resource
concourse
提供锁池(模拟信号量),用于锁定环境、管道流程等需串行交互的实体,由Git仓库支持,配置与git-resource相似。
10M+ pulls
上次更新:3 天前
concourse/docker-image-resource logo
concourse/docker-image-resource
concourse
用于跟踪和构建Docker镜像的资源,提供镜像版本跟踪与自动化构建能力,支持与CI/CD流程集成,适用于Concourse等CI/CD平台。
4100M+ pulls
上次更新:3 天前
concourse/mock-resource logo
concourse/mock-resource
concourse
用于测试资源及资源类型操作的模拟资源镜像,无需依赖外部环境。
10M+ pulls
上次更新:3 天前

轩辕镜像配置手册

探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式

登录仓库拉取

通过 Docker 登录认证访问私有仓库

Linux

在 Linux 系统配置镜像服务

Windows/Mac

在 Docker Desktop 配置镜像

Docker Compose

Docker Compose 项目配置

K8s Containerd

Kubernetes 集群配置 Containerd

K3s

K3s 轻量级 Kubernetes 镜像加速

Dev Containers

VS Code Dev Containers 配置

MacOS OrbStack

MacOS OrbStack 容器配置

宝塔面板

在宝塔面板一键配置镜像

群晖

Synology 群晖 NAS 配置

飞牛

飞牛 fnOS 系统配置镜像

极空间

极空间 NAS 系统配置服务

爱快路由

爱快 iKuai 路由系统配置

绿联

绿联 NAS 系统配置镜像

威联通

QNAP 威联通 NAS 配置

Podman

Podman 容器引擎配置

Singularity/Apptainer

HPC 科学计算容器配置

其他仓库配置

ghcr、Quay、nvcr 等镜像仓库

专属域名拉取

无需登录使用专属域名

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

轩辕镜像免费版与专业版有什么区别?

免费版仅支持 Docker Hub 访问,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。

轩辕镜像支持哪些镜像仓库?

专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等;免费版仅支持 docker.io。

流量耗尽错误提示

当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。

410 错误问题

通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。

manifest unknown 错误

先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。

镜像拉取成功后,如何去掉轩辕镜像域名前缀?

使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
镜像详情
...
emeraldsquad/cf-flyway-resource
官方博客Docker 镜像使用技巧与技术博客
热门镜像查看热门 Docker 镜像推荐
一键安装一键安装 Docker 并配置镜像源
咨询镜像拉取问题请 提交工单,官方技术交流群:1072982923
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
咨询镜像拉取问题请提交工单,官方技术交流群:
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
官方邮箱:点击复制邮箱
©2024-2026 源码跳动
官方邮箱:点击复制邮箱Copyright © 2024-2026 杭州源码跳动科技有限公司. All rights reserved.