[build] Set up CI with Azure Pipelines (#108)

This requires to upgrade testcontainers to 1.15.1 to fix can't pull images problem
pull/95/head
Jark Wu 4 years ago committed by GitHub
parent 6c4f1f8528
commit 05a28a4428
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,39 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Maven
# Build your Java project and run tests with Apache Maven.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java
trigger:
branches:
include:
- '*' # must quote since "*" is a YAML reserved character; we want a string
pool:
vmImage: 'ubuntu-16.04'
steps:
- task: Maven@3
inputs:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
goals: 'package'

@ -18,7 +18,6 @@
package com.alibaba.ververica.cdc.connectors.mysql.utils;
import org.jetbrains.annotations.NotNull;
import org.testcontainers.containers.ContainerLaunchException;
import org.testcontainers.containers.JdbcDatabaseContainer;
@ -50,7 +49,6 @@ public class MySQLContainer extends JdbcDatabaseContainer {
addExposedPort(MYSQL_PORT);
}
@NotNull
@Override
protected Set<Integer> getLivenessCheckPorts() {
return new HashSet<>(getMappedPort(MYSQL_PORT));

@ -26,6 +26,7 @@ import org.slf4j.LoggerFactory;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.containers.output.Slf4jLogConsumer;
import org.testcontainers.lifecycle.Startables;
import org.testcontainers.utility.DockerImageName;
import java.net.URL;
import java.nio.file.Files;
@ -50,8 +51,11 @@ public abstract class PostgresTestBase extends AbstractTestBase {
private static final Logger LOG = LoggerFactory.getLogger(PostgresTestBase.class);
private static final Pattern COMMENT_PATTERN = Pattern.compile("^(.*)--.*$");
private static final DockerImageName PG_IMAGE = DockerImageName
.parse("debezium/postgres:9.6")
.asCompatibleSubstituteFor("postgres");
protected static final PostgreSQLContainer<?> POSTGERS_CONTAINER = new PostgreSQLContainer<>("debezium/postgres:9.6")
protected static final PostgreSQLContainer<?> POSTGERS_CONTAINER = new PostgreSQLContainer<>(PG_IMAGE)
.withDatabaseName("postgres")
.withUsername("postgres")
.withPassword("postgres")

@ -64,7 +64,7 @@ under the License.
<properties>
<flink.version>1.11.1</flink.version>
<debezium.version>1.2.1.Final</debezium.version>
<testcontainers.version>1.14.3</testcontainers.version>
<testcontainers.version>1.15.1</testcontainers.version>
<java.version>1.8</java.version>
<scala.binary.version>2.11</scala.binary.version>
<maven.compiler.source>${java.version}</maven.compiler.source>

Loading…
Cancel
Save