From 0f959579bd1c0710d6b4b565f100c685f71c779c Mon Sep 17 00:00:00 2001 From: Rene Luria Date: Mon, 24 Oct 2022 16:41:49 +0200 Subject: [PATCH 1/3] add Jenkinsfile --- Jenkinsfile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..e69fb04 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,32 @@ +pipeline { + agent { + kubernetes { + yaml ''' + apiVersion: v1 + kind: Pod + metadata: + labels: + worker: tinderpokemon + spec: + containers: + - name: builder + image: python:3.10 + command: + - cat + tty: true + ''' + } + } + stages { + stage('Deploy') { + steps { + container('install pip') { + sh 'pip3 install python-swiftclient' + } + container('busybox') { + sh 'swift list' + } + } + } + } +} \ No newline at end of file -- 2.39.5 From 3dc554837fe43672eb7aa54c405442b653cd0840 Mon Sep 17 00:00:00 2001 From: Rene Luria Date: Mon, 24 Oct 2022 17:51:50 +0200 Subject: [PATCH 2/3] fix(ci): try to use Jenkinsfile --- Jenkinsfile | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e69fb04..e6a4d65 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,12 +4,9 @@ pipeline { yaml ''' apiVersion: v1 kind: Pod - metadata: - labels: - worker: tinderpokemon spec: containers: - - name: builder + - name: python image: python:3.10 command: - cat @@ -17,16 +14,24 @@ pipeline { ''' } } + environment { + SWIFT_CREDENTIALS = credentials("swift") + } stages { - stage('Deploy') { + stage('Deploy files') { steps { - container('install pip') { - sh 'pip3 install python-swiftclient' - } - container('busybox') { - sh 'swift list' + container('python') { + sh """ + pwd + """ + sh 'pip install python-swiftclient python-keystoneclient' + sh """ + . $SWIFT_CREDENTIALS + swift upload tinderpokemon *html + swift upload tinderpokemon assets/ + """ } } } } -} \ No newline at end of file +} -- 2.39.5 From ed2e1b331f1e0924458504879a75813b41ef8904 Mon Sep 17 00:00:00 2001 From: Rene Luria Date: Mon, 24 Oct 2022 18:15:22 +0200 Subject: [PATCH 3/3] fix(ci): upload only changed files --- Jenkinsfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e6a4d65..b63b1b5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -21,14 +21,11 @@ pipeline { stage('Deploy files') { steps { container('python') { - sh """ - pwd - """ sh 'pip install python-swiftclient python-keystoneclient' sh """ . $SWIFT_CREDENTIALS - swift upload tinderpokemon *html - swift upload tinderpokemon assets/ + swift upload --changed tinderpokemon *html + swift upload --changed tinderpokemon assets/ """ } } -- 2.39.5