-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.0 release
- Loading branch information
Showing
9 changed files
with
264 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
wg-push | ||
caddy-push | ||
api-push | ||
*-push | ||
key.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
pipeline { | ||
agent any | ||
environment { | ||
reg_pw = credentials('Dockerhub PW') | ||
environ = sh ( | ||
script: ''' | ||
echo $BRANCH_NAME|sed 's@origin/@@g' | ||
''', | ||
returnStdout: true | ||
).trim() | ||
} | ||
stages { | ||
stage('Build') { | ||
environment { | ||
environ = sh ( | ||
script: ''' | ||
echo $BRANCH_NAME|sed 's@origin/@@g' | ||
''', | ||
returnStdout: true | ||
).trim() | ||
tag = sh ( | ||
script: ''' | ||
if [ "${environ}" = "dev" ]; then | ||
echo "staging" | ||
elif [ "${environ}" = "master" ]; then | ||
echo "latest" | ||
else | ||
echo "nobuild" | ||
fi | ||
''', | ||
returnStdout: true | ||
).trim() | ||
} | ||
steps { | ||
script { | ||
if( "${tag}" == "nobuild" ) { | ||
currentBuild.getRawBuild().getExecutor().interrupt(Result.ABORTED) | ||
print("Ignoring branch ${tag}") | ||
sleep(1) | ||
} | ||
} | ||
git url: 'https://github.com/Native-Planet/anchor-source.git', | ||
credentialsId: 'Github token', | ||
branch: "${environ}" | ||
sh "docker login -u nativeplanet -p $reg_pw docker.io" | ||
dir("${env.WORKSPACE}/"){ | ||
sh ( | ||
script: ''' | ||
docker buildx build --push --tag nativeplanet/anchor-api:${tag} --platform linux/amd64 --no-cache ./api/ | ||
docker buildx build --push --tag nativeplanet/anchor-wg:${tag} --platform linux/amd64 --no-cache ./wg/ | ||
docker buildx build --push --tag nativeplanet/anchor-caddy:${tag} --platform linux/amd64 --no-cache ./caddy/ | ||
''', | ||
returnStdout: true | ||
) | ||
} | ||
} | ||
} | ||
} | ||
post { | ||
always { | ||
cleanWs deleteDirs: true, notFailBuild: true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM alpine:3.17 AS builder | ||
RUN mkdir /app | ||
WORKDIR /app | ||
# Install dependencies: | ||
RUN apk update && apk add --update musl-dev gcc patchelf python3-dev py3-pip chrpath wget make ccache | ||
RUN pip install nuitka zstandard wheel | ||
COPY requirements.txt /app/requirements.txt | ||
RUN pip install -r /app/requirements.txt | ||
|
||
# Build | ||
COPY ./ /app | ||
RUN python3 -m nuitka --onefile app.py | ||
|
||
# Clean layer | ||
FROM alpine:3.17 | ||
COPY --from=builder /app/app.bin /app/anchor | ||
CMD ["./app/anchor"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.