Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix pipeline to work on new runners (TT-1588) #79

Merged
merged 27 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f25aa1d
debug pipeline
fredrikmonsen May 8, 2024
56fd992
use self hosted for first step
fredrikmonsen May 8, 2024
60dec5a
try to use different runner
fredrikmonsen May 8, 2024
66dd475
try arc-runner
fredrikmonsen May 8, 2024
1ee361e
run on linux runner
fredrikmonsen May 8, 2024
13f13a5
install maven
fredrikmonsen May 8, 2024
e5e00a8
install wget
fredrikmonsen May 8, 2024
7ec6e95
yes
fredrikmonsen May 8, 2024
06a09f5
change export
fredrikmonsen May 8, 2024
c0b5f99
remove maven opts
fredrikmonsen May 8, 2024
c7784e5
debug
fredrikmonsen May 8, 2024
87902b1
try different path export
fredrikmonsen May 8, 2024
1981a27
export path to bashrc
fredrikmonsen May 8, 2024
6acb3bd
move and create symlink
fredrikmonsen May 13, 2024
31a5c55
run mvn with proxy
fredrikmonsen May 13, 2024
fa07876
remove double dash
fredrikmonsen May 13, 2024
6e752db
Enclose argument value in double quotes
fredrikmonsen May 13, 2024
021642c
add proxy port
fredrikmonsen May 13, 2024
5c9d7f1
run with full stack trace
fredrikmonsen May 13, 2024
f9a6d81
https for proxyport https
fredrikmonsen May 13, 2024
e205c6c
restore
fredrikmonsen May 14, 2024
70c74f6
wait for docker
fredrikmonsen May 14, 2024
7e1161f
exec sleep for docker in bash
fredrikmonsen May 14, 2024
3544945
specify linux runner
fredrikmonsen May 14, 2024
8f50189
cleanup, try stage deploy from branch
fredrikmonsen May 14, 2024
9100d1a
Re-apply conditional statements for image build and deploy jobs
fredrikmonsen May 14, 2024
0c0c498
Remove old echo in maven install step
fredrikmonsen May 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions .github/workflows/ci_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ on:
- "main"

env:
MAVEN_INFO: "--batch-mode -Pcoverage -Dmaven.repo.local=.m2/repository -Dbuild.tag=$GITHUB_REF_NAME -Dbuild.commit-id-short=$GITHUB_SHA -Dbuild.commit-id-long=$GITHUB_SHA -Dbuild.pipeline-id=$GITHUB_RUN_ID"
MAVEN_INFO: "--batch-mode -Dmaven.repo.local=.m2/repository -Dbuild.tag=$GITHUB_REF_NAME -Dbuild.commit-id-short=$GITHUB_SHA -Dbuild.commit-id-long=$GITHUB_SHA -Dbuild.pipeline-id=$GITHUB_RUN_ID"
APP_VERSION: ${{ github.ref_name }}

jobs:
build-and-test:
name: Build and Test
runs-on: ubuntu-latest
runs-on: [self-hosted-linux]
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -35,8 +35,24 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Install Maven
run: |
sudo apt-get update -y
sudo apt-get install wget -y
wget https://downloads.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz
tar xzf apache-maven-3.9.6-bin.tar.gz
sudo mv apache-maven-3.9.6 /opt/
sudo ln -s /opt/apache-maven-3.9.6/bin/mvn /usr/local/bin/mvn
echo "PATH=/opt/apache-maven-3.9.6/bin:$PATH" >> $GITHUB_ENV
mvn -v

- name: Build and Test
run: mvn ${{ env.MAVEN_INFO }} verify
run: |
sed -i "s/https_proxy_host/${{ secrets.HTTP_PROXY }}/g" .m2/settings.xml
sed -i "s/https_proxy_port/${{ secrets.HTTP_PROXY_PORT }}/g" .m2/settings.xml
sed -i "s/http_proxy_host/${{ secrets.HTTP_PROXY }}/g" .m2/settings.xml
sed -i "s/http_proxy_port/${{ secrets.HTTP_PROXY_PORT }}/g" .m2/settings.xml
mvn -e -s .m2/settings.xml ${{ env.MAVEN_INFO }} verify

- name: Upload artifact
uses: actions/upload-artifact@v4
Expand All @@ -55,7 +71,7 @@ jobs:
needs: build-and-test
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
name: Create and push Docker image
runs-on: [self-hosted]
runs-on: [self-hosted-linux]
steps:
- name: Check out the repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -99,7 +115,7 @@ jobs:
name: Deploy to kubernetes stage environment
needs: build-and-publish-docker-image
if: github.ref == 'refs/heads/main'
runs-on: [self-hosted]
runs-on: [self-hosted-linux]
environment: stage
steps:
- name: Checkout repository
Expand Down Expand Up @@ -140,7 +156,7 @@ jobs:
name: Deploy to kubernetes prod environment
needs: build-and-publish-docker-image
if: startsWith(github.event.ref, 'refs/tags/v')
runs-on: [self-hosted]
runs-on: [self-hosted-linux]
environment: prod
steps:
- name: Checkout repository
Expand Down
22 changes: 22 additions & 0 deletions .m2/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd"
xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<proxies>
<!-- Values are inserted from GitHub Actions pipeline -->
<proxy>
<id>nb-proxy-http</id>
<active>true</active>
<protocol>http</protocol>
<host>http_proxy_host</host>
<port>http_proxy_port</port>
<nonProxyHosts>localhost|127.0.0.1|docker</nonProxyHosts>
</proxy>
<proxy>
<id>nb-proxy-https</id>
<active>true</active>
<protocol>https</protocol>
<host>https_proxy_host</host>
<port>https_proxy_port</port>
<nonProxyHosts>localhost|127.0.0.1|docker</nonProxyHosts>
</proxy>
</proxies>
</settings>