@@ -79,6 +79,48 @@ install_nodejs () {
79
79
ln -s ${NODEJS_PREFIX} /bin/npm /usr/local/bin/npm
80
80
}
81
81
82
+ set_coredns () {
83
+ # test a domain name is configured as upstream
84
+ echo " 127.0.0.1 test.com" | sudo tee -a /etc/hosts
85
+ echo " ::1 ipv6.local" | sudo tee -a /etc/hosts
86
+ # test certificate verification
87
+ echo " 127.0.0.1 admin.apisix.dev" | sudo tee -a /etc/hosts
88
+ cat /etc/hosts # check GitHub Action's configuration
89
+
90
+ # override DNS configures
91
+ if [ -f " /etc/netplan/50-cloud-init.yaml" ]; then
92
+ sudo pip3 install yq
93
+
94
+ tmp=$( mktemp)
95
+ yq -y ' .network.ethernets.eth0."dhcp4-overrides"."use-dns"=false' /etc/netplan/50-cloud-init.yaml | \
96
+ yq -y ' .network.ethernets.eth0."dhcp4-overrides"."use-domains"=false' | \
97
+ yq -y ' .network.ethernets.eth0.nameservers.addresses[0]="8.8.8.8"' | \
98
+ yq -y ' .network.ethernets.eth0.nameservers.search[0]="apache.org"' > $tmp
99
+ mv $tmp /etc/netplan/50-cloud-init.yaml
100
+ cat /etc/netplan/50-cloud-init.yaml
101
+ sudo netplan apply
102
+ sleep 3
103
+
104
+ sudo mv /etc/resolv.conf /etc/resolv.conf.bak
105
+ sudo ln -s /run/systemd/resolve/resolv.conf /etc/
106
+ fi
107
+ cat /etc/resolv.conf
108
+
109
+ mkdir -p build-cache
110
+
111
+ if [ ! -f " build-cache/coredns_1_8_1" ]; then
112
+ wget https://github.com/coredns/coredns/releases/download/v1.8.1/coredns_1.8.1_linux_amd64.tgz
113
+ tar -xvf coredns_1.8.1_linux_amd64.tgz
114
+ mv coredns build-cache/
115
+
116
+ touch build-cache/coredns_1_8_1
117
+ fi
118
+
119
+ pushd t/coredns || exit 1
120
+ ../../build-cache/coredns -dns.port=1053 &
121
+ popd || exit 1
122
+ }
123
+
82
124
GRPC_SERVER_EXAMPLE_VER=20210819
83
125
84
126
linux_get_dependencies () {
0 commit comments